├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ComponentsTestApp ├── ComponentsTestApp.xcodeproj │ └── project.pbxproj └── ComponentsTestApp │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── testimage.imageset │ │ ├── Contents.json │ │ └── iostes1.jpg │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── HomeViewController.swift │ ├── Info.plist │ ├── LibraryDemoViewControllers │ ├── AutoCompleteTextFieldViewController.swift │ ├── ImageSliderDemoViewController.swift │ ├── PinchableImageViewDemoViewController.swift │ └── StatusBarDemoViewController.swift │ └── SceneDelegate.swift ├── LICENSE ├── Package.resolved ├── Package.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Local Podspecs │ └── StatusBarView.podspec.json ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── SDWebImage │ ├── LICENSE │ ├── README.md │ ├── SDWebImage │ │ ├── Core │ │ │ ├── NSButton+WebCache.h │ │ │ ├── NSButton+WebCache.m │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── NSImage+Compatibility.h │ │ │ ├── NSImage+Compatibility.m │ │ │ ├── SDAnimatedImage.h │ │ │ ├── SDAnimatedImage.m │ │ │ ├── SDAnimatedImagePlayer.h │ │ │ ├── SDAnimatedImagePlayer.m │ │ │ ├── SDAnimatedImageRep.h │ │ │ ├── SDAnimatedImageRep.m │ │ │ ├── SDAnimatedImageView+WebCache.h │ │ │ ├── SDAnimatedImageView+WebCache.m │ │ │ ├── SDAnimatedImageView.h │ │ │ ├── SDAnimatedImageView.m │ │ │ ├── SDDiskCache.h │ │ │ ├── SDDiskCache.m │ │ │ ├── SDImageAPNGCoder.h │ │ │ ├── SDImageAPNGCoder.m │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCache.m │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDImageCacheConfig.m │ │ │ ├── SDImageCacheDefine.h │ │ │ ├── SDImageCacheDefine.m │ │ │ ├── SDImageCachesManager.h │ │ │ ├── SDImageCachesManager.m │ │ │ ├── SDImageCoder.h │ │ │ ├── SDImageCoder.m │ │ │ ├── SDImageCoderHelper.h │ │ │ ├── SDImageCoderHelper.m │ │ │ ├── SDImageCodersManager.h │ │ │ ├── SDImageCodersManager.m │ │ │ ├── SDImageFrame.h │ │ │ ├── SDImageFrame.m │ │ │ ├── SDImageGIFCoder.h │ │ │ ├── SDImageGIFCoder.m │ │ │ ├── SDImageGraphics.h │ │ │ ├── SDImageGraphics.m │ │ │ ├── SDImageHEICCoder.h │ │ │ ├── SDImageHEICCoder.m │ │ │ ├── SDImageIOAnimatedCoder.h │ │ │ ├── SDImageIOAnimatedCoder.m │ │ │ ├── SDImageIOCoder.h │ │ │ ├── SDImageIOCoder.m │ │ │ ├── SDImageLoader.h │ │ │ ├── SDImageLoader.m │ │ │ ├── SDImageLoadersManager.h │ │ │ ├── SDImageLoadersManager.m │ │ │ ├── SDImageTransformer.h │ │ │ ├── SDImageTransformer.m │ │ │ ├── SDMemoryCache.h │ │ │ ├── SDMemoryCache.m │ │ │ ├── SDWebImageCacheKeyFilter.h │ │ │ ├── SDWebImageCacheKeyFilter.m │ │ │ ├── SDWebImageCacheSerializer.h │ │ │ ├── SDWebImageCacheSerializer.m │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageCompat.m │ │ │ ├── SDWebImageDefine.h │ │ │ ├── SDWebImageDefine.m │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloader.m │ │ │ ├── SDWebImageDownloaderConfig.h │ │ │ ├── SDWebImageDownloaderConfig.m │ │ │ ├── SDWebImageDownloaderDecryptor.h │ │ │ ├── SDWebImageDownloaderDecryptor.m │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageDownloaderOperation.m │ │ │ ├── SDWebImageDownloaderRequestModifier.h │ │ │ ├── SDWebImageDownloaderRequestModifier.m │ │ │ ├── SDWebImageDownloaderResponseModifier.h │ │ │ ├── SDWebImageDownloaderResponseModifier.m │ │ │ ├── SDWebImageError.h │ │ │ ├── SDWebImageError.m │ │ │ ├── SDWebImageIndicator.h │ │ │ ├── SDWebImageIndicator.m │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageManager.m │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImageOptionsProcessor.h │ │ │ ├── SDWebImageOptionsProcessor.m │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImagePrefetcher.m │ │ │ ├── SDWebImageTransition.h │ │ │ ├── SDWebImageTransition.m │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIButton+WebCache.m │ │ │ ├── UIImage+ExtendedCacheData.h │ │ │ ├── UIImage+ExtendedCacheData.m │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+ForceDecode.m │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+GIF.m │ │ │ ├── UIImage+MemoryCacheCost.h │ │ │ ├── UIImage+MemoryCacheCost.m │ │ │ ├── UIImage+Metadata.h │ │ │ ├── UIImage+Metadata.m │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImage+MultiFormat.m │ │ │ ├── UIImage+Transform.h │ │ │ ├── UIImage+Transform.m │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIImageView+WebCache.m │ │ │ ├── UIView+WebCache.h │ │ │ ├── UIView+WebCache.m │ │ │ ├── UIView+WebCacheOperation.h │ │ │ └── UIView+WebCacheOperation.m │ │ └── Private │ │ │ ├── NSBezierPath+RoundedCorners.h │ │ │ ├── NSBezierPath+RoundedCorners.m │ │ │ ├── SDAssociatedObject.h │ │ │ ├── SDAssociatedObject.m │ │ │ ├── SDAsyncBlockOperation.h │ │ │ ├── SDAsyncBlockOperation.m │ │ │ ├── SDDeviceHelper.h │ │ │ ├── SDDeviceHelper.m │ │ │ ├── SDDisplayLink.h │ │ │ ├── SDDisplayLink.m │ │ │ ├── SDFileAttributeHelper.h │ │ │ ├── SDFileAttributeHelper.m │ │ │ ├── SDImageAssetManager.h │ │ │ ├── SDImageAssetManager.m │ │ │ ├── SDImageCachesManagerOperation.h │ │ │ ├── SDImageCachesManagerOperation.m │ │ │ ├── SDImageHEICCoderInternal.h │ │ │ ├── SDImageIOAnimatedCoderInternal.h │ │ │ ├── SDInternalMacros.h │ │ │ ├── SDInternalMacros.m │ │ │ ├── SDWeakProxy.h │ │ │ ├── SDWeakProxy.m │ │ │ ├── SDmetamacros.h │ │ │ ├── UIColor+HexString.h │ │ │ └── UIColor+HexString.m │ └── WebImage │ │ └── SDWebImage.h ├── TYAutoCompleteTextField │ ├── LICENSE │ ├── README.md │ └── UILibraries │ │ └── AutoCompleteTextField │ │ └── AutoCompleteTextField │ │ └── Classes │ │ ├── AutoCompleteTextField.swift │ │ └── Extension │ │ ├── ColorExtension.swift │ │ ├── SelectorExtension.swift │ │ └── StringExtension.swift ├── TYPinchableImageView │ ├── LICENSE │ └── UILibraries │ │ └── PinchableImageView │ │ └── PinchableImageView │ │ └── PinchableImageView │ │ └── Classes │ │ └── PinchableImageView.swift └── Target Support Files │ ├── Pods-ComponentsTestApp │ ├── Pods-ComponentsTestApp-Info.plist │ ├── Pods-ComponentsTestApp-acknowledgements.markdown │ ├── Pods-ComponentsTestApp-acknowledgements.plist │ ├── Pods-ComponentsTestApp-dummy.m │ ├── Pods-ComponentsTestApp-frameworks-Debug-input-files.xcfilelist │ ├── Pods-ComponentsTestApp-frameworks-Debug-output-files.xcfilelist │ ├── Pods-ComponentsTestApp-frameworks-Release-input-files.xcfilelist │ ├── Pods-ComponentsTestApp-frameworks-Release-output-files.xcfilelist │ ├── Pods-ComponentsTestApp-frameworks.sh │ ├── Pods-ComponentsTestApp-umbrella.h │ ├── Pods-ComponentsTestApp.debug.xcconfig │ ├── Pods-ComponentsTestApp.modulemap │ └── Pods-ComponentsTestApp.release.xcconfig │ ├── Pods-ImageSlider │ ├── Pods-ImageSlider-Info.plist │ ├── Pods-ImageSlider-acknowledgements.markdown │ ├── Pods-ImageSlider-acknowledgements.plist │ ├── Pods-ImageSlider-dummy.m │ ├── Pods-ImageSlider-umbrella.h │ ├── Pods-ImageSlider.debug.xcconfig │ ├── Pods-ImageSlider.modulemap │ └── Pods-ImageSlider.release.xcconfig │ ├── SDWebImage │ ├── SDWebImage-Info.plist │ ├── SDWebImage-dummy.m │ ├── SDWebImage-prefix.pch │ ├── SDWebImage-umbrella.h │ ├── SDWebImage.debug.xcconfig │ ├── SDWebImage.modulemap │ ├── SDWebImage.release.xcconfig │ └── SDWebImage.xcconfig │ ├── TYAutoCompleteTextField │ ├── TYAutoCompleteTextField-Info.plist │ ├── TYAutoCompleteTextField-dummy.m │ ├── TYAutoCompleteTextField-prefix.pch │ ├── TYAutoCompleteTextField-umbrella.h │ ├── TYAutoCompleteTextField.debug.xcconfig │ ├── TYAutoCompleteTextField.modulemap │ └── TYAutoCompleteTextField.release.xcconfig │ └── TYPinchableImageView │ ├── TYPinchableImageView-Info.plist │ ├── TYPinchableImageView-dummy.m │ ├── TYPinchableImageView-prefix.pch │ ├── TYPinchableImageView-umbrella.h │ ├── TYPinchableImageView.debug.xcconfig │ ├── TYPinchableImageView.modulemap │ ├── TYPinchableImageView.release.xcconfig │ └── TYPinchableImageView.xcconfig ├── README.md ├── Resources └── statusBar-image.png ├── UILibraries ├── AutoCompleteTextField │ ├── AutoCompleteTextField.xcodeproj │ │ └── project.pbxproj │ ├── AutoCompleteTextField │ │ ├── AutoCompleteTextField.h │ │ ├── Classes │ │ │ ├── AutoCompleteTextField.swift │ │ │ └── Extension │ │ │ │ ├── ColorExtension.swift │ │ │ │ ├── SelectorExtension.swift │ │ │ │ └── StringExtension.swift │ │ └── Resource │ │ │ └── Info.plist │ ├── AutoCompleteTextFieldTests │ │ ├── AutoCompleteTextFieldTests.swift │ │ └── Info.plist │ ├── LICENSE │ └── README.md ├── ContinuousPagingView │ ├── ContinuousPagingView.xcodeproj │ │ └── project.pbxproj │ ├── ContinuousPagingView │ │ ├── Classes │ │ │ └── ContinuousPagingView.swift │ │ ├── ContinuousPagingView.h │ │ └── Info.plist │ ├── LICENSE │ └── README.md ├── ImageSlider │ ├── ImageSlider.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── ImageSlider │ │ ├── Classes │ │ │ ├── Core │ │ │ │ ├── ImageSliderCollectionViewCell │ │ │ │ │ ├── ImageSliderCollectionViewCell.swift │ │ │ │ │ └── ImageSliderCollectionViewCellPresenter.swift │ │ │ │ ├── ImageSliderPagerView │ │ │ │ │ └── ImageSliderPagerView.swift │ │ │ │ ├── ImageSliderView.swift │ │ │ │ └── ImageSliderViewPresenter.swift │ │ │ └── Extension │ │ │ │ ├── UIImageViewExtensions.swift │ │ │ │ └── UIViewExtensions.swift │ │ ├── ImageSlider.h │ │ └── Resource │ │ │ └── Info.plist │ ├── LICENSE │ └── README.md ├── LinkLabel │ ├── LICENSE │ ├── LinkLabel.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── LinkLabel │ │ ├── Classes │ │ │ └── LinkLabel.swift │ │ ├── LinkLabel.h │ │ └── Resource │ │ │ └── Info.plist │ └── README.md ├── PinchableImageView │ ├── PinchableImageView │ │ ├── PinchableImageView.xcodeproj │ │ │ └── project.pbxproj │ │ └── PinchableImageView │ │ │ ├── Classes │ │ │ └── PinchableImageView.swift │ │ │ ├── PinchableImageView.h │ │ │ └── Resource │ │ │ └── Info.plist │ └── README.md └── StatusBarView │ ├── LICENSE │ ├── README.md │ └── StatusBarView │ ├── StatusBarView.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── StatusBarView.xcscheme │ ├── StatusBarView │ ├── Classes │ │ └── Core │ │ │ ├── StatusBarItemView.swift │ │ │ ├── StatusBarItemView.xib │ │ │ ├── StatusBarView.swift │ │ │ └── StatusBarView.xib │ ├── Info.plist │ └── StatusBarView.h │ └── StatusBarViewTests │ ├── Info.plist │ └── StatusBarViewTests.swift ├── Utils └── PropertyWrapper │ ├── PropertyWrapper.xcodeproj │ └── project.pbxproj │ ├── PropertyWrapper │ ├── Classes │ │ ├── Capitalized.swift │ │ ├── DefaultCodable.swift │ │ ├── DefaultEmptyArray.swift │ │ ├── DefaultFalse.swift │ │ ├── DefaultTrue.swift │ │ ├── EnumDefaultValueSelectable.swift │ │ ├── Extension │ │ │ └── KeyedDecodingContainer.swift │ │ ├── StringOrInt.swift │ │ └── UserDefaults.swift │ ├── PropertyWrapper.h │ └── Resource │ │ └── Info.plist │ └── PropertyWrapperTests │ ├── Info.plist │ ├── PropertyWrapperTests.swift │ └── Responses │ ├── OrderResponse.swift │ ├── PaymentResponse.swift │ └── UserResponse.swift └── channel-components.xcworkspace ├── contents.xcworkspacedata └── xcshareddata └── IDEWorkspaceChecks.plist /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | .DS_Store 19 | 20 | # Swift Package Manager 21 | .build/ 22 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Emre Ergün on 13.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | @available(iOS 13.0, *) 24 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 25 | // Called when a new scene session is being created. 26 | // Use this method to select a configuration to create the new scene with. 27 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 28 | } 29 | 30 | @available(iOS 13.0, *) 31 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 32 | // Called when the user discards a scene session. 33 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 34 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 35 | } 36 | 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Assets.xcassets/testimage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iostes1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Assets.xcassets/testimage.imageset/iostes1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/ios-components/cc2863d2edeae0640356cbcaf8b4f7b68861d62a/ComponentsTestApp/ComponentsTestApp/Assets.xcassets/testimage.imageset/iostes1.jpg -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/HomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Emre Ergün on 14.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | final class HomeViewController: UIViewController { 12 | @IBOutlet private weak var componentsTableView: UITableView! 13 | 14 | private func componentItemSelected(at indexPath: IndexPath) { 15 | guard let componentItem = Component(rawValue: indexPath.row) else { return } 16 | navigationController?.pushViewController(componentItem.associatedDemoViewController, animated: true) 17 | } 18 | } 19 | 20 | extension HomeViewController: UITableViewDataSource, UITableViewDelegate { 21 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 22 | return Component.allCases.count 23 | } 24 | 25 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 26 | let cell = tableView.dequeueReusableCell(withIdentifier: "ComponentTableViewCell", for: indexPath) 27 | cell.textLabel?.text = Component(rawValue: indexPath.row)?.title 28 | return cell 29 | } 30 | 31 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 32 | return 64.0 33 | } 34 | 35 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 36 | componentItemSelected(at: indexPath) 37 | } 38 | } 39 | 40 | extension HomeViewController { 41 | enum Component: Int, CaseIterable { 42 | case imageSlider 43 | case pinchableImageView 44 | case autoCompleteTextField 45 | case statusBarView 46 | 47 | var title: String { 48 | switch self { 49 | case .imageSlider: return "ImageSlider" 50 | case .pinchableImageView: return "PinchableImageView" 51 | case .autoCompleteTextField: return "autoCompleteTextField" 52 | case .statusBarView: return "StatusBarView" 53 | } 54 | } 55 | 56 | var associatedDemoViewController: UIViewController { 57 | let storyboard = UIStoryboard.init(name: "Main", bundle: nil) 58 | return storyboard.instantiateViewController(withIdentifier: self.title) 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/LibraryDemoViewControllers/AutoCompleteTextFieldViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoCompleteTextFieldViewController.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import TYAutoCompleteTextField 11 | 12 | final class AutoCompleteTextFieldViewController: UIViewController { 13 | @IBOutlet private weak var textField: AutoCompleteTextField! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | textField.placeholder = "Basic text field" 19 | textField.completionValues = ["trendyol.com"] 20 | textField.completionValues.append(contentsOf: AutoCompleteTextField.defaultDomains) 21 | textField.autoCompleteType = .email 22 | 23 | let gesture = UITapGestureRecognizer(target: self, action: #selector(endEditing)) 24 | view.addGestureRecognizer(gesture) 25 | view.isUserInteractionEnabled = true 26 | } 27 | 28 | @objc func endEditing(){ 29 | view.endEditing(true) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/LibraryDemoViewControllers/ImageSliderDemoViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSliderDemoViewController.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Emre Ergün on 14.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import ImageSlider 10 | import UIKit 11 | 12 | final class ImageSliderDemoViewController: UIViewController { 13 | 14 | let imageUrls = [ 15 | "https://cdn.dolap.com/product/org/canta/kol-cantasi/herry_20425452.jpg", 16 | "https://cdn.dolap.com/product/org/canta/kol-cantasi/herry_20425453.jpg", 17 | "https://cdn.dolap.com/product/org/canta/kol-cantasi/herry_123070377.jpg" 18 | ] 19 | 20 | @IBOutlet private weak var imageSliderView: ImageSliderView! 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | 25 | title = "Image Slider" 26 | 27 | prepareImageSlider() 28 | } 29 | 30 | private func prepareImageSlider() { 31 | let imageSliderPresenter = ImageSliderViewPresenter(imageUrls: imageUrls, 32 | loopingEnabled: true, 33 | view: imageSliderView) 34 | imageSliderView.presenter = imageSliderPresenter 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/LibraryDemoViewControllers/PinchableImageViewDemoViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PinchableImageViewDemoViewController.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Emre Ergün on 14.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import PinchableImageView 10 | import UIKit 11 | 12 | final class PinchableImageViewDemoViewController: UIViewController { 13 | @IBOutlet private weak var pinchableImageView: PinchableImageView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | title = "Pinchable ImageView" 18 | } 19 | 20 | @IBAction func minimumZoomScaleSliderChanged(_ sender: UISlider) { 21 | let minScale = CGFloat(sender.value/5) 22 | pinchableImageView.minZoomScale = minScale 23 | } 24 | 25 | @IBAction func maximumZoomScaleSliderChanged(_ sender: UISlider) { 26 | let maxScale = CGFloat(sender.value) 27 | pinchableImageView.maxZoomScale = maxScale 28 | } 29 | 30 | @IBAction func resetAnimationDurationSliderChanged(_ sender: UISlider) { 31 | let duration = Double(sender.value/5) 32 | pinchableImageView.resetAnimationDuration = duration 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/LibraryDemoViewControllers/StatusBarDemoViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarDemoViewController.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Ersen Tekin on 4.05.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import StatusBarView 10 | import UIKit 11 | 12 | final class StatusBarDemoViewController: UIViewController { 13 | 14 | @IBOutlet private weak var statusBarView: StatusBarView! 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | title = "StatusBarView" 19 | 20 | let titles = [ 21 | "Received", 22 | "Preparing", 23 | "Shipped", 24 | "Completed" 25 | ] 26 | statusBarView.configure(titles: titles, activeIndex: 1, activeColor: .systemGreen, passiveColor: .lightGray) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ComponentsTestApp/ComponentsTestApp/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ComponentsTestApp 4 | // 5 | // Created by Emre Ergün on 13.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @available(iOS 13.0, *) 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | guard let _ = (scene as? UIWindowScene) else { return } 22 | } 23 | 24 | func sceneDidDisconnect(_ scene: UIScene) { 25 | // Called as the scene is being released by the system. 26 | // This occurs shortly after the scene enters the background, or when its session is discarded. 27 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 28 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 29 | } 30 | 31 | func sceneDidBecomeActive(_ scene: UIScene) { 32 | // Called when the scene has moved from an inactive state to an active state. 33 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 34 | } 35 | 36 | func sceneWillResignActive(_ scene: UIScene) { 37 | // Called when the scene will move from an active state to an inactive state. 38 | // This may occur due to temporary interruptions (ex. an incoming phone call). 39 | } 40 | 41 | func sceneWillEnterForeground(_ scene: UIScene) { 42 | // Called as the scene transitions from the background to the foreground. 43 | // Use this method to undo the changes made on entering the background. 44 | } 45 | 46 | func sceneDidEnterBackground(_ scene: UIScene) { 47 | // Called as the scene transitions from the foreground to the background. 48 | // Use this method to save data, release shared resources, and store enough scene-specific state information 49 | // to restore the scene back to its current state. 50 | } 51 | 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "SDWebImage", 6 | "repositoryURL": "https://github.com/SDWebImage/SDWebImage", 7 | "state": { 8 | "branch": null, 9 | "revision": "7a21432a370a34925046244462281bd36ebab73d", 10 | "version": "5.9.1" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "ios-components", 7 | platforms: [.iOS(.v11)], 8 | products: [ 9 | .library(name: "TYStatusBarView", targets: ["TYStatusBarView"]), 10 | .library(name: "TYPropertyWrapper", targets: ["TYPropertyWrapper"]), 11 | .library(name: "TYLinkLabel", targets: ["TYLinkLabel"]), 12 | .library(name: "TYAutoCompleteTextField", targets: ["TYAutoCompleteTextField"]), 13 | .library(name: "TYContinuousPagingView", targets: ["TYContinuousPagingView"]), 14 | .library(name: "TYPinchableImageView", targets: ["TYPinchableImageView"]), 15 | .library(name: "TYImageSlider", targets: ["TYImageSlider", "TYPinchableImageView"]) 16 | ], 17 | dependencies: [ 18 | .package(url: "https://github.com/SDWebImage/SDWebImage", .upToNextMajor(from: "5.0.0")) 19 | ], 20 | targets: [ 21 | .target( 22 | name: "TYStatusBarView", 23 | path: "UILibraries/StatusBarView/StatusBarView/StatusBarView/Classes" 24 | ), 25 | .target( 26 | name: "TYLinkLabel", 27 | path: "UILibraries/LinkLabel/LinkLabel/Classes" 28 | ), 29 | .target( 30 | name: "TYAutoCompleteTextField", 31 | path: "UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes" 32 | ), 33 | .target( 34 | name: "TYPropertyWrapper", 35 | path: "Utils/PropertyWrapper/PropertyWrapper/Classes" 36 | ), 37 | .target( 38 | name: "TYContinuousPagingView", 39 | path: "UILibraries/ContinuousPagingView/ContinuousPagingView/Classes" 40 | ), 41 | .target( 42 | name: "TYImageSlider", 43 | dependencies: [ 44 | "TYPinchableImageView", 45 | .product(name: "SDWebImage", package: "SDWebImage") 46 | ], 47 | path: "UILibraries/ImageSlider/ImageSlider/Classes" 48 | ), 49 | .target( 50 | name: "TYPinchableImageView", 51 | path: "UILibraries/PinchableImageView/PinchableImageView/PinchableImageView/Classes" 52 | ) 53 | ] 54 | ) 55 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | 3 | use_frameworks! 4 | 5 | workspace 'channel-components' 6 | 7 | target 'ComponentsTestApp' do 8 | project 'ComponentsTestApp/ComponentsTestApp.xcodeproj ' 9 | inherit! :search_paths 10 | pod 'SDWebImage' 11 | pod 'TYPinchableImageView' 12 | pod 'TYAutoCompleteTextField' 13 | end 14 | 15 | target 'ImageSlider' do 16 | project 'UILibraries/ImageSlider/ImageSlider.xcodeproj' 17 | inherit! :search_paths 18 | pod 'SDWebImage' 19 | pod 'TYPinchableImageView' 20 | end 21 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (5.4.2): 3 | - SDWebImage/Core (= 5.4.2) 4 | - SDWebImage/Core (5.4.2) 5 | - TYAutoCompleteTextField (0.0.1) 6 | - TYPinchableImageView (0.0.1) 7 | 8 | DEPENDENCIES: 9 | - SDWebImage 10 | - TYAutoCompleteTextField 11 | - TYPinchableImageView 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - SDWebImage 16 | - TYAutoCompleteTextField 17 | - TYPinchableImageView 18 | 19 | SPEC CHECKSUMS: 20 | SDWebImage: 4ca2dc4eefae4224bea8f504251cda485a363745 21 | TYAutoCompleteTextField: d89b388572095e5dac8c5fa318b48b35af03c561 22 | TYPinchableImageView: f525f464ba9921337e0fa991ed23e63e77823bd0 23 | 24 | PODFILE CHECKSUM: 172995e306618f2b2082e5990061a0f181dd4182 25 | 26 | COCOAPODS: 1.9.1 27 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/StatusBarView.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StatusBarView", 3 | "platforms": { 4 | "ios": "11.0" 5 | }, 6 | "summary": "StatusBarView for iOS", 7 | "version": "0.0.1", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": "DSM Group Trendyol", 13 | "homepage": "https://www.trendyol.com", 14 | "requires_arc": true, 15 | "source": { 16 | "git": "https://github.com/Trendyol/ios-components.git", 17 | "tag": "StatusBarView-0.0.1" 18 | }, 19 | "source_files": "UILibraries/StatusBarView/StatusBarView/Classes/**/*.swift", 20 | "swift_versions": [ 21 | "4.2", 22 | "5.0", 23 | "5.1" 24 | ], 25 | "swift_version": "5.1" 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SDWebImage (5.4.2): 3 | - SDWebImage/Core (= 5.4.2) 4 | - SDWebImage/Core (5.4.2) 5 | - TYAutoCompleteTextField (0.0.1) 6 | - TYPinchableImageView (0.0.1) 7 | 8 | DEPENDENCIES: 9 | - SDWebImage 10 | - TYAutoCompleteTextField 11 | - TYPinchableImageView 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - SDWebImage 16 | - TYAutoCompleteTextField 17 | - TYPinchableImageView 18 | 19 | SPEC CHECKSUMS: 20 | SDWebImage: 4ca2dc4eefae4224bea8f504251cda485a363745 21 | TYAutoCompleteTextField: d89b388572095e5dac8c5fa318b48b35af03c561 22 | TYPinchableImageView: f525f464ba9921337e0fa991ed23e63e77823bd0 23 | 24 | PODFILE CHECKSUM: 172995e306618f2b2082e5990061a0f181dd4182 25 | 26 | COCOAPODS: 1.9.1 27 | -------------------------------------------------------------------------------- /Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | /** 14 | You can use switch case like normal enum. It's also recommended to add a default case. You should not assume anything about the raw value. 15 | For custom coder plugin, it can also extern the enum for supported format. See `SDImageCoder` for more detailed information. 16 | */ 17 | typedef NSInteger SDImageFormat NS_TYPED_EXTENSIBLE_ENUM; 18 | static const SDImageFormat SDImageFormatUndefined = -1; 19 | static const SDImageFormat SDImageFormatJPEG = 0; 20 | static const SDImageFormat SDImageFormatPNG = 1; 21 | static const SDImageFormat SDImageFormatGIF = 2; 22 | static const SDImageFormat SDImageFormatTIFF = 3; 23 | static const SDImageFormat SDImageFormatWebP = 4; 24 | static const SDImageFormat SDImageFormatHEIC = 5; 25 | static const SDImageFormat SDImageFormatHEIF = 6; 26 | 27 | /** 28 | NSData category about the image content type and UTI. 29 | */ 30 | @interface NSData (ImageContentType) 31 | 32 | /** 33 | * Return image format 34 | * 35 | * @param data the input image data 36 | * 37 | * @return the image format as `SDImageFormat` (enum) 38 | */ 39 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 40 | 41 | /** 42 | * Convert SDImageFormat to UTType 43 | * 44 | * @param format Format as SDImageFormat 45 | * @return The UTType as CFStringRef 46 | */ 47 | + (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED NS_SWIFT_NAME(sd_UTType(from:)); 48 | 49 | /** 50 | * Convert UTTyppe to SDImageFormat 51 | * 52 | * @param uttype The UTType as CFStringRef 53 | * @return The Format as SDImageFormat 54 | */ 55 | + (SDImageFormat)sd_imageFormatFromUTType:(nonnull CFStringRef)uttype; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | /** 14 | A subclass of `NSBitmapImageRep` to fix that GIF duration issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 15 | This also fix the GIF loop count issue, which will use the Netscape standard (See http://www6.uniovi.es/gifanim/gifabout.htm) to only place once when the `kCGImagePropertyGIFLoopCount` is nil. This is what modern browser's behavior. 16 | Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 17 | This also support APNG format using `SDImageAPNGCoder`. Which provide full alpha-channel support and the correct duration match the `kCGImagePropertyAPNGUnclampedDelayTime`. 18 | */ 19 | @interface SDAnimatedImageRep : NSBitmapImageRep 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports APNG encoding/decoding 14 | */ 15 | @interface SDImageAPNGCoder : SDImageIOAnimatedCoder 16 | 17 | @property (nonatomic, class, readonly, nonnull) SDImageAPNGCoder *sharedCoder; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageAPNGCoder.h" 10 | #if SD_MAC 11 | #import 12 | #else 13 | #import 14 | #endif 15 | 16 | // iOS 8 Image/IO framework binary does not contains these APNG contants, so we define them. Thanks Apple :) 17 | // We can not use runtime @available check for this issue, because it's a global symbol and should be loaded during launch time by dyld. So hack if the min deployment target version < iOS 9.0, whatever it running on iOS 9+ or not. 18 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0) 19 | const CFStringRef kCGImagePropertyAPNGLoopCount = (__bridge CFStringRef)@"LoopCount"; 20 | const CFStringRef kCGImagePropertyAPNGDelayTime = (__bridge CFStringRef)@"DelayTime"; 21 | const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef)@"UnclampedDelayTime"; 22 | #endif 23 | 24 | @implementation SDImageAPNGCoder 25 | 26 | + (instancetype)sharedCoder { 27 | static SDImageAPNGCoder *coder; 28 | static dispatch_once_t onceToken; 29 | dispatch_once(&onceToken, ^{ 30 | coder = [[SDImageAPNGCoder alloc] init]; 31 | }); 32 | return coder; 33 | } 34 | 35 | #pragma mark - Subclass Override 36 | 37 | + (SDImageFormat)imageFormat { 38 | return SDImageFormatPNG; 39 | } 40 | 41 | + (NSString *)imageUTType { 42 | return (__bridge NSString *)kUTTypePNG; 43 | } 44 | 45 | + (NSString *)dictionaryProperty { 46 | return (__bridge NSString *)kCGImagePropertyPNGDictionary; 47 | } 48 | 49 | + (NSString *)unclampedDelayTimeProperty { 50 | return (__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime; 51 | } 52 | 53 | + (NSString *)delayTimeProperty { 54 | return (__bridge NSString *)kCGImagePropertyAPNGDelayTime; 55 | } 56 | 57 | + (NSString *)loopCountProperty { 58 | return (__bridge NSString *)kCGImagePropertyAPNGLoopCount; 59 | } 60 | 61 | + (NSUInteger)defaultLoopCount { 62 | return 0; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | #import "SDMemoryCache.h" 11 | #import "SDDiskCache.h" 12 | 13 | static SDImageCacheConfig *_defaultCacheConfig; 14 | static const NSInteger kDefaultCacheMaxDiskAge = 60 * 60 * 24 * 7; // 1 week 15 | 16 | @implementation SDImageCacheConfig 17 | 18 | + (SDImageCacheConfig *)defaultCacheConfig { 19 | static dispatch_once_t onceToken; 20 | dispatch_once(&onceToken, ^{ 21 | _defaultCacheConfig = [SDImageCacheConfig new]; 22 | }); 23 | return _defaultCacheConfig; 24 | } 25 | 26 | - (instancetype)init { 27 | if (self = [super init]) { 28 | _shouldDisableiCloud = YES; 29 | _shouldCacheImagesInMemory = YES; 30 | _shouldUseWeakMemoryCache = YES; 31 | _shouldRemoveExpiredDataWhenEnterBackground = YES; 32 | _diskCacheReadingOptions = 0; 33 | _diskCacheWritingOptions = NSDataWritingAtomic; 34 | _maxDiskAge = kDefaultCacheMaxDiskAge; 35 | _maxDiskSize = 0; 36 | _diskCacheExpireType = SDImageCacheConfigExpireTypeModificationDate; 37 | _memoryCacheClass = [SDMemoryCache class]; 38 | _diskCacheClass = [SDDiskCache class]; 39 | } 40 | return self; 41 | } 42 | 43 | - (id)copyWithZone:(NSZone *)zone { 44 | SDImageCacheConfig *config = [[[self class] allocWithZone:zone] init]; 45 | config.shouldDisableiCloud = self.shouldDisableiCloud; 46 | config.shouldCacheImagesInMemory = self.shouldCacheImagesInMemory; 47 | config.shouldUseWeakMemoryCache = self.shouldUseWeakMemoryCache; 48 | config.shouldRemoveExpiredDataWhenEnterBackground = self.shouldRemoveExpiredDataWhenEnterBackground; 49 | config.diskCacheReadingOptions = self.diskCacheReadingOptions; 50 | config.diskCacheWritingOptions = self.diskCacheWritingOptions; 51 | config.maxDiskAge = self.maxDiskAge; 52 | config.maxDiskSize = self.maxDiskSize; 53 | config.maxMemoryCost = self.maxMemoryCost; 54 | config.maxMemoryCount = self.maxMemoryCount; 55 | config.diskCacheExpireType = self.diskCacheExpireType; 56 | config.fileManager = self.fileManager; // NSFileManager does not conform to NSCopying, just pass the reference 57 | config.memoryCacheClass = self.memoryCacheClass; 58 | config.diskCacheClass = self.diskCacheClass; 59 | 60 | return config; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCoder.h" 10 | 11 | SDImageCoderOption const SDImageCoderDecodeFirstFrameOnly = @"decodeFirstFrameOnly"; 12 | SDImageCoderOption const SDImageCoderDecodeScaleFactor = @"decodeScaleFactor"; 13 | 14 | SDImageCoderOption const SDImageCoderEncodeFirstFrameOnly = @"encodeFirstFrameOnly"; 15 | SDImageCoderOption const SDImageCoderEncodeCompressionQuality = @"encodeCompressionQuality"; 16 | 17 | SDImageCoderOption const SDImageCoderWebImageContext = @"webImageContext"; 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageCoder.h" 11 | 12 | /** 13 | Global object holding the array of coders, so that we avoid passing them from object to object. 14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority. 15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. 16 | That way, users can add their custom coders while preserving our existing prebuilt ones 17 | 18 | Note: the `coders` getter will return the coders in their reversed order 19 | Example: 20 | - by default we internally set coders = `IOCoder`, `GIFCoder`, `APNGCoder` 21 | - calling `coders` will return `@[IOCoder, GIFCoder, APNGCoder]` 22 | - call `[addCoder:[MyCrazyCoder new]]` 23 | - calling `coders` now returns `@[IOCoder, GIFCoder, APNGCoder, MyCrazyCoder]` 24 | 25 | Coders 26 | ------ 27 | A coder must conform to the `SDImageCoder` protocol or even to `SDProgressiveImageCoder` if it supports progressive decoding 28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` 29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES. 30 | That means that coder can decode that data / encode to that format 31 | */ 32 | @interface SDImageCodersManager : NSObject 33 | 34 | /** 35 | Returns the global shared coders manager instance. 36 | */ 37 | @property (nonatomic, class, readonly, nonnull) SDImageCodersManager *sharedManager; 38 | 39 | /** 40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority 41 | */ 42 | @property (nonatomic, copy, nullable) NSArray> *coders; 43 | 44 | /** 45 | Add a new coder to the end of coders array. Which has the highest priority. 46 | 47 | @param coder coder 48 | */ 49 | - (void)addCoder:(nonnull id)coder; 50 | 51 | /** 52 | Remove a coder in the coders array. 53 | 54 | @param coder coder 55 | */ 56 | - (void)removeCoder:(nonnull id)coder; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /** 13 | This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`. 14 | @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`. 15 | */ 16 | @interface SDImageFrame : NSObject 17 | 18 | /** 19 | The image of current frame. You should not set an animated image. 20 | */ 21 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 22 | /** 23 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 24 | */ 25 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 26 | 27 | /** 28 | Create a frame instance with specify image and duration 29 | 30 | @param image current frame's image 31 | @param duration current frame's duration 32 | @return frame instance 33 | */ 34 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageFrame.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageFrame.h" 10 | 11 | @interface SDImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDImageFrame *frame = [[SDImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports animated GIF encoding/decoding 14 | @note `SDImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDImageGIFCoder` for fully animated GIFs. For `UIImageView`, it will produce animated `UIImage`(`NSImage` on macOS) for rendering. For `SDAnimatedImageView`, it will use `SDAnimatedImage` for rendering. 16 | @note The recommended approach for animated GIFs is using `SDAnimatedImage` with `SDAnimatedImageView`. It's more performant than `UIImageView` for GIF displaying(especially on memory usage) 17 | */ 18 | @interface SDImageGIFCoder : SDImageIOAnimatedCoder 19 | 20 | @property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageGIFCoder.h" 10 | #if SD_MAC 11 | #import 12 | #else 13 | #import 14 | #endif 15 | 16 | @implementation SDImageGIFCoder 17 | 18 | + (instancetype)sharedCoder { 19 | static SDImageGIFCoder *coder; 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | coder = [[SDImageGIFCoder alloc] init]; 23 | }); 24 | return coder; 25 | } 26 | 27 | #pragma mark - Subclass Override 28 | 29 | + (SDImageFormat)imageFormat { 30 | return SDImageFormatGIF; 31 | } 32 | 33 | + (NSString *)imageUTType { 34 | return (__bridge NSString *)kUTTypeGIF; 35 | } 36 | 37 | + (NSString *)dictionaryProperty { 38 | return (__bridge NSString *)kCGImagePropertyGIFDictionary; 39 | } 40 | 41 | + (NSString *)unclampedDelayTimeProperty { 42 | return (__bridge NSString *)kCGImagePropertyGIFUnclampedDelayTime; 43 | } 44 | 45 | + (NSString *)delayTimeProperty { 46 | return (__bridge NSString *)kCGImagePropertyGIFDelayTime; 47 | } 48 | 49 | + (NSString *)loopCountProperty { 50 | return (__bridge NSString *)kCGImagePropertyGIFLoopCount; 51 | } 52 | 53 | + (NSUInteger)defaultLoopCount { 54 | return 1; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import 11 | 12 | /** 13 | These following graphics context method are provided to easily write cross-platform(AppKit/UIKit) code. 14 | For UIKit, these methods just call the same method in `UIGraphics.h`. See the documentation for usage. 15 | For AppKit, these methods use `NSGraphicsContext` to create image context and match the behavior like UIKit. 16 | */ 17 | 18 | /// Returns the current graphics context. 19 | FOUNDATION_EXPORT CGContextRef __nullable SDGraphicsGetCurrentContext(void) CF_RETURNS_NOT_RETAINED; 20 | /// Creates a bitmap-based graphics context and makes it the current context. 21 | FOUNDATION_EXPORT void SDGraphicsBeginImageContext(CGSize size); 22 | /// Creates a bitmap-based graphics context with the specified options. 23 | FOUNDATION_EXPORT void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale); 24 | /// Removes the current bitmap-based graphics context from the top of the stack. 25 | FOUNDATION_EXPORT void SDGraphicsEndImageContext(void); 26 | /// Returns an image based on the contents of the current bitmap-based graphics context. 27 | FOUNDATION_EXPORT UIImage * __nullable SDGraphicsGetImageFromCurrentImageContext(void); 28 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | This coder is used for HEIC (HEIF with HEVC container codec) image format. 14 | Image/IO provide the static HEIC (.heic) support in iOS 11/macOS 10.13/tvOS 11/watchOS 4+. 15 | Image/IO provide the animated HEIC (.heics) support in iOS 13/macOS 10.15/tvOS 13/watchOS 6+. 16 | See https://nokiatech.github.io/heif/technical.html for the standard. 17 | @note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this. 18 | @note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder 19 | */ 20 | @interface SDImageHEICCoder : SDImageIOAnimatedCoder 21 | 22 | @property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import 11 | #import "SDImageCoder.h" 12 | 13 | /** 14 | This is the abstract class for all animated coder, which use the Image/IO API. You can not use this directly as real coders. A exception will be raised if you use this class. 15 | All of the properties need the subclass to implment and works as expceted. 16 | For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio 17 | */ 18 | @interface SDImageIOAnimatedCoder : NSObject 19 | 20 | #pragma mark - Subclass Override 21 | /** 22 | The supported animated image format. Such as `SDImageFormatGIF`. 23 | @note Subclass override. 24 | */ 25 | @property (class, readonly) SDImageFormat imageFormat; 26 | /** 27 | The supported image format UTI Type. Such as `kUTTypeGIF`. 28 | This can be used for cases when we can not detect `SDImageFormat. Such as progressive decoding's hint format `kCGImageSourceTypeIdentifierHint`. 29 | @note Subclass override. 30 | */ 31 | @property (class, readonly, nonnull) NSString *imageUTType; 32 | /** 33 | The image container property key used in Image/IO API. Such as `kCGImagePropertyGIFDictionary`. 34 | @note Subclass override. 35 | */ 36 | @property (class, readonly, nonnull) NSString *dictionaryProperty; 37 | /** 38 | The image unclamped deply time property key used in Image/IO API. Such as `kCGImagePropertyGIFUnclampedDelayTime` 39 | @note Subclass override. 40 | */ 41 | @property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty; 42 | /** 43 | The image delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFDelayTime`. 44 | @note Subclass override. 45 | */ 46 | @property (class, readonly, nonnull) NSString *delayTimeProperty; 47 | /** 48 | The image loop count property key used in Image/IO API. Such as `kCGImagePropertyGIFLoopCount`. 49 | @note Subclass override. 50 | */ 51 | @property (class, readonly, nonnull) NSString *loopCountProperty; 52 | /** 53 | The default loop count when there are no any loop count information inside image container metadata. 54 | For example, for GIF format, the standard use 1 (play once). For APNG format, the standard use 0 (infinity loop). 55 | @note Subclass override. 56 | */ 57 | @property (class, readonly) NSUInteger defaultLoopCount; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `SDAnimatedImageView` to keep both CPU and memory balanced. 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDImageIOCoder : NSObject 27 | 28 | @property (nonatomic, class, readonly, nonnull) SDImageIOCoder *sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageLoader.h" 10 | 11 | /** 12 | A loaders manager to manage multiple loaders 13 | */ 14 | @interface SDImageLoadersManager : NSObject 15 | 16 | /** 17 | Returns the global shared loaders manager instance. By default we will set [`SDWebImageDownloader.sharedDownloader`] into the loaders array. 18 | */ 19 | @property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager; 20 | 21 | /** 22 | All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority 23 | */ 24 | @property (nonatomic, copy, nullable) NSArray>* loaders; 25 | 26 | /** 27 | Add a new image loader to the end of loaders array. Which has the highest priority. 28 | 29 | @param loader loader 30 | */ 31 | - (void)addLoader:(nonnull id)loader; 32 | 33 | /** 34 | Remove a image loader in the loaders array. 35 | 36 | @param loader loader 37 | */ 38 | - (void)removeLoader:(nonnull id)loader; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSString * _Nullable(^SDWebImageCacheKeyFilterBlock)(NSURL * _Nonnull url); 13 | 14 | /** 15 | This is the protocol for cache key filter. 16 | We can use a block to specify the cache key filter. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheKeyFilter 19 | 20 | - (nullable NSString *)cacheKeyForURL:(nonnull NSURL *)url; 21 | 22 | @end 23 | 24 | /** 25 | A cache key filter class with block. 26 | */ 27 | @interface SDWebImageCacheKeyFilter : NSObject 28 | 29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 30 | + (nonnull instancetype)cacheKeyFilterWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCacheKeyFilter.h" 10 | 11 | @interface SDWebImageCacheKeyFilter () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheKeyFilterBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheKeyFilter 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheKeyFilterBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheKeyFilterWithBlock:(SDWebImageCacheKeyFilterBlock)block { 28 | SDWebImageCacheKeyFilter *cacheKeyFilter = [[SDWebImageCacheKeyFilter alloc] initWithBlock:block]; 29 | return cacheKeyFilter; 30 | } 31 | 32 | - (NSString *)cacheKeyForURL:(NSURL *)url { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(url); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSData * _Nullable(^SDWebImageCacheSerializerBlock)(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL); 13 | 14 | /** 15 | This is the protocol for cache serializer. 16 | We can use a block to specify the cache serializer. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheSerializer 19 | 20 | /// Provide the image data associated to the image and store to disk cache 21 | /// @param image The loaded image 22 | /// @param data The original loaded image data 23 | /// @param imageURL The image URL 24 | - (nullable NSData *)cacheDataWithImage:(nonnull UIImage *)image originalData:(nullable NSData *)data imageURL:(nullable NSURL *)imageURL; 25 | 26 | @end 27 | 28 | /** 29 | A cache serializer class with block. 30 | */ 31 | @interface SDWebImageCacheSerializer : NSObject 32 | 33 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 34 | + (nonnull instancetype)cacheSerializerWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCacheSerializer.h" 10 | 11 | @interface SDWebImageCacheSerializer () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheSerializerBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheSerializer 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheSerializerBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheSerializerWithBlock:(SDWebImageCacheSerializerBlock)block { 28 | SDWebImageCacheSerializer *cacheSerializer = [[SDWebImageCacheSerializer alloc] initWithBlock:block]; 29 | return cacheSerializer; 30 | } 31 | 32 | - (NSData *)cacheDataWithImage:(UIImage *)image originalData:(NSData *)data imageURL:(nullable NSURL *)imageURL { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(image, data, imageURL); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 17 | // To determine if we are running on macOS, use TARGET_OS_OSX in Xcode 8 18 | #if TARGET_OS_OSX 19 | #define SD_MAC 1 20 | #else 21 | #define SD_MAC 0 22 | #endif 23 | 24 | // iOS and tvOS are very similar, UIKit exists on both platforms 25 | // Note: watchOS also has UIKit, but it's very limited 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | #define SD_UIKIT 1 28 | #else 29 | #define SD_UIKIT 0 30 | #endif 31 | 32 | #if TARGET_OS_IOS 33 | #define SD_IOS 1 34 | #else 35 | #define SD_IOS 0 36 | #endif 37 | 38 | #if TARGET_OS_TV 39 | #define SD_TV 1 40 | #else 41 | #define SD_TV 0 42 | #endif 43 | 44 | #if TARGET_OS_WATCH 45 | #define SD_WATCH 1 46 | #else 47 | #define SD_WATCH 0 48 | #endif 49 | 50 | 51 | #if SD_MAC 52 | #import 53 | #ifndef UIImage 54 | #define UIImage NSImage 55 | #endif 56 | #ifndef UIImageView 57 | #define UIImageView NSImageView 58 | #endif 59 | #ifndef UIView 60 | #define UIView NSView 61 | #endif 62 | #ifndef UIColor 63 | #define UIColor NSColor 64 | #endif 65 | #else 66 | #if SD_UIKIT 67 | #import 68 | #endif 69 | #if SD_WATCH 70 | #import 71 | #ifndef UIView 72 | #define UIView WKInterfaceObject 73 | #endif 74 | #ifndef UIImageView 75 | #define UIImageView WKInterfaceImage 76 | #endif 77 | #endif 78 | #endif 79 | 80 | #ifndef NS_ENUM 81 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 82 | #endif 83 | 84 | #ifndef NS_OPTIONS 85 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 86 | #endif 87 | 88 | #ifndef dispatch_main_async_safe 89 | #define dispatch_main_async_safe(block)\ 90 | if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\ 91 | block();\ 92 | } else {\ 93 | dispatch_async(dispatch_get_main_queue(), block);\ 94 | } 95 | #endif 96 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | #if !OS_OBJECT_USE_OBJC 16 | #error SDWebImage need ARC for dispatch object 17 | #endif 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageDownloaderConfig.h" 10 | 11 | static SDWebImageDownloaderConfig * _defaultDownloaderConfig; 12 | 13 | @implementation SDWebImageDownloaderConfig 14 | 15 | + (SDWebImageDownloaderConfig *)defaultDownloaderConfig { 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | _defaultDownloaderConfig = [SDWebImageDownloaderConfig new]; 19 | }); 20 | return _defaultDownloaderConfig; 21 | } 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | _maxConcurrentDownloads = 6; 27 | _downloadTimeout = 15.0; 28 | _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; 29 | } 30 | return self; 31 | } 32 | 33 | - (id)copyWithZone:(NSZone *)zone { 34 | SDWebImageDownloaderConfig *config = [[[self class] allocWithZone:zone] init]; 35 | config.maxConcurrentDownloads = self.maxConcurrentDownloads; 36 | config.downloadTimeout = self.downloadTimeout; 37 | config.minimumProgressInterval = self.minimumProgressInterval; 38 | config.sessionConfiguration = [self.sessionConfiguration copyWithZone:zone]; 39 | config.operationClass = self.operationClass; 40 | config.executionOrder = self.executionOrder; 41 | config.urlCredential = self.urlCredential; 42 | config.username = self.username; 43 | config.password = self.password; 44 | 45 | return config; 46 | } 47 | 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSData * _Nullable (^SDWebImageDownloaderDecryptorBlock)(NSData * _Nonnull data, NSURLResponse * _Nullable response); 13 | 14 | /** 15 | This is the protocol for downloader decryptor. Which decrypt the original encrypted data before decoding. Note progressive decoding is not compatible for decryptor. 16 | We can use a block to specify the downloader decryptor. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderDecryptor 19 | 20 | /// Decrypt the original download data and return a new data. You can use this to decrypt the data using your perfereed algorithm. 21 | /// @param data The original download data 22 | /// @param response The URL response for data. If you modifiy the original URL response via response modifier, the modified version will be here. This arg is nullable. 23 | /// @note If nil is returned, the image download will be marked as failed with error `SDWebImageErrorBadImageData` 24 | - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data response:(nullable NSURLResponse *)response; 25 | 26 | @end 27 | 28 | /** 29 | A downloader response modifier class with block. 30 | */ 31 | @interface SDWebImageDownloaderDecryptor : NSObject 32 | 33 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderDecryptorBlock)block; 34 | + (nonnull instancetype)decryptorWithBlock:(nonnull SDWebImageDownloaderDecryptorBlock)block; 35 | 36 | @end 37 | 38 | /// Convenience way to create decryptor for common data encryption. 39 | @interface SDWebImageDownloaderDecryptor (Conveniences) 40 | 41 | /// Base64 Encoded image data decryptor 42 | @property (class, readonly, nonnull) SDWebImageDownloaderDecryptor *base64Decryptor; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageDownloaderDecryptor.h" 10 | 11 | @interface SDWebImageDownloaderDecryptor () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderDecryptorBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageDownloaderDecryptor 18 | 19 | - (instancetype)initWithBlock:(SDWebImageDownloaderDecryptorBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)decryptorWithBlock:(SDWebImageDownloaderDecryptorBlock)block { 28 | SDWebImageDownloaderDecryptor *decryptor = [[SDWebImageDownloaderDecryptor alloc] initWithBlock:block]; 29 | return decryptor; 30 | } 31 | 32 | - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data response:(nullable NSURLResponse *)response { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(data, response); 37 | } 38 | 39 | @end 40 | 41 | @implementation SDWebImageDownloaderDecryptor (Conveniences) 42 | 43 | + (SDWebImageDownloaderDecryptor *)base64Decryptor { 44 | static SDWebImageDownloaderDecryptor *decryptor; 45 | static dispatch_once_t onceToken; 46 | dispatch_once(&onceToken, ^{ 47 | decryptor = [SDWebImageDownloaderDecryptor decryptorWithBlock:^NSData * _Nullable(NSData * _Nonnull data, NSURLResponse * _Nullable response) { 48 | NSData *modifiedData = [[NSData alloc] initWithBase64EncodedData:data options:NSDataBase64DecodingIgnoreUnknownCharacters]; 49 | return modifiedData; 50 | }]; 51 | }); 52 | return decryptor; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSURLRequest * _Nullable (^SDWebImageDownloaderRequestModifierBlock)(NSURLRequest * _Nonnull request); 13 | 14 | /** 15 | This is the protocol for downloader request modifier. 16 | We can use a block to specify the downloader request modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderRequestModifier 19 | 20 | /// Modify the original URL request and return a new one instead. You can modify the HTTP header, cachePolicy, etc for this URL. 21 | /// @param request The original URL request for image loading 22 | /// @note If return nil, the URL request will be cancelled. 23 | - (nullable NSURLRequest *)modifiedRequestWithRequest:(nonnull NSURLRequest *)request; 24 | 25 | @end 26 | 27 | /** 28 | A downloader request modifier class with block. 29 | */ 30 | @interface SDWebImageDownloaderRequestModifier : NSObject 31 | 32 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 33 | + (nonnull instancetype)requestModifierWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageDownloaderRequestModifier.h" 10 | 11 | @interface SDWebImageDownloaderRequestModifier () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderRequestModifierBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageDownloaderRequestModifier 18 | 19 | - (instancetype)initWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)requestModifierWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 28 | SDWebImageDownloaderRequestModifier *requestModifier = [[SDWebImageDownloaderRequestModifier alloc] initWithBlock:block]; 29 | return requestModifier; 30 | } 31 | 32 | - (NSURLRequest *)modifiedRequestWithRequest:(NSURLRequest *)request { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(request); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSURLResponse * _Nullable (^SDWebImageDownloaderResponseModifierBlock)(NSURLResponse * _Nonnull response); 13 | 14 | /** 15 | This is the protocol for downloader response modifier. 16 | We can use a block to specify the downloader response modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderResponseModifier 19 | 20 | /// Modify the original URL response and return a new response. You can use this to check MIME-Type, mock server response, etc. 21 | /// @param response The original URL response, note for HTTP request it's actually a `NSHTTPURLResponse` instance 22 | /// @note If nil is returned, the image download will marked as cancelled with error `SDWebImageErrorInvalidDownloadResponse` 23 | - (nullable NSURLResponse *)modifiedResponseWithResponse:(nonnull NSURLResponse *)response; 24 | 25 | @end 26 | 27 | /** 28 | A downloader response modifier class with block. 29 | */ 30 | @interface SDWebImageDownloaderResponseModifier : NSObject 31 | 32 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderResponseModifierBlock)block; 33 | + (nonnull instancetype)responseModifierWithBlock:(nonnull SDWebImageDownloaderResponseModifierBlock)block; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | 10 | #import "SDWebImageDownloaderResponseModifier.h" 11 | 12 | @interface SDWebImageDownloaderResponseModifier () 13 | 14 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderResponseModifierBlock block; 15 | 16 | @end 17 | 18 | @implementation SDWebImageDownloaderResponseModifier 19 | 20 | - (instancetype)initWithBlock:(SDWebImageDownloaderResponseModifierBlock)block { 21 | self = [super init]; 22 | if (self) { 23 | self.block = block; 24 | } 25 | return self; 26 | } 27 | 28 | + (instancetype)responseModifierWithBlock:(SDWebImageDownloaderResponseModifierBlock)block { 29 | SDWebImageDownloaderResponseModifier *responseModifier = [[SDWebImageDownloaderResponseModifier alloc] initWithBlock:block]; 30 | return responseModifier; 31 | } 32 | 33 | - (nullable NSURLResponse *)modifiedResponseWithResponse:(nonnull NSURLResponse *)response { 34 | if (!self.block) { 35 | return nil; 36 | } 37 | return self.block(response); 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull SDWebImageErrorDomain; 13 | 14 | /// The HTTP status code for invalid download response (NSNumber *) 15 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey; 16 | 17 | /// SDWebImage error domain and codes 18 | typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) { 19 | SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL 20 | SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty 21 | SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached` 22 | SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized 23 | SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image download response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey` 24 | SDWebImageErrorCancelled = 2002, // The image loading operation is cancelled before finished, during either async disk cache query, or waiting before actual network request. For actual network request error, check `NSURLErrorDomain` error domain and code. 25 | SDWebImageErrorInvalidDownloadResponse = 2003, // When using response modifier, the modified download response is nil and marked as cancelled. 26 | }; 27 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageError.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageError.h" 11 | 12 | NSErrorDomain const _Nonnull SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 13 | NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey = @"SDWebImageErrorDownloadStatusCodeKey"; 14 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | /// A protocol represents cancelable operation. 12 | @protocol SDWebImageOperation 13 | 14 | - (void)cancel; 15 | 16 | @end 17 | 18 | /// NSOperation conform to `SDWebImageOperation`. 19 | @interface NSOperation (SDWebImageOperation) 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageDefine.h" 12 | 13 | @class SDWebImageOptionsResult; 14 | 15 | typedef SDWebImageOptionsResult * _Nullable(^SDWebImageOptionsProcessorBlock)(NSURL * _Nullable url, SDWebImageOptions options, SDWebImageContext * _Nullable context); 16 | 17 | /** 18 | The options result contains both options and context. 19 | */ 20 | @interface SDWebImageOptionsResult : NSObject 21 | 22 | /** 23 | WebCache options. 24 | */ 25 | @property (nonatomic, assign, readonly) SDWebImageOptions options; 26 | 27 | /** 28 | Context options. 29 | */ 30 | @property (nonatomic, copy, readonly, nullable) SDWebImageContext *context; 31 | 32 | /** 33 | Create a new options result. 34 | 35 | @param options options 36 | @param context context 37 | @return The options result contains both options and context. 38 | */ 39 | - (nonnull instancetype)initWithOptions:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context; 40 | 41 | @end 42 | 43 | /** 44 | This is the protocol for options processor. 45 | Options processor can be used, to control the final result for individual image request's `SDWebImageOptions` and `SDWebImageContext` 46 | Implements the protocol to have a global control for each indivadual image request's option. 47 | */ 48 | @protocol SDWebImageOptionsProcessor 49 | 50 | /** 51 | Return the processed options result for specify image URL, with its options and context 52 | 53 | @param url The URL to the image 54 | @param options A mask to specify options to use for this request 55 | @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. 56 | @return The processed result, contains both options and context 57 | */ 58 | - (nullable SDWebImageOptionsResult *)processedResultForURL:(nullable NSURL *)url 59 | options:(SDWebImageOptions)options 60 | context:(nullable SDWebImageContext *)context; 61 | 62 | @end 63 | 64 | /** 65 | A options processor class with block. 66 | */ 67 | @interface SDWebImageOptionsProcessor : NSObject 68 | 69 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block; 70 | + (nonnull instancetype)optionsProcessorWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageOptionsProcessor.h" 10 | 11 | @interface SDWebImageOptionsResult () 12 | 13 | @property (nonatomic, assign) SDWebImageOptions options; 14 | @property (nonatomic, copy, nullable) SDWebImageContext *context; 15 | 16 | @end 17 | 18 | @implementation SDWebImageOptionsResult 19 | 20 | - (instancetype)initWithOptions:(SDWebImageOptions)options context:(SDWebImageContext *)context { 21 | self = [super init]; 22 | if (self) { 23 | self.options = options; 24 | self.context = context; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | 31 | @interface SDWebImageOptionsProcessor () 32 | 33 | @property (nonatomic, copy, nonnull) SDWebImageOptionsProcessorBlock block; 34 | 35 | @end 36 | 37 | @implementation SDWebImageOptionsProcessor 38 | 39 | - (instancetype)initWithBlock:(SDWebImageOptionsProcessorBlock)block { 40 | self = [super init]; 41 | if (self) { 42 | self.block = block; 43 | } 44 | return self; 45 | } 46 | 47 | + (instancetype)optionsProcessorWithBlock:(SDWebImageOptionsProcessorBlock)block { 48 | SDWebImageOptionsProcessor *optionsProcessor = [[SDWebImageOptionsProcessor alloc] initWithBlock:block]; 49 | return optionsProcessor; 50 | } 51 | 52 | - (SDWebImageOptionsResult *)processedResultForURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context { 53 | if (!self.block) { 54 | return nil; 55 | } 56 | return self.block(url, options, context); 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | @interface UIImage (ExtendedCacheData) 14 | 15 | /** 16 | Read and Write the extended object and bind it to the image. Which can hold some extra metadata like Image's scale factor, URL rich link, date, etc. 17 | The extended object should conforms to NSCoding, which we use `NSKeyedArchiver` and `NSKeyedUnarchiver` to archive it to data, and write to disk cache. 18 | @note The disk cache preserve both of the data and extended data with the same cache key. For manual query, use the `SDDiskCache` protocol method `extendedDataForKey:` instead. 19 | @note You can specify arbitrary object conforms to NSCoding (NSObject protocol here is used to support object using `NS_ROOT_CLASS`, which is not NSObject subclass). If you load image from disk cache, you should check the extended object class to avoid corrupted data. 20 | @warning This object don't need to implements NSSecureCoding (but it's recommended), because we allows arbitrary class. 21 | */ 22 | @property (nonatomic, strong, nullable) id sd_extendedObject; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+ExtendedCacheData.h" 11 | #import 12 | 13 | @implementation UIImage (ExtendedCacheData) 14 | 15 | - (id)sd_extendedObject { 16 | return objc_getAssociatedObject(self, @selector(sd_extendedObject)); 17 | } 18 | 19 | - (void)setSd_extendedObject:(id)sd_extendedObject { 20 | objc_setAssociatedObject(self, @selector(sd_extendedObject), sd_extendedObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /** 12 | UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior). 13 | */ 14 | @interface UIImage (ForceDecode) 15 | 16 | /** 17 | A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode. 18 | */ 19 | @property (nonatomic, assign) BOOL sd_isDecoded; 20 | 21 | /** 22 | Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance. 23 | 24 | @param image The image to be decoded 25 | @return The decoded image 26 | */ 27 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image; 28 | 29 | /** 30 | Decode and scale down the provided image 31 | 32 | @param image The image to be decoded 33 | @return The decoded and scaled down image 34 | */ 35 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 36 | 37 | /** 38 | Decode and scale down the provided image with limit bytes 39 | 40 | @param image The image to be decoded 41 | @param bytes The limit bytes size. Provide 0 to use the build-in limit. 42 | @return The decoded and scaled down image 43 | */ 44 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDImageCoderHelper.h" 11 | #import "objc/runtime.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | - (BOOL)sd_isDecoded { 16 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isDecoded)); 17 | return value.boolValue; 18 | } 19 | 20 | - (void)setSd_isDecoded:(BOOL)sd_isDecoded { 21 | objc_setAssociatedObject(self, @selector(sd_isDecoded), @(sd_isDecoded), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image { 25 | if (!image) { 26 | return nil; 27 | } 28 | return [SDImageCoderHelper decodedImageWithImage:image]; 29 | } 30 | 31 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image { 32 | return [self sd_decodedAndScaledDownImageWithImage:image limitBytes:0]; 33 | } 34 | 35 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes { 36 | if (!image) { 37 | return nil; 38 | } 39 | return [SDImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:bytes]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | /** 13 | This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`. 14 | */ 15 | @interface UIImage (GIF) 16 | 17 | /** 18 | Creates an animated UIImage from an NSData. 19 | This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF. 20 | 21 | @param data The GIF data 22 | @return The created image 23 | */ 24 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import "SDImageGIFCoder.h" 12 | 13 | @implementation UIImage (GIF) 14 | 15 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data { 16 | if (!data) { 17 | return nil; 18 | } 19 | return [[SDImageGIFCoder sharedCoder] decodedImageWithData:data options:0]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /** 12 | UIImage category for memory cache cost. 13 | */ 14 | @interface UIImage (MemoryCacheCost) 15 | 16 | /** 17 | The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory. 18 | If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost. 19 | 20 | For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Retuen full frame bytes size when `image.images` is not nil for animated image. 21 | For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory. 22 | @note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods. 23 | @note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes. 24 | */ 25 | @property (assign, nonatomic) NSUInteger sd_memoryCost; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MemoryCacheCost.h" 10 | #import "objc/runtime.h" 11 | #import "NSImage+Compatibility.h" 12 | 13 | FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) { 14 | CGImageRef imageRef = image.CGImage; 15 | if (!imageRef) { 16 | return 0; 17 | } 18 | NSUInteger bytesPerFrame = CGImageGetBytesPerRow(imageRef) * CGImageGetHeight(imageRef); 19 | NSUInteger frameCount; 20 | #if SD_MAC 21 | frameCount = 1; 22 | #elif SD_UIKIT || SD_WATCH 23 | frameCount = image.images.count > 0 ? image.images.count : 1; 24 | #endif 25 | NSUInteger cost = bytesPerFrame * frameCount; 26 | return cost; 27 | } 28 | 29 | @implementation UIImage (MemoryCacheCost) 30 | 31 | - (NSUInteger)sd_memoryCost { 32 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost)); 33 | NSUInteger memoryCost; 34 | if (value != nil) { 35 | memoryCost = [value unsignedIntegerValue]; 36 | } else { 37 | memoryCost = SDMemoryCacheCostForImage(self); 38 | } 39 | return memoryCost; 40 | } 41 | 42 | - (void)setSd_memoryCost:(NSUInteger)sd_memoryCost { 43 | objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+Metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | /** 13 | UIImage category for image metadata, including animation, loop count, format, incremental, etc. 14 | */ 15 | @interface UIImage (Metadata) 16 | 17 | /** 18 | * UIKit: 19 | * For static image format, this value is always 0. 20 | * For animated image format, 0 means infinite looping. 21 | * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 22 | * AppKit: 23 | * NSImage currently only support animated via GIF imageRep unlike UIImage. 24 | * The getter of this property will get the loop count from GIF imageRep 25 | * The setter of this property will set the loop count from GIF imageRep 26 | */ 27 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount; 28 | 29 | /** 30 | * UIKit: 31 | * Check the `images` array property 32 | * AppKit: 33 | * NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep's frame count. 34 | */ 35 | @property (nonatomic, assign, readonly) BOOL sd_isAnimated; 36 | 37 | /** 38 | * The image format represent the original compressed image data format. 39 | * If you don't manually specify a format, this information is retrieve from CGImage using `CGImageGetUTType`, which may return nil for non-CG based image. At this time it will return `SDImageFormatUndefined` as default value. 40 | * @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 41 | */ 42 | @property (nonatomic, assign) SDImageFormat sd_imageFormat; 43 | 44 | /** 45 | A bool value indicating whether the image is during incremental decoding and may not contains full pixels. 46 | */ 47 | @property (nonatomic, assign) BOOL sd_isIncremental; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "SDImageCodersManager.h" 11 | 12 | @implementation UIImage (MultiFormat) 13 | 14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { 15 | return [self sd_imageWithData:data scale:1]; 16 | } 17 | 18 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale { 19 | return [self sd_imageWithData:data scale:scale firstFrameOnly:NO]; 20 | } 21 | 22 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly { 23 | if (!data) { 24 | return nil; 25 | } 26 | SDImageCoderOptions *options = @{SDImageCoderDecodeScaleFactor : @(MAX(scale, 1)), SDImageCoderDecodeFirstFrameOnly : @(firstFrameOnly)}; 27 | return [[SDImageCodersManager sharedManager] decodedImageWithData:data options:options]; 28 | } 29 | 30 | - (nullable NSData *)sd_imageData { 31 | return [self sd_imageDataAsFormat:SDImageFormatUndefined]; 32 | } 33 | 34 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { 35 | return [self sd_imageDataAsFormat:imageFormat compressionQuality:1]; 36 | } 37 | 38 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality { 39 | return [self sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:NO]; 40 | } 41 | 42 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly { 43 | SDImageCoderOptions *options = @{SDImageCoderEncodeCompressionQuality : @(compressionQuality), SDImageCoderEncodeFirstFrameOnly : @(firstFrameOnly)}; 44 | return [[SDImageCodersManager sharedManager] encodedDataWithImage:self format:imageFormat options:options]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageOperation.h" 11 | 12 | /** 13 | These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 14 | All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 15 | */ 16 | @interface UIView (WebCacheOperation) 17 | 18 | /** 19 | * Get the image load operation for key 20 | * 21 | * @param key key for identifying the operations 22 | * @return the image load operation 23 | */ 24 | - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key; 25 | 26 | /** 27 | * Set the image load operation (storage in a UIView based weak map table) 28 | * 29 | * @param operation the operation 30 | * @param key key for storing the operation 31 | */ 32 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 33 | 34 | /** 35 | * Cancel all operations for the current UIView and key 36 | * 37 | * @param key key for identifying the operations 38 | */ 39 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 40 | 41 | /** 42 | * Just remove the operations corresponding to the current UIView and key without cancelling them 43 | * 44 | * @param key key for identifying the operations 45 | */ 46 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/NSBezierPath+RoundedCorners.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import "UIImage+Transform.h" 14 | 15 | @interface NSBezierPath (RoundedCorners) 16 | 17 | /** 18 | Convenience way to create a bezier path with the specify rounding corners on macOS. Same as the one on `UIBezierPath`. 19 | */ 20 | + (nonnull instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius; 21 | 22 | @end 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/NSBezierPath+RoundedCorners.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSBezierPath+RoundedCorners.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSBezierPath (RoundedCorners) 14 | 15 | + (instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius { 16 | NSBezierPath *path = [NSBezierPath bezierPath]; 17 | 18 | CGFloat maxCorner = MIN(NSWidth(rect), NSHeight(rect)) / 2; 19 | 20 | CGFloat topLeftRadius = MIN(maxCorner, (corners & SDRectCornerTopLeft) ? cornerRadius : 0); 21 | CGFloat topRightRadius = MIN(maxCorner, (corners & SDRectCornerTopRight) ? cornerRadius : 0); 22 | CGFloat bottomLeftRadius = MIN(maxCorner, (corners & SDRectCornerBottomLeft) ? cornerRadius : 0); 23 | CGFloat bottomRightRadius = MIN(maxCorner, (corners & SDRectCornerBottomRight) ? cornerRadius : 0); 24 | 25 | NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect)); 26 | NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); 27 | NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect)); 28 | NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect)); 29 | 30 | [path moveToPoint:NSMakePoint(NSMidX(rect), NSMaxY(rect))]; 31 | [path appendBezierPathWithArcFromPoint:topLeft toPoint:bottomLeft radius:topLeftRadius]; 32 | [path appendBezierPathWithArcFromPoint:bottomLeft toPoint:bottomRight radius:bottomLeftRadius]; 33 | [path appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight radius:bottomRightRadius]; 34 | [path appendBezierPathWithArcFromPoint:topRight toPoint:topLeft radius:topRightRadius]; 35 | [path closePath]; 36 | 37 | return path; 38 | } 39 | 40 | @end 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /// Copy the associated object from source image to target image. The associated object including all the category read/write properties. 12 | /// @param source source 13 | /// @param target target 14 | FOUNDATION_EXPORT void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target); 15 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDAssociatedObject.h" 10 | #import "UIImage+Metadata.h" 11 | #import "UIImage+ExtendedCacheData.h" 12 | #import "UIImage+MemoryCacheCost.h" 13 | #import "UIImage+ForceDecode.h" 14 | 15 | void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target) { 16 | if (!source || !target) { 17 | return; 18 | } 19 | // Image Metadata 20 | target.sd_isIncremental = source.sd_isIncremental; 21 | target.sd_imageLoopCount = source.sd_imageLoopCount; 22 | target.sd_imageFormat = source.sd_imageFormat; 23 | // Force Decode 24 | target.sd_isDecoded = source.sd_isDecoded; 25 | // Extended Cache Data 26 | target.sd_extendedObject = source.sd_extendedObject; 27 | } 28 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @class SDAsyncBlockOperation; 12 | typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation); 13 | 14 | @interface SDAsyncBlockOperation : NSOperation 15 | 16 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block; 17 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block; 18 | - (void)complete; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDAsyncBlockOperation.h" 10 | 11 | @interface SDAsyncBlockOperation () 12 | 13 | @property (assign, nonatomic, getter = isExecuting) BOOL executing; 14 | @property (assign, nonatomic, getter = isFinished) BOOL finished; 15 | @property (nonatomic, copy, nonnull) SDAsyncBlock executionBlock; 16 | 17 | @end 18 | 19 | @implementation SDAsyncBlockOperation 20 | 21 | @synthesize executing = _executing; 22 | @synthesize finished = _finished; 23 | 24 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block { 25 | self = [super init]; 26 | if (self) { 27 | self.executionBlock = block; 28 | } 29 | return self; 30 | } 31 | 32 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block { 33 | SDAsyncBlockOperation *operation = [[SDAsyncBlockOperation alloc] initWithBlock:block]; 34 | return operation; 35 | } 36 | 37 | - (void)start { 38 | if (self.isCancelled) { 39 | return; 40 | } 41 | 42 | [self willChangeValueForKey:@"isExecuting"]; 43 | self.executing = YES; 44 | [self didChangeValueForKey:@"isExecuting"]; 45 | 46 | if (self.executionBlock) { 47 | self.executionBlock(self); 48 | } else { 49 | [self complete]; 50 | } 51 | } 52 | 53 | - (void)cancel { 54 | [super cancel]; 55 | [self complete]; 56 | } 57 | 58 | - (void)complete { 59 | [self willChangeValueForKey:@"isExecuting"]; 60 | [self willChangeValueForKey:@"isFinished"]; 61 | self.executing = NO; 62 | self.finished = YES; 63 | [self didChangeValueForKey:@"isExecuting"]; 64 | [self didChangeValueForKey:@"isFinished"]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDDeviceHelper : NSObject 13 | 14 | + (NSUInteger)totalMemory; 15 | + (NSUInteger)freeMemory; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDDeviceHelper.h" 10 | #import 11 | 12 | @implementation SDDeviceHelper 13 | 14 | + (NSUInteger)totalMemory { 15 | return (NSUInteger)[[NSProcessInfo processInfo] physicalMemory]; 16 | } 17 | 18 | + (NSUInteger)freeMemory { 19 | mach_port_t host_port = mach_host_self(); 20 | mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); 21 | vm_size_t page_size; 22 | vm_statistics_data_t vm_stat; 23 | kern_return_t kern; 24 | 25 | kern = host_page_size(host_port, &page_size); 26 | if (kern != KERN_SUCCESS) return 0; 27 | kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); 28 | if (kern != KERN_SUCCESS) return 0; 29 | return vm_stat.free_count * page_size; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | // Cross-platform display link wrapper. Do not retain the target 13 | // Use `CADisplayLink` on iOS/tvOS, `CVDisplayLink` on macOS, `NSTimer` on watchOS 14 | 15 | @interface SDDisplayLink : NSObject 16 | 17 | @property (readonly, nonatomic, weak, nullable) id target; 18 | @property (readonly, nonatomic, assign, nonnull) SEL selector; 19 | @property (readonly, nonatomic) CFTimeInterval duration; 20 | @property (readonly, nonatomic) BOOL isRunning; 21 | 22 | + (nonnull instancetype)displayLinkWithTarget:(nonnull id)target selector:(nonnull SEL)sel; 23 | 24 | - (void)addToRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode; 25 | - (void)removeFromRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode; 26 | 27 | - (void)start; 28 | - (void)stop; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is from https://gist.github.com/zydeco/6292773 3 | // 4 | // Created by Jesús A. Álvarez on 2008-12-17. 5 | // Copyright 2008-2009 namedfork.net. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SDFileAttributeHelper : NSObject 11 | 12 | + (NSArray*)extendedAttributeNamesAtPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; 13 | + (BOOL)hasExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; 14 | + (NSData*)extendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; 15 | + (BOOL)setExtendedAttribute:(NSString*)name value:(NSData*)value atPath:(NSString*)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError**)err; 16 | + (BOOL)removeExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | // Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :) 13 | 14 | @interface SDImageAssetManager : NSObject 15 | 16 | @property (nonatomic, strong, nonnull) NSMapTable *imageTable; 17 | 18 | + (nonnull instancetype)sharedAssetManager; 19 | - (nullable NSString *)getPathForName:(nonnull NSString *)name bundle:(nonnull NSBundle *)bundle preferredScale:(nonnull CGFloat *)scale; 20 | - (nullable UIImage *)imageForName:(nonnull NSString *)name; 21 | - (void)storeImage:(nonnull UIImage *)image forName:(nonnull NSString *)name; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | // This is used for operation management, but not for operation queue execute 13 | @interface SDImageCachesManagerOperation : NSOperation 14 | 15 | @property (nonatomic, assign, readonly) NSUInteger pendingCount; 16 | 17 | - (void)beginWithTotalCount:(NSUInteger)totalCount; 18 | - (void)completeOne; 19 | - (void)done; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCachesManagerOperation.h" 10 | #import "SDInternalMacros.h" 11 | 12 | @implementation SDImageCachesManagerOperation 13 | { 14 | dispatch_semaphore_t _pendingCountLock; 15 | } 16 | 17 | @synthesize executing = _executing; 18 | @synthesize finished = _finished; 19 | @synthesize cancelled = _cancelled; 20 | @synthesize pendingCount = _pendingCount; 21 | 22 | - (instancetype)init { 23 | if (self = [super init]) { 24 | _pendingCountLock = dispatch_semaphore_create(1); 25 | _pendingCount = 0; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)beginWithTotalCount:(NSUInteger)totalCount { 31 | self.executing = YES; 32 | self.finished = NO; 33 | _pendingCount = totalCount; 34 | } 35 | 36 | - (NSUInteger)pendingCount { 37 | SD_LOCK(_pendingCountLock); 38 | NSUInteger pendingCount = _pendingCount; 39 | SD_UNLOCK(_pendingCountLock); 40 | return pendingCount; 41 | } 42 | 43 | - (void)completeOne { 44 | SD_LOCK(_pendingCountLock); 45 | _pendingCount = _pendingCount > 0 ? _pendingCount - 1 : 0; 46 | SD_UNLOCK(_pendingCountLock); 47 | } 48 | 49 | - (void)cancel { 50 | self.cancelled = YES; 51 | [self reset]; 52 | } 53 | 54 | - (void)done { 55 | self.finished = YES; 56 | self.executing = NO; 57 | [self reset]; 58 | } 59 | 60 | - (void)reset { 61 | SD_LOCK(_pendingCountLock); 62 | _pendingCount = 0; 63 | SD_UNLOCK(_pendingCountLock); 64 | } 65 | 66 | - (void)setFinished:(BOOL)finished { 67 | [self willChangeValueForKey:@"isFinished"]; 68 | _finished = finished; 69 | [self didChangeValueForKey:@"isFinished"]; 70 | } 71 | 72 | - (void)setExecuting:(BOOL)executing { 73 | [self willChangeValueForKey:@"isExecuting"]; 74 | _executing = executing; 75 | [self didChangeValueForKey:@"isExecuting"]; 76 | } 77 | 78 | - (void)setCancelled:(BOOL)cancelled { 79 | [self willChangeValueForKey:@"isCancelled"]; 80 | _cancelled = cancelled; 81 | [self didChangeValueForKey:@"isCancelled"]; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDImageHEICCoderInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageHEICCoder.h" 11 | 12 | // AVFileTypeHEIC/AVFileTypeHEIF is defined in AVFoundation via iOS 11, we use this without import AVFoundation 13 | #define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") 14 | #define kSDUTTypeHEIF ((__bridge CFStringRef)@"public.heif") 15 | // HEIC Sequence (Animated Image) 16 | #define kSDUTTypeHEICS ((__bridge CFStringRef)@"public.heics") 17 | 18 | @interface SDImageHEICCoder () 19 | 20 | + (BOOL)canDecodeFromHEICFormat; 21 | + (BOOL)canDecodeFromHEIFFormat; 22 | + (BOOL)canEncodeToHEICFormat; 23 | + (BOOL)canEncodeToHEIFFormat; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageIOAnimatedCoder.h" 11 | 12 | @interface SDImageIOAnimatedCoder () 13 | 14 | + (NSTimeInterval)frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source; 15 | + (NSUInteger)imageLoopCountWithSource:(nonnull CGImageSourceRef)source; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDmetamacros.h" 11 | 12 | #ifndef SD_LOCK 13 | #define SD_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); 14 | #endif 15 | 16 | #ifndef SD_UNLOCK 17 | #define SD_UNLOCK(lock) dispatch_semaphore_signal(lock); 18 | #endif 19 | 20 | #ifndef SD_OPTIONS_CONTAINS 21 | #define SD_OPTIONS_CONTAINS(options, value) (((options) & (value)) == (value)) 22 | #endif 23 | 24 | #ifndef weakify 25 | #define weakify(...) \ 26 | sd_keywordify \ 27 | metamacro_foreach_cxt(sd_weakify_,, __weak, __VA_ARGS__) 28 | #endif 29 | 30 | #ifndef strongify 31 | #define strongify(...) \ 32 | sd_keywordify \ 33 | _Pragma("clang diagnostic push") \ 34 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \ 35 | metamacro_foreach(sd_strongify_,, __VA_ARGS__) \ 36 | _Pragma("clang diagnostic pop") 37 | #endif 38 | 39 | #define sd_weakify_(INDEX, CONTEXT, VAR) \ 40 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); 41 | 42 | #define sd_strongify_(INDEX, VAR) \ 43 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); 44 | 45 | #if DEBUG 46 | #define sd_keywordify autoreleasepool {} 47 | #else 48 | #define sd_keywordify try {} @catch (...) {} 49 | #endif 50 | 51 | #ifndef onExit 52 | #define onExit \ 53 | sd_keywordify \ 54 | __strong sd_cleanupBlock_t metamacro_concat(sd_exitBlock_, __LINE__) __attribute__((cleanup(sd_executeCleanupBlock), unused)) = ^ 55 | #endif 56 | 57 | typedef void (^sd_cleanupBlock_t)(void); 58 | 59 | #if defined(__cplusplus) 60 | extern "C" { 61 | #endif 62 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block); 63 | #if defined(__cplusplus) 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDInternalMacros.h" 10 | 11 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block) { 12 | (*block)(); 13 | } 14 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWeakProxy : NSProxy 13 | 14 | @property (nonatomic, weak, readonly, nullable) id target; 15 | 16 | - (nonnull instancetype)initWithTarget:(nonnull id)target; 17 | + (nonnull instancetype)proxyWithTarget:(nonnull id)target; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWeakProxy.h" 10 | 11 | @implementation SDWeakProxy 12 | 13 | - (instancetype)initWithTarget:(id)target { 14 | _target = target; 15 | return self; 16 | } 17 | 18 | + (instancetype)proxyWithTarget:(id)target { 19 | return [[SDWeakProxy alloc] initWithTarget:target]; 20 | } 21 | 22 | - (id)forwardingTargetForSelector:(SEL)selector { 23 | return _target; 24 | } 25 | 26 | - (void)forwardInvocation:(NSInvocation *)invocation { 27 | void *null = NULL; 28 | [invocation setReturnValue:&null]; 29 | } 30 | 31 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { 32 | return [NSObject instanceMethodSignatureForSelector:@selector(init)]; 33 | } 34 | 35 | - (BOOL)respondsToSelector:(SEL)aSelector { 36 | return [_target respondsToSelector:aSelector]; 37 | } 38 | 39 | - (BOOL)isEqual:(id)object { 40 | return [_target isEqual:object]; 41 | } 42 | 43 | - (NSUInteger)hash { 44 | return [_target hash]; 45 | } 46 | 47 | - (Class)superclass { 48 | return [_target superclass]; 49 | } 50 | 51 | - (Class)class { 52 | return [_target class]; 53 | } 54 | 55 | - (BOOL)isKindOfClass:(Class)aClass { 56 | return [_target isKindOfClass:aClass]; 57 | } 58 | 59 | - (BOOL)isMemberOfClass:(Class)aClass { 60 | return [_target isMemberOfClass:aClass]; 61 | } 62 | 63 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol { 64 | return [_target conformsToProtocol:aProtocol]; 65 | } 66 | 67 | - (BOOL)isProxy { 68 | return YES; 69 | } 70 | 71 | - (NSString *)description { 72 | return [_target description]; 73 | } 74 | 75 | - (NSString *)debugDescription { 76 | return [_target debugDescription]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/UIColor+HexString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIColor (HexString) 12 | 13 | /** 14 | Convenience way to get hex string from color. The output should always be 32-bit RGBA hex string like `#00000000`. 15 | */ 16 | @property (nonatomic, copy, readonly, nonnull) NSString *sd_hexString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/Private/UIColor+HexString.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIColor+HexString.h" 10 | 11 | @implementation UIColor (HexString) 12 | 13 | - (NSString *)sd_hexString { 14 | CGFloat red, green, blue, alpha; 15 | #if SD_UIKIT 16 | if (![self getRed:&red green:&green blue:&blue alpha:&alpha]) { 17 | [self getWhite:&red alpha:&alpha]; 18 | green = red; 19 | blue = red; 20 | } 21 | #else 22 | @try { 23 | [self getRed:&red green:&green blue:&blue alpha:&alpha]; 24 | } 25 | @catch (NSException *exception) { 26 | [self getWhite:&red alpha:&alpha]; 27 | green = red; 28 | blue = red; 29 | } 30 | #endif 31 | 32 | red = roundf(red * 255.f); 33 | green = roundf(green * 255.f); 34 | blue = roundf(blue * 255.f); 35 | alpha = roundf(alpha * 255.f); 36 | 37 | uint hex = ((uint)alpha << 24) | ((uint)red << 16) | ((uint)green << 8) | ((uint)blue); 38 | 39 | return [NSString stringWithFormat:@"#%08x", hex]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/TYAutoCompleteTextField/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/TYAutoCompleteTextField/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | **iOS Components** for iOS by Trendyol application development team. 5 | 6 | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) 7 | 8 | iOS Components contains various ios custom views and helper frameworks written in pure swift. Developed by iOS app development team at Trendyol. 9 | 10 | ## Why? ## 11 | Developed to help iOS developers in community to build beautiful and functional iOS apps with less effort. 12 | 13 | ## Components Test App ## 14 | You can look at the test app named ComponentsTestApp by cloning the repo. All components shared here also implemented in test application. 15 | 16 | 17 | 18 | ## Components ## 19 | 20 | You can see brief summary of all components below. For detailed info, please click a component link provided in each component's section. 21 | 22 | # ImageSlider 23 | Custom collection view based slider component with infinite circular scrolling 24 | 25 | [ImageSlider Link](https://github.com/Trendyol/ios-components/tree/master/UILibraries/ImageSlider) 26 | 27 | # PinchableImageView 28 | Provides full screen zooming ability to UIImageView like instagram. 29 | 30 | [PinchableImageView Link](https://github.com/Trendyol/ios-components/tree/master/UILibraries/PinchableImageView/) 31 | 32 | 33 | License 34 | -------- 35 | Copyright 2019 Trendyol.com 36 | 37 | Licensed under the Apache License, Version 2.0 (the "License"); 38 | you may not use this file except in compliance with the License. 39 | You may obtain a copy of the License at 40 | 41 | http://www.apache.org/licenses/LICENSE-2.0 42 | 43 | Unless required by applicable law or agreed to in writing, software 44 | distributed under the License is distributed on an "AS IS" BASIS, 45 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 46 | See the License for the specific language governing permissions and 47 | limitations under the License. 48 | -------------------------------------------------------------------------------- /Pods/TYAutoCompleteTextField/UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/ColorExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | static let completionGray = UIColor(red:191.0/255.0, green:191.0/255.0, blue:198.0/255.0, alpha:1.0) 13 | } 14 | -------------------------------------------------------------------------------- /Pods/TYAutoCompleteTextField/UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/SelectorExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectorExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Selector { 12 | static let editingDidEnd = #selector(AutoCompleteTextField.editingDidEnd) 13 | static let editingChanged = #selector(AutoCompleteTextField.editingChanged) 14 | } 15 | -------------------------------------------------------------------------------- /Pods/TYAutoCompleteTextField/UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/StringExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | extension String { 13 | static let emailPattern = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Z0-9.-]{0,}$" 14 | 15 | var isValidEmail: Bool { 16 | do { 17 | let regex = try NSRegularExpression(pattern: String.emailPattern, options: .caseInsensitive) 18 | let matches = regex.matches(in: self, range: NSRange(location: 0, length: self.count)) 19 | return !matches.isEmpty 20 | } catch { 21 | return false 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pods/TYPinchableImageView/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ComponentsTestApp : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ComponentsTestApp 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework 3 | ${BUILT_PRODUCTS_DIR}/TYAutoCompleteTextField/TYAutoCompleteTextField.framework 4 | ${BUILT_PRODUCTS_DIR}/TYPinchableImageView/TYPinchableImageView.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TYAutoCompleteTextField.framework 3 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TYPinchableImageView.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework 3 | ${BUILT_PRODUCTS_DIR}/TYAutoCompleteTextField/TYAutoCompleteTextField.framework 4 | ${BUILT_PRODUCTS_DIR}/TYPinchableImageView/TYPinchableImageView.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TYAutoCompleteTextField.framework 3 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TYPinchableImageView.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ComponentsTestAppVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ComponentsTestAppVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField/TYAutoCompleteTextField.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView/TYPinchableImageView.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" -framework "TYAutoCompleteTextField" -framework "TYPinchableImageView" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.. 11 | PODS_ROOT = ${SRCROOT}/../Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ComponentsTestApp { 2 | umbrella header "Pods-ComponentsTestApp-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ComponentsTestApp/Pods-ComponentsTestApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField/TYAutoCompleteTextField.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView/TYPinchableImageView.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" -framework "TYAutoCompleteTextField" -framework "TYPinchableImageView" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.. 11 | PODS_ROOT = ${SRCROOT}/../Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SDWebImage 5 | 6 | Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is furnished 13 | to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | 28 | ## TYPinchableImageView 29 | 30 | MIT License 31 | 32 | Copyright (c) 2019 Trendyol.com 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy 35 | of this software and associated documentation files (the "Software"), to deal 36 | in the Software without restriction, including without limitation the rights 37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 38 | copies of the Software, and to permit persons to whom the Software is 39 | furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all 42 | copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 50 | SOFTWARE. 51 | 52 | Generated by CocoaPods - https://cocoapods.org 53 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ImageSlider : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ImageSlider 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ImageSliderVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ImageSliderVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView/TYPinchableImageView.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" -framework "TYPinchableImageView" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../.. 10 | PODS_ROOT = ${SRCROOT}/../../Pods 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ImageSlider { 2 | umbrella header "Pods-ImageSlider-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ImageSlider/Pods-ImageSlider.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView/TYPinchableImageView.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "SDWebImage" -framework "TYPinchableImageView" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/../.. 10 | PODS_ROOT = ${SRCROOT}/../../Pods 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 5.4.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "NSButton+WebCache.h" 14 | #import "NSData+ImageContentType.h" 15 | #import "NSImage+Compatibility.h" 16 | #import "SDAnimatedImage.h" 17 | #import "SDAnimatedImagePlayer.h" 18 | #import "SDAnimatedImageRep.h" 19 | #import "SDAnimatedImageView+WebCache.h" 20 | #import "SDAnimatedImageView.h" 21 | #import "SDDiskCache.h" 22 | #import "SDImageAPNGCoder.h" 23 | #import "SDImageCache.h" 24 | #import "SDImageCacheConfig.h" 25 | #import "SDImageCacheDefine.h" 26 | #import "SDImageCachesManager.h" 27 | #import "SDImageCoder.h" 28 | #import "SDImageCoderHelper.h" 29 | #import "SDImageCodersManager.h" 30 | #import "SDImageFrame.h" 31 | #import "SDImageGIFCoder.h" 32 | #import "SDImageGraphics.h" 33 | #import "SDImageHEICCoder.h" 34 | #import "SDImageIOAnimatedCoder.h" 35 | #import "SDImageIOCoder.h" 36 | #import "SDImageLoader.h" 37 | #import "SDImageLoadersManager.h" 38 | #import "SDImageTransformer.h" 39 | #import "SDMemoryCache.h" 40 | #import "SDWebImageCacheKeyFilter.h" 41 | #import "SDWebImageCacheSerializer.h" 42 | #import "SDWebImageCompat.h" 43 | #import "SDWebImageDefine.h" 44 | #import "SDWebImageDownloader.h" 45 | #import "SDWebImageDownloaderConfig.h" 46 | #import "SDWebImageDownloaderDecryptor.h" 47 | #import "SDWebImageDownloaderOperation.h" 48 | #import "SDWebImageDownloaderRequestModifier.h" 49 | #import "SDWebImageDownloaderResponseModifier.h" 50 | #import "SDWebImageError.h" 51 | #import "SDWebImageIndicator.h" 52 | #import "SDWebImageManager.h" 53 | #import "SDWebImageOperation.h" 54 | #import "SDWebImageOptionsProcessor.h" 55 | #import "SDWebImagePrefetcher.h" 56 | #import "SDWebImageTransition.h" 57 | #import "UIButton+WebCache.h" 58 | #import "UIImage+ExtendedCacheData.h" 59 | #import "UIImage+ForceDecode.h" 60 | #import "UIImage+GIF.h" 61 | #import "UIImage+MemoryCacheCost.h" 62 | #import "UIImage+Metadata.h" 63 | #import "UIImage+MultiFormat.h" 64 | #import "UIImage+Transform.h" 65 | #import "UIImageView+HighlightedWebCache.h" 66 | #import "UIImageView+WebCache.h" 67 | #import "UIView+WebCache.h" 68 | #import "UIView+WebCacheOperation.h" 69 | #import "SDWebImage.h" 70 | 71 | FOUNDATION_EXPORT double SDWebImageVersionNumber; 72 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; 73 | 74 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SUPPORTS_MACCATALYST = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SUPPORTS_MACCATALYST = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SUPPORTS_MACCATALYST = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_TYAutoCompleteTextField : NSObject 3 | @end 4 | @implementation PodsDummy_TYAutoCompleteTextField 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double TYAutoCompleteTextFieldVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char TYAutoCompleteTextFieldVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/TYAutoCompleteTextField 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField.modulemap: -------------------------------------------------------------------------------- 1 | framework module TYAutoCompleteTextField { 2 | umbrella header "TYAutoCompleteTextField-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYAutoCompleteTextField/TYAutoCompleteTextField.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TYAutoCompleteTextField 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/TYAutoCompleteTextField 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_TYPinchableImageView : NSObject 3 | @end 4 | @implementation PodsDummy_TYPinchableImageView 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double TYPinchableImageViewVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char TYPinchableImageViewVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/TYPinchableImageView 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView.modulemap: -------------------------------------------------------------------------------- 1 | framework module TYPinchableImageView { 2 | umbrella header "TYPinchableImageView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/TYPinchableImageView 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/TYPinchableImageView/TYPinchableImageView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TYPinchableImageView 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/TYPinchableImageView 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Resources/statusBar-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/ios-components/cc2863d2edeae0640356cbcaf8b4f7b68861d62a/Resources/statusBar-image.png -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextField/AutoCompleteTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // AutoCompleteTextField.h 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for AutoCompleteTextField. 12 | FOUNDATION_EXPORT double AutoCompleteTextFieldVersionNumber; 13 | 14 | //! Project version string for AutoCompleteTextField. 15 | FOUNDATION_EXPORT const unsigned char AutoCompleteTextFieldVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/ColorExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | static let completionGray = UIColor(red:191.0/255.0, green:191.0/255.0, blue:198.0/255.0, alpha:1.0) 13 | } 14 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/SelectorExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectorExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Selector { 12 | static let editingDidEnd = #selector(AutoCompleteTextField.editingDidEnd) 13 | static let editingChanged = #selector(AutoCompleteTextField.editingChanged) 14 | } 15 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextField/Classes/Extension/StringExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringExtension.swift 3 | // AutoCompleteTextField 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | extension String { 13 | static let emailPattern = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Z0-9.-]{0,}$" 14 | 15 | var isValidEmail: Bool { 16 | do { 17 | let regex = try NSRegularExpression(pattern: String.emailPattern, options: .caseInsensitive) 18 | let matches = regex.matches(in: self, range: NSRange(location: 0, length: self.count)) 19 | return !matches.isEmpty 20 | } catch { 21 | return false 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextField/Resource/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextFieldTests/AutoCompleteTextFieldTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoCompleteTextFieldTests.swift 3 | // AutoCompleteTextFieldTests 4 | // 5 | // Created by Anıl T. on 2.04.2020. 6 | // Copyright © 2020 DSM Group Trendyol. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AutoCompleteTextField 11 | 12 | class AutoCompleteTextFieldTests: XCTestCase { 13 | 14 | override func setUpWithError() throws { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDownWithError() throws { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() throws { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() throws { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/AutoCompleteTextFieldTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UILibraries/AutoCompleteTextField/README.md: -------------------------------------------------------------------------------- 1 | # TYAutoCompleteTextField 2 | 3 | [![CI Status](https://img.shields.io/travis/Anıl.Taşkıran/TYAutoCompleteTextField.svg?style=flat)](https://travis-ci.org/Anıl.Taşkıran/TYAutoCompleteTextField) 4 | [![Version](https://img.shields.io/cocoapods/v/TYAutoCompleteTextField.svg?style=flat)](https://cocoapods.org/pods/TYAutoCompleteTextField) 5 | [![License](https://img.shields.io/cocoapods/l/TYAutoCompleteTextField.svg?style=flat)](https://cocoapods.org/pods/TYAutoCompleteTextField) 6 | [![Platform](https://img.shields.io/cocoapods/p/TYAutoCompleteTextField.svg?style=flat)](https://cocoapods.org/pods/TYAutoCompleteTextField) 7 | 8 | ## Example 9 | 10 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 11 | 12 | ## Requirements 13 | 14 | ## Installation 15 | 16 | TYAutoCompleteTextField is available through [CocoaPods](https://cocoapods.org). To install 17 | it, simply add the following line to your Podfile: 18 | 19 | ```ruby 20 | pod 'TYAutoCompleteTextField' 21 | ``` 22 | 23 | ## Author 24 | 25 | Anıl.Taşkıran, anil.taskiran@trendyol.com 26 | 27 | ## License 28 | 29 | TYAutoCompleteTextField is available under the MIT license. See the LICENSE file for more info. 30 | -------------------------------------------------------------------------------- /UILibraries/ContinuousPagingView/ContinuousPagingView/ContinuousPagingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContinuousPagingView.h 3 | // ContinuousPagingView 4 | // 5 | // Created by Emre Ergün on 27.07.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ContinuousPagingView. 12 | FOUNDATION_EXPORT double ContinuousPagingViewVersionNumber; 13 | 14 | //! Project version string for ContinuousPagingView. 15 | FOUNDATION_EXPORT const unsigned char ContinuousPagingViewVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /UILibraries/ContinuousPagingView/ContinuousPagingView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/ContinuousPagingView/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Classes/Core/ImageSliderCollectionViewCell/ImageSliderCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSliderCollectionViewCell.swift 3 | // ProductDetail 4 | // 5 | // Created by Emre Ergün on 8.11.2019. 6 | // Copyright © 2019 Trendyol.com. All rights reserved. 7 | // 8 | 9 | import TYPinchableImageView 10 | import UIKit 11 | 12 | protocol ImageSliderCollectionViewCellInterface: class { 13 | func loadImage(url: String?) 14 | func resetImage() 15 | } 16 | 17 | final class ImageSliderCollectionViewCell: UICollectionViewCell { 18 | lazy var contentImageView: PinchableImageView = { 19 | let imageView = PinchableImageView() 20 | imageView.contentMode = .scaleAspectFill 21 | return imageView 22 | }() 23 | 24 | @IBOutlet private weak var someImageView: UIImageView! 25 | 26 | var presenter: ImageSliderCollectionViewCellPresenterInterface! { 27 | didSet { 28 | presenter.load() 29 | } 30 | } 31 | 32 | override init(frame: CGRect) { 33 | super.init(frame: frame) 34 | setupUI() 35 | } 36 | 37 | required init?(coder: NSCoder) { 38 | super.init(coder: coder) 39 | setupUI() 40 | } 41 | 42 | private func setupUI() { 43 | contentImageView.embedEdgeToEdge(in: self) 44 | } 45 | 46 | override func prepareForReuse() { 47 | super.prepareForReuse() 48 | resetImage() 49 | } 50 | } 51 | 52 | extension ImageSliderCollectionViewCell: ImageSliderCollectionViewCellInterface { 53 | func resetImage() { 54 | contentImageView.image = nil 55 | } 56 | 57 | func loadImage(url: String?) { 58 | contentImageView.setImageWith(path: url) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Classes/Core/ImageSliderCollectionViewCell/ImageSliderCollectionViewCellPresenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSliderCollectionViewCellPresenter.swift 3 | // ProductDetail 4 | // 5 | // Created by Emre Ergün on 8.11.2019. 6 | // Copyright © 2019 Trendyol.com. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol ImageSliderCollectionViewCellPresenterInterface { 12 | var imageUrl: String { get set } 13 | 14 | func load() 15 | } 16 | 17 | final class ImageSliderCollectionViewCellPresenter { 18 | var imageUrl: String 19 | 20 | private weak var view: ImageSliderCollectionViewCellInterface? 21 | 22 | init(imageUrl: String, view: ImageSliderCollectionViewCellInterface?) { 23 | self.view = view 24 | self.imageUrl = imageUrl 25 | } 26 | } 27 | 28 | extension ImageSliderCollectionViewCellPresenter: ImageSliderCollectionViewCellPresenterInterface { 29 | func load() { 30 | view?.loadImage(url: imageUrl) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Classes/Core/ImageSliderPagerView/ImageSliderPagerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSliderPagerView.swift 3 | // ProductDetail 4 | // 5 | // Created by Emre Ergün on 8.11.2019. 6 | // Copyright © 2019 Trendyol.com. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private extension ImageSliderPagerView { 12 | enum Constant { 13 | enum UI { 14 | static let cornerRadius: CGFloat = 10 15 | static let backgroundAlpha: CGFloat = 0.3 16 | static let pageControlHorizontalInset: CGFloat = 10 17 | static let pageControlVerticalInset: CGFloat = 6 18 | } 19 | } 20 | } 21 | 22 | final class ImageSliderPagerView: UIView { 23 | lazy var pageControl = UIPageControl() 24 | 25 | override init(frame: CGRect) { 26 | super.init(frame: frame) 27 | commonInit() 28 | } 29 | 30 | required init?(coder: NSCoder) { 31 | super.init(coder: coder) 32 | commonInit() 33 | } 34 | 35 | private func commonInit() { 36 | layer.cornerRadius = Constant.UI.cornerRadius 37 | layer.masksToBounds = true 38 | backgroundColor = UIColor.black.withAlphaComponent(Constant.UI.backgroundAlpha) 39 | preparePageControl() 40 | } 41 | 42 | private func preparePageControl() { 43 | pageControl.embed(in: self, anchors: [ 44 | .leading(Constant.UI.pageControlHorizontalInset), 45 | .trailing(-Constant.UI.pageControlHorizontalInset), 46 | .top(Constant.UI.pageControlVerticalInset), 47 | .bottom(-Constant.UI.pageControlVerticalInset)] 48 | ) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Classes/Extension/UIImageViewExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageViewExtensions.swift 3 | // ImageSlider 4 | // 5 | // Created by Emre Ergün on 13.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import SDWebImage 10 | import UIKit 11 | 12 | public typealias ImageLoadingCompletion = (Result) -> Void 13 | 14 | public enum ImageLoadingError: Error { 15 | case internalError(Error) 16 | case noImage 17 | } 18 | 19 | public extension UIImageView { 20 | func setImageWith(path: String?, 21 | placeholder: UIImage? = nil, 22 | completion: ImageLoadingCompletion? = nil) { 23 | guard let unwrappedPath = path?.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines), let url = URL(string: unwrappedPath) else { return } 24 | self.sd_setImage(with: url, placeholderImage: placeholder) { (image, error, _, _) in 25 | if let error = error { 26 | completion?(.failure(ImageLoadingError.internalError(error))) 27 | return 28 | } 29 | 30 | guard let image = image else { 31 | completion?(.failure(ImageLoadingError.noImage)) 32 | return 33 | } 34 | 35 | completion?(.success(image)) 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Classes/Extension/UIViewExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewExtensions.swift 3 | // EEImageSlider 4 | // 5 | // Created by Emre Ergün on 10.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | enum Anchor { 13 | case leading(CGFloat) 14 | case trailing(CGFloat) 15 | case top(CGFloat) 16 | case bottom(CGFloat) 17 | case centerY(CGFloat) 18 | case centerX(CGFloat) 19 | case width(CGFloat) 20 | case height(CGFloat) 21 | } 22 | 23 | @discardableResult 24 | func embedEdgeToEdge(in containerView: UIView) -> [NSLayoutConstraint] { 25 | return embed(in: containerView, anchors: [.leading(0), .trailing(0), .bottom(0), .top(0)]) 26 | } 27 | 28 | @discardableResult 29 | func embed(in superView: UIView, anchors: [Anchor], additionalConstraints: [NSLayoutConstraint]? = nil) -> [NSLayoutConstraint] { 30 | superView.addSubview(self) 31 | var constraints = additionalConstraints ?? [NSLayoutConstraint]() 32 | 33 | anchors.forEach { (anchor) in 34 | switch anchor { 35 | case .leading(let value): 36 | constraints.append(leadingAnchor.constraint(equalTo: superView.leadingAnchor, constant: value)) 37 | case .trailing(let value): 38 | constraints.append(trailingAnchor.constraint(equalTo: superView.trailingAnchor, constant: value)) 39 | case .top(let value): 40 | constraints.append(topAnchor.constraint(equalTo: superView.topAnchor, constant: value)) 41 | case .bottom(let value): 42 | constraints.append(bottomAnchor.constraint(equalTo: superView.bottomAnchor, constant: value)) 43 | case .centerY(let value): 44 | constraints.append(centerYAnchor.constraint(equalTo: superView.centerYAnchor, constant: value)) 45 | case .centerX(let value): 46 | constraints.append(centerXAnchor.constraint(equalTo: superView.centerXAnchor, constant: value)) 47 | case .width(let value): 48 | constraints.append(widthAnchor.constraint(equalToConstant: value)) 49 | case .height(let value): 50 | constraints.append(heightAnchor.constraint(equalToConstant: value)) 51 | } 52 | } 53 | 54 | translatesAutoresizingMaskIntoConstraints = false 55 | NSLayoutConstraint.activate(constraints) 56 | return constraints 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/ImageSlider.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSlider.h 3 | // ImageSlider 4 | // 5 | // Created by Emre Ergün on 13.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ImageSlider. 12 | FOUNDATION_EXPORT double ImageSliderVersionNumber; 13 | 14 | //! Project version string for ImageSlider. 15 | FOUNDATION_EXPORT const unsigned char ImageSliderVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/ImageSlider/Resource/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UILibraries/ImageSlider/README.md: -------------------------------------------------------------------------------- 1 | # ImageSlider 2 | 3 | **Custom collection view based image slider component with infinite circular scrolling** 4 | 5 | ![](https://img.shields.io/badge/version-0.0.9-blue.svg) 6 | ![](https://img.shields.io/badge/platform-ios-lightgrey.svg) 7 | ![](https://img.shields.io/badge/Owner-trendyol.com-yellowgreen.svg) 8 | 9 | ## What does ImageSlider do? 10 | * Shows images from given remote url horizontally 11 | * Looping through images 12 | * Full screen pinch zoom on displayed image 13 | * Built-in pager 14 | 15 |
16 | 17 | ![](https://media.giphy.com/media/ZClbLmhoBHA2fPkAje/giphy.gif) 18 | 19 | ##
Setup 20 | 21 | **Using CocoaPods (Recommended)** 22 | 23 | Add the line below to your Podfile; 24 | 25 | ``` 26 | pod 'TYImageSlider' 27 | ``` 28 | 29 | Then you can install it with *pod install* command. 30 | 31 | **Manual** 32 | 33 | Download the sample project from link below, just drag and drop files under the file *Classes* to your project. 34 | 35 | ##
Usage 36 | First place an UIView in storyboard or xib, make its class to **ImageSliderView**. Connect it to code by making outlet; 37 | 38 | ``` 39 | @IBOutlet private weak var imageSliderView: ImageSliderView! 40 | ``` 41 | Then create an instance of **ImageSliderViewPresenter**, pass your remote image urls and imageslider view outlet created before to it's initializer. Then set the ImageSliderViewPresenter instance to presenter property of imageSliderView; 42 | 43 | ``` 44 | let imageSliderPresenter = ImageSliderViewPresenter(imageUrls: imageUrls, 45 | loopingEnabled: true, 46 | view: imageSliderView) 47 | imageSliderView.presenter = imageSliderPresenter 48 | ``` 49 | 50 | ##
Parameters 51 | 52 | Configure imageSlider view while you are creating instance of ImageSliderViewPresenter explained above. Parameters; 53 | 54 | * **imageUrls:** Remote image urls 55 | * **loopingEnabled:** It enables looping through images when set to true 56 | * **view:** ImageSlider view instance 57 | 58 | ##
Dependencies 59 | ImageSlider uses libraries below; 60 | 61 | * [SDWebImage](https://github.com/SDWebImage/SDWebImage) 62 | * [PinchableImageView](https://github.com/Trendyol/ios-components/tree/master/UILibraries/PinchableImageView/) 63 | 64 | ##
Todos 65 | 66 | * ImageSliderView initializes from interface builder only at this moment. It should be initialize from code directly 67 | * ImageSliderView should support UIImage objects directly. It supports remote image urls only at this moment. 68 | * Pager should be configurable 69 | 70 | ##
Questions or Advices 71 | You can create an issue, or all PRs all welcome if you believe you fix something wrong. -------------------------------------------------------------------------------- /UILibraries/LinkLabel/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UILibraries/LinkLabel/LinkLabel.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UILibraries/LinkLabel/LinkLabel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UILibraries/LinkLabel/LinkLabel/LinkLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // LinkLabel.h 3 | // LinkLabel 4 | // 5 | // Created by Selin Ersev on 22.06.2021. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for LinkLabel. 11 | FOUNDATION_EXPORT double LinkLabelVersionNumber; 12 | 13 | //! Project version string for LinkLabel. 14 | FOUNDATION_EXPORT const unsigned char LinkLabelVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /UILibraries/LinkLabel/LinkLabel/Resource/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/LinkLabel/README.md: -------------------------------------------------------------------------------- 1 | # LinkLabel 2 | 3 | **Custom label which provides clickable hashtags and links** 4 | 5 | ## Usage 6 | First place an UIView in storyboard or xib, make its class to **TYLinkLabel**. Connect it to code by making outlet; 7 | 8 | ``` 9 | @IBOutlet private weak var label: TYLinkLabel! 10 | ``` 11 | Then customize linkLabel; 12 | 13 | ``` 14 | let firstText = "firstText" 15 | let secondText = "secondText" 16 | let fullText = "firstText and secondText" 17 | let firstLink = LabelLink(title: firstText, 18 | color: .red, 19 | font: .boldSystemFont(ofSize: 12)) 20 | let secondLink = LabelLink(title: secondText, 21 | color: .blue, 22 | font: .boldSystemFont(ofSize: 12)) 23 | label.add([firstLink, secondLink]) 24 | label.text = fullText 25 | label.handleAllTaps { [weak self] tappedLink in 26 | switch tappedLink { 27 | case firstLink: 28 | // handle first link 29 | case secondLink: 30 | // handle second link 31 | default: 32 | break 33 | } 34 | } 35 | ``` 36 | 37 | For hashtags; 38 | ``` 39 | label.hashtagColor = .blue 40 | label.text = "" 41 | label.addHashtagsHandleTaps { [weak self] hashtag in 42 | // handle hastags 43 | } 44 | ``` 45 | 46 | ## Author 47 | Selin Ersev, selin.ersev@trendyol.com 48 | -------------------------------------------------------------------------------- /UILibraries/PinchableImageView/PinchableImageView/PinchableImageView/PinchableImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PinchableImageView.h 3 | // PinchableImageView 4 | // 5 | // Created by Emre Ergün on 14.01.2020. 6 | // Copyright © 2020 Emre Ergün. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for PinchableImageView. 12 | FOUNDATION_EXPORT double PinchableImageViewVersionNumber; 13 | 14 | //! Project version string for PinchableImageView. 15 | FOUNDATION_EXPORT const unsigned char PinchableImageViewVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /UILibraries/PinchableImageView/PinchableImageView/PinchableImageView/Resource/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/PinchableImageView/README.md: -------------------------------------------------------------------------------- 1 | # PinchableImageView 2 | 3 | **Provides full screen zooming ability to UIImageView like instagram.** 4 | 5 | ![](https://img.shields.io/badge/version-0.0.3-blue.svg) 6 | ![](https://img.shields.io/badge/platform-ios-lightgrey.svg) 7 | ![](https://img.shields.io/badge/Owner-trendyol.com-yellowgreen.svg) 8 | 9 | ##
What does PinchableImageView do? 10 | Gives full screen zooming ability to UIImageView with no additional code. 11 | 12 | ![](https://media.giphy.com/media/MarT2MCjgFAi86tJ3A/giphy.gif) 13 | 14 | ##
Setup 15 | 16 | **Using CocoaPods (Recommended)** 17 | 18 | Add the line below to your Podfile; 19 | 20 | ``` 21 | pod 'TYPinchableImageView' 22 | ``` 23 | 24 | Then you can install it with pod install command. 25 | 26 | **Manual** 27 | 28 | Download the sample project from link below, just drag and drop the PinchableImageView.swift file to your project. 29 | 30 | ##
Usage 31 | Make your image view subclass of PinchableImageView. It's simple as that. 32 | 33 | ##
Customizable Parameters 34 | Custom parameters can be set through PinchableImageView instance 35 | 36 | ``` 37 | @IBOutlet weak var pinchableImageView: PinchableImageView! { 38 | didSet { 39 | pinchableImageView.minZoomScale = 0.5 40 | pinchableImageView.maxZoomScale = 3.0 41 | pinchableImageView.resetAnimationDuration = 0.5 42 | pinchableImageView.zoomDelegate = self 43 | } 44 | } 45 | ``` 46 | 47 | * **minZoomScale:** Minimum scale of the zoom imageview. Default value is 1.00 48 | * **maxZoomScale:** Maximum scale of the zoom imageview. Default value is 3.00 49 | * **resetAnimationDuration:** Duration of the reset animation. Default value is 0.3 sec 50 | * **zoomDelegate:** Zoom Delegate is informed when zooming started and ended. 51 | * **isZoomingActive:** Flag that indicates whether zooming is active or not. (Read Only) 52 | 53 | ##
Questions or Advices 54 | You can create an issue, or all PRs all welcome if you believe you fix something wrong. -------------------------------------------------------------------------------- /UILibraries/StatusBarView/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Trendyol.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/README.md: -------------------------------------------------------------------------------- 1 | # StatusBarView 2 | 3 | ## Example 4 | 5 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 6 | 7 | ## Setup 8 | 9 | **Using CocoaPods (Recommended)** 10 | 11 | Add the line below to your Podfile; 12 | 13 | ``` 14 | pod 'TYStatusBarView' 15 | ``` 16 | 17 | Then you can install it with *pod install* command. 18 | 19 | **Manual** 20 | 21 | Download the sample project from link below, just drag and drop files 22 | 23 | ## Usage 24 | 25 | After you initialize the `StatusBarView`, you can configure the view by calling `configure` method. 26 | 27 | **Example:** 28 | 29 | ```swift 30 | let titles = ["Received", "Preparing", "Shipped", "Completed"] 31 | statusBarView.configure(titles: titles, activeIndex: 1, activeColor: .systemGreen, passiveColor: .lightGray) 32 | ``` 33 | 34 | ## Author 35 | 36 | Ersen Tekin, ersen.tekin@trendyol.com 37 | 38 | ## License 39 | 40 | TYStatusBarView is available under the MIT license. See the LICENSE file for more info. 41 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/StatusBarView/StatusBarView.xcodeproj/xcshareddata/xcschemes/StatusBarView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/StatusBarView/StatusBarView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/StatusBarView/StatusBarView/StatusBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarView.h 3 | // StatusBarView 4 | // 5 | // Created by Ersen Tekin on 4.05.2020. 6 | // Copyright © 2020 Ersen Tekin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for StatusBarView. 12 | FOUNDATION_EXPORT double StatusBarViewVersionNumber; 13 | 14 | //! Project version string for StatusBarView. 15 | FOUNDATION_EXPORT const unsigned char StatusBarViewVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/StatusBarView/StatusBarViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /UILibraries/StatusBarView/StatusBarView/StatusBarViewTests/StatusBarViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarViewTests.swift 3 | // StatusBarViewTests 4 | // 5 | // Created by Ersen Tekin on 4.05.2020. 6 | // Copyright © 2020 Ersen Tekin. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import StatusBarView 11 | 12 | class StatusBarViewTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/Capitalized.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Capitalized.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @propertyWrapper 12 | struct Capitalized { 13 | var wrappedValue: String { 14 | didSet { wrappedValue = wrappedValue.capitalized } 15 | } 16 | 17 | init(wrappedValue: String) { 18 | self.wrappedValue = wrappedValue.capitalized 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/DefaultCodable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultCodable.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | public protocol DefaultCodableInterface { 10 | associatedtype RawValue: Codable 11 | 12 | static var defaultValue: RawValue { get } 13 | } 14 | 15 | @propertyWrapper 16 | public struct DefaultCodable: Codable { 17 | public var wrappedValue: T.RawValue 18 | 19 | public init(wrappedValue: T.RawValue) { 20 | self.wrappedValue = wrappedValue 21 | } 22 | 23 | public init(from decoder: Decoder) throws { 24 | let container = try decoder.singleValueContainer() 25 | self.wrappedValue = (try? container.decode(T.RawValue.self)) ?? T.defaultValue 26 | } 27 | 28 | public func encode(to encoder: Encoder) throws { 29 | try wrappedValue.encode(to: encoder) 30 | } 31 | } 32 | 33 | extension DefaultCodable: Equatable where T.RawValue: Equatable { } 34 | extension DefaultCodable: Hashable where T.RawValue: Hashable { } 35 | 36 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/DefaultEmptyArray.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultEmptyArray.swift 3 | // PropertyWrapper 4 | // 5 | // Created by Yusuf Özgül on 20.04.2021. 6 | // Copyright © 2021 Trendyol. All rights reserved. 7 | // 8 | 9 | public struct DefaultEmptyArray: DefaultCodableInterface { 10 | public static var defaultValue: [T] { return [] } 11 | } 12 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/DefaultFalse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultBool.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | public struct DefaultFalse: DefaultCodableInterface { 10 | public static var defaultValue: Bool { return false } 11 | } 12 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/DefaultTrue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultTrue.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | public struct DefaultTrue: DefaultCodableInterface { 10 | public static var defaultValue: Bool { return true } 11 | } 12 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/EnumDefaultValueSelectable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumDefaultValueSelectable.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | public protocol EnumDefaultValueSelectable: Codable & CaseIterable & RawRepresentable where RawValue: Decodable, AllCases: BidirectionalCollection { } 10 | 11 | public struct LastCase: DefaultCodableInterface where T: EnumDefaultValueSelectable { 12 | public static var defaultValue: T { T.allCases.last! } 13 | } 14 | 15 | public struct FirstCase: DefaultCodableInterface where T: EnumDefaultValueSelectable { 16 | public static var defaultValue: T { T.allCases.first! } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/Extension/KeyedDecodingContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyedDecodingContainer.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | public extension KeyedDecodingContainer { 10 | func decode(_: DefaultCodable.Type, forKey key: Key) throws -> DefaultCodable { 11 | if let value = try decodeIfPresent(DefaultCodable.self, forKey: key) { 12 | return value 13 | } else { 14 | return DefaultCodable(wrappedValue: T.defaultValue) 15 | } 16 | } 17 | 18 | func decode(_ type: StringOrInt.Type, forKey key: K) throws -> StringOrInt { 19 | if let value = try decodeIfPresent(type, forKey: key) { 20 | return value 21 | } 22 | return StringOrInt(wrappedValue: nil) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/StringOrInt.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringOrInt.swift 3 | // PropertyWrapper 4 | // 5 | // Created by Batuhan Saka on 22.09.2021. 6 | // Copyright © 2021 Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol ExpressibleByString { 12 | init(from stringValue: String) 13 | } 14 | 15 | extension String: ExpressibleByString { 16 | public init(from stringValue: String) { self = stringValue } 17 | } 18 | 19 | extension Optional: ExpressibleByString where Wrapped == String { 20 | public init(from stringValue: String) { self = stringValue } 21 | } 22 | 23 | @propertyWrapper 24 | public struct StringOrInt: Decodable { 25 | public var wrappedValue: T 26 | 27 | public init(wrappedValue: T) { 28 | self.wrappedValue = wrappedValue 29 | } 30 | 31 | public init(from decoder: Decoder) throws { 32 | let container = try decoder.singleValueContainer() 33 | if let integerValue = try? container.decode(Int.self) { 34 | wrappedValue = .init(from: String(integerValue)) 35 | } else { 36 | wrappedValue = try .init(from: container.decode(String.self)) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Classes/UserDefaults.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserDefaults.swift 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @propertyWrapper 12 | struct UserDefault { 13 | var key: String 14 | var initialValue: T 15 | var wrappedValue: T { 16 | set { UserDefaults.standard.set(newValue, forKey: key) } 17 | get { UserDefaults.standard.object(forKey: key) as? T ?? initialValue } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/PropertyWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // PropertyWrapper.h 3 | // PropertyWrapper 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for PropertyWrapper. 12 | FOUNDATION_EXPORT double PropertyWrapperVersionNumber; 13 | 14 | //! Project version string for PropertyWrapper. 15 | FOUNDATION_EXPORT const unsigned char PropertyWrapperVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapper/Resource/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapperTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapperTests/Responses/OrderResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Entity.swift 3 | // PropertyWrapperTests 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | @testable import PropertyWrapper 9 | 10 | struct OrderResponse: Codable { 11 | @DefaultCodable var status: OrderStatus 12 | @DefaultCodable var shouldShowOrderStatus: Bool 13 | } 14 | 15 | enum OrderStatus: String, EnumDefaultValueSelectable { 16 | case new, inProgress, shipped, canceled 17 | } 18 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapperTests/Responses/PaymentResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PaymentResponse.swift 3 | // PropertyWrapperTests 4 | // 5 | // Created by Batuhan Saka on 22.09.2021. 6 | // Copyright © 2021 Trendyol. All rights reserved. 7 | // 8 | 9 | import PropertyWrapper 10 | 11 | struct PaymentResponse: Decodable { 12 | let success: Bool 13 | @StringOrInt var orderId: String? 14 | } 15 | -------------------------------------------------------------------------------- /Utils/PropertyWrapper/PropertyWrapperTests/Responses/UserResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserResponse.swift 3 | // PropertyWrapperTests 4 | // 5 | // Created by aniltaskiran on 26.04.2020. 6 | // Copyright © 2020 Trendyol. All rights reserved. 7 | // 8 | @testable import PropertyWrapper 9 | 10 | enum UserType: String, EnumDefaultValueSelectable { 11 | case admin, user, none 12 | } 13 | 14 | struct UserResponse: Codable { 15 | @DefaultCodable var user: UserType 16 | @DefaultCodable var isAdmin: Bool 17 | @DefaultCodable var tags: [String] 18 | } 19 | -------------------------------------------------------------------------------- /channel-components.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /channel-components.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------