├── .gitignore ├── Demo ├── KSPhotoBrowserDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── KSPhotoBrowserDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── KSPhotoBrowserDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── 1024.png │ │ │ ├── 120.png │ │ │ ├── 180.png │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── KSDemoViewController.h │ ├── KSDemoViewController.m │ ├── KSPhotoCell.h │ ├── KSPhotoCell.m │ ├── KSPreviewViewController.h │ ├── KSPreviewViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ ├── KSPhotoBrowser │ │ │ ├── KSImageManagerProtocol.h │ │ │ ├── KSPhotoBrowser.h │ │ │ ├── KSPhotoItem.h │ │ │ ├── KSPhotoView.h │ │ │ ├── KSProgressLayer.h │ │ │ ├── KSSDImageManager.h │ │ │ └── UIImage+KS.h │ │ └── SDWebImage │ │ │ ├── NSButton+WebCache.h │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSImage+Compatibility.h │ │ │ ├── SDAnimatedImage.h │ │ │ ├── SDAnimatedImageRep.h │ │ │ ├── SDAnimatedImageView+WebCache.h │ │ │ ├── SDAnimatedImageView.h │ │ │ ├── SDAsyncBlockOperation.h │ │ │ ├── SDDiskCache.h │ │ │ ├── SDImageAPNGCoder.h │ │ │ ├── SDImageAssetManager.h │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDImageCacheDefine.h │ │ │ ├── SDImageCachesManager.h │ │ │ ├── SDImageCachesManagerOperation.h │ │ │ ├── SDImageCoder.h │ │ │ ├── SDImageCoderHelper.h │ │ │ ├── SDImageCodersManager.h │ │ │ ├── SDImageFrame.h │ │ │ ├── SDImageGIFCoder.h │ │ │ ├── SDImageGraphics.h │ │ │ ├── SDImageIOCoder.h │ │ │ ├── SDImageLoader.h │ │ │ ├── SDImageLoadersManager.h │ │ │ ├── SDImageTransformer.h │ │ │ ├── SDInternalMacros.h │ │ │ ├── SDMemoryCache.h │ │ │ ├── SDWeakProxy.h │ │ │ ├── SDWebImage.h │ │ │ ├── SDWebImageCacheKeyFilter.h │ │ │ ├── SDWebImageCacheSerializer.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageDefine.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloaderConfig.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageDownloaderRequestModifier.h │ │ │ ├── SDWebImageError.h │ │ │ ├── SDWebImageIndicator.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImageTransition.h │ │ │ ├── SDmetamacros.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+MemoryCacheCost.h │ │ │ ├── UIImage+Metadata.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImage+Transform.h │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIView+WebCache.h │ │ │ └── UIView+WebCacheOperation.h │ └── Public │ │ ├── KSPhotoBrowser │ │ ├── KSImageManagerProtocol.h │ │ ├── KSPhotoBrowser.h │ │ ├── KSPhotoItem.h │ │ ├── KSPhotoView.h │ │ ├── KSProgressLayer.h │ │ ├── KSSDImageManager.h │ │ └── UIImage+KS.h │ │ └── SDWebImage │ │ ├── NSButton+WebCache.h │ │ ├── NSData+ImageContentType.h │ │ ├── NSImage+Compatibility.h │ │ ├── SDAnimatedImage.h │ │ ├── SDAnimatedImageRep.h │ │ ├── SDAnimatedImageView+WebCache.h │ │ ├── SDAnimatedImageView.h │ │ ├── SDDiskCache.h │ │ ├── SDImageAPNGCoder.h │ │ ├── SDImageCache.h │ │ ├── SDImageCacheConfig.h │ │ ├── SDImageCacheDefine.h │ │ ├── SDImageCachesManager.h │ │ ├── SDImageCoder.h │ │ ├── SDImageCoderHelper.h │ │ ├── SDImageCodersManager.h │ │ ├── SDImageFrame.h │ │ ├── SDImageGIFCoder.h │ │ ├── SDImageGraphics.h │ │ ├── SDImageIOCoder.h │ │ ├── SDImageLoader.h │ │ ├── SDImageLoadersManager.h │ │ ├── SDImageTransformer.h │ │ ├── SDMemoryCache.h │ │ ├── SDWebImage.h │ │ ├── SDWebImageCacheKeyFilter.h │ │ ├── SDWebImageCacheSerializer.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDefine.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderConfig.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderRequestModifier.h │ │ ├── SDWebImageError.h │ │ ├── SDWebImageIndicator.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImageTransition.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MemoryCacheCost.h │ │ ├── UIImage+Metadata.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+Transform.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ ├── UIView+WebCache.h │ │ └── UIView+WebCacheOperation.h │ ├── Local Podspecs │ └── KSPhotoBrowser.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ └── project.pbxproj │ ├── SDWebImage │ ├── LICENSE │ ├── README.md │ ├── SDWebImage │ │ └── Private │ │ │ ├── SDAsyncBlockOperation.h │ │ │ ├── SDAsyncBlockOperation.m │ │ │ ├── SDImageAssetManager.h │ │ │ ├── SDImageAssetManager.m │ │ │ ├── SDImageCachesManagerOperation.h │ │ │ ├── SDImageCachesManagerOperation.m │ │ │ ├── SDInternalMacros.h │ │ │ ├── SDInternalMacros.m │ │ │ ├── SDWeakProxy.h │ │ │ ├── SDWeakProxy.m │ │ │ └── SDmetamacros.h │ └── WebImage │ │ └── SDWebImage.h │ └── Target Support Files │ ├── KSPhotoBrowser │ ├── KSPhotoBrowser-dummy.m │ ├── KSPhotoBrowser-prefix.pch │ └── KSPhotoBrowser.xcconfig │ ├── Pods-KSPhotoBrowserDemo │ ├── Pods-KSPhotoBrowserDemo-acknowledgements.markdown │ ├── Pods-KSPhotoBrowserDemo-acknowledgements.plist │ ├── Pods-KSPhotoBrowserDemo-dummy.m │ ├── Pods-KSPhotoBrowserDemo-frameworks.sh │ ├── Pods-KSPhotoBrowserDemo-resources.sh │ ├── Pods-KSPhotoBrowserDemo.debug.xcconfig │ └── Pods-KSPhotoBrowserDemo.release.xcconfig │ └── SDWebImage │ ├── SDWebImage-dummy.m │ ├── SDWebImage-prefix.pch │ └── SDWebImage.xcconfig ├── Images ├── Blur.gif ├── Corner.gif ├── Index.png ├── Orientation.gif ├── Rotation.gif └── Scale.gif ├── KSPhotoBrowser.podspec ├── KSPhotoBrowser ├── KSImageManagerProtocol.h ├── KSPhotoBrowser.h ├── KSPhotoBrowser.m ├── KSPhotoItem.h ├── KSPhotoItem.m ├── KSPhotoView.h ├── KSPhotoView.m ├── KSProgressLayer.h ├── KSProgressLayer.m ├── KSSDImageManager.h ├── KSSDImageManager.m ├── UIImage+KS.h └── UIImage+KS.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 27B963971E1BACE600F32BAE /* KSDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B963941E1BACE600F32BAE /* KSDemoViewController.m */; }; 11 | 27B963981E1BACE600F32BAE /* KSPreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B963961E1BACE600F32BAE /* KSPreviewViewController.m */; }; 12 | 27F977221E1B933C00AFB315 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F977211E1B933C00AFB315 /* main.m */; }; 13 | 27F977251E1B933C00AFB315 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F977241E1B933C00AFB315 /* AppDelegate.m */; }; 14 | 27F9772B1E1B933C00AFB315 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27F977291E1B933C00AFB315 /* Main.storyboard */; }; 15 | 27F9772D1E1B933C00AFB315 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27F9772C1E1B933C00AFB315 /* Assets.xcassets */; }; 16 | 27F977301E1B933C00AFB315 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27F9772E1E1B933C00AFB315 /* LaunchScreen.storyboard */; }; 17 | 4DF3A413939562BF8A40603C /* libPods-KSPhotoBrowserDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 600B0C255336BD7C62D18A2E /* libPods-KSPhotoBrowserDemo.a */; }; 18 | F7F281321EB45F8E000C5561 /* KSPhotoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F281311EB45F8E000C5561 /* KSPhotoCell.m */; }; 19 | F7F2818A1EB6E3F5000C5561 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281891EB6E3F5000C5561 /* UIKit.framework */; }; 20 | F7F2818C1EB6E3FE000C5561 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F2818B1EB6E3FE000C5561 /* CoreFoundation.framework */; }; 21 | F7F2818E1EB6E405000C5561 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F2818D1EB6E405000C5561 /* QuartzCore.framework */; }; 22 | F7F281901EB6E40B000C5561 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F2818F1EB6E40B000C5561 /* AssetsLibrary.framework */; }; 23 | F7F281921EB6E412000C5561 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281911EB6E412000C5561 /* ImageIO.framework */; }; 24 | F7F281941EB6E418000C5561 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281931EB6E418000C5561 /* Accelerate.framework */; }; 25 | F7F281961EB6E41F000C5561 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281951EB6E41F000C5561 /* MobileCoreServices.framework */; }; 26 | F7F281981EB6E429000C5561 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281971EB6E429000C5561 /* libsqlite3.tbd */; }; 27 | F7F2819A1EB6E42F000C5561 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F7F281991EB6E42F000C5561 /* libz.tbd */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 27B963931E1BACE600F32BAE /* KSDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSDemoViewController.h; sourceTree = ""; }; 32 | 27B963941E1BACE600F32BAE /* KSDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSDemoViewController.m; sourceTree = ""; }; 33 | 27B963951E1BACE600F32BAE /* KSPreviewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSPreviewViewController.h; sourceTree = ""; }; 34 | 27B963961E1BACE600F32BAE /* KSPreviewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSPreviewViewController.m; sourceTree = ""; }; 35 | 27F9771D1E1B933C00AFB315 /* KSPhotoBrowserDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KSPhotoBrowserDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 27F977211E1B933C00AFB315 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | 27F977231E1B933C00AFB315 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 38 | 27F977241E1B933C00AFB315 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 39 | 27F9772A1E1B933C00AFB315 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 27F9772C1E1B933C00AFB315 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 41 | 27F9772F1E1B933C00AFB315 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 42 | 27F977311E1B933C00AFB315 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 600B0C255336BD7C62D18A2E /* libPods-KSPhotoBrowserDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-KSPhotoBrowserDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 7DB0997989D2CDB9B974C2FA /* Pods-KSPhotoBrowserDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KSPhotoBrowserDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo.release.xcconfig"; sourceTree = ""; }; 45 | 87AB18B986ED633B11439023 /* Pods-KSPhotoBrowserDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KSPhotoBrowserDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo.debug.xcconfig"; sourceTree = ""; }; 46 | F7F281301EB45F8E000C5561 /* KSPhotoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSPhotoCell.h; sourceTree = ""; }; 47 | F7F281311EB45F8E000C5561 /* KSPhotoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSPhotoCell.m; sourceTree = ""; }; 48 | F7F281891EB6E3F5000C5561 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 49 | F7F2818B1EB6E3FE000C5561 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 50 | F7F2818D1EB6E405000C5561 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 51 | F7F2818F1EB6E40B000C5561 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 52 | F7F281911EB6E412000C5561 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; 53 | F7F281931EB6E418000C5561 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 54 | F7F281951EB6E41F000C5561 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 55 | F7F281971EB6E429000C5561 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 56 | F7F281991EB6E42F000C5561 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 27F9771A1E1B933C00AFB315 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | F7F2819A1EB6E42F000C5561 /* libz.tbd in Frameworks */, 65 | F7F281981EB6E429000C5561 /* libsqlite3.tbd in Frameworks */, 66 | F7F281961EB6E41F000C5561 /* MobileCoreServices.framework in Frameworks */, 67 | F7F281941EB6E418000C5561 /* Accelerate.framework in Frameworks */, 68 | F7F281921EB6E412000C5561 /* ImageIO.framework in Frameworks */, 69 | F7F281901EB6E40B000C5561 /* AssetsLibrary.framework in Frameworks */, 70 | F7F2818E1EB6E405000C5561 /* QuartzCore.framework in Frameworks */, 71 | F7F2818C1EB6E3FE000C5561 /* CoreFoundation.framework in Frameworks */, 72 | F7F2818A1EB6E3F5000C5561 /* UIKit.framework in Frameworks */, 73 | 4DF3A413939562BF8A40603C /* libPods-KSPhotoBrowserDemo.a in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 27F977141E1B933C00AFB315 = { 81 | isa = PBXGroup; 82 | children = ( 83 | 27F9771F1E1B933C00AFB315 /* KSPhotoBrowserDemo */, 84 | 27F9771E1E1B933C00AFB315 /* Products */, 85 | 4B64BE3206B6C2C961E856D4 /* Frameworks */, 86 | E2546C07CAAEFD3DEF3BF855 /* Pods */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 27F9771E1E1B933C00AFB315 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 27F9771D1E1B933C00AFB315 /* KSPhotoBrowserDemo.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 27F9771F1E1B933C00AFB315 /* KSPhotoBrowserDemo */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 27F977231E1B933C00AFB315 /* AppDelegate.h */, 102 | 27F977241E1B933C00AFB315 /* AppDelegate.m */, 103 | 27B963931E1BACE600F32BAE /* KSDemoViewController.h */, 104 | 27B963941E1BACE600F32BAE /* KSDemoViewController.m */, 105 | 27B963951E1BACE600F32BAE /* KSPreviewViewController.h */, 106 | 27B963961E1BACE600F32BAE /* KSPreviewViewController.m */, 107 | F7F281301EB45F8E000C5561 /* KSPhotoCell.h */, 108 | F7F281311EB45F8E000C5561 /* KSPhotoCell.m */, 109 | 27F977291E1B933C00AFB315 /* Main.storyboard */, 110 | 27F9772C1E1B933C00AFB315 /* Assets.xcassets */, 111 | 27F9772E1E1B933C00AFB315 /* LaunchScreen.storyboard */, 112 | 27F977311E1B933C00AFB315 /* Info.plist */, 113 | 27F977201E1B933C00AFB315 /* Supporting Files */, 114 | ); 115 | path = KSPhotoBrowserDemo; 116 | sourceTree = ""; 117 | }; 118 | 27F977201E1B933C00AFB315 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 27F977211E1B933C00AFB315 /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | 4B64BE3206B6C2C961E856D4 /* Frameworks */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | F7F281991EB6E42F000C5561 /* libz.tbd */, 130 | F7F281971EB6E429000C5561 /* libsqlite3.tbd */, 131 | F7F281951EB6E41F000C5561 /* MobileCoreServices.framework */, 132 | F7F281931EB6E418000C5561 /* Accelerate.framework */, 133 | F7F281911EB6E412000C5561 /* ImageIO.framework */, 134 | F7F2818F1EB6E40B000C5561 /* AssetsLibrary.framework */, 135 | F7F2818D1EB6E405000C5561 /* QuartzCore.framework */, 136 | F7F2818B1EB6E3FE000C5561 /* CoreFoundation.framework */, 137 | F7F281891EB6E3F5000C5561 /* UIKit.framework */, 138 | 600B0C255336BD7C62D18A2E /* libPods-KSPhotoBrowserDemo.a */, 139 | ); 140 | name = Frameworks; 141 | sourceTree = ""; 142 | }; 143 | E2546C07CAAEFD3DEF3BF855 /* Pods */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 87AB18B986ED633B11439023 /* Pods-KSPhotoBrowserDemo.debug.xcconfig */, 147 | 7DB0997989D2CDB9B974C2FA /* Pods-KSPhotoBrowserDemo.release.xcconfig */, 148 | ); 149 | name = Pods; 150 | sourceTree = ""; 151 | }; 152 | /* End PBXGroup section */ 153 | 154 | /* Begin PBXNativeTarget section */ 155 | 27F9771C1E1B933C00AFB315 /* KSPhotoBrowserDemo */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 27F977341E1B933C00AFB315 /* Build configuration list for PBXNativeTarget "KSPhotoBrowserDemo" */; 158 | buildPhases = ( 159 | 45C69FD0896EBE3C7FCA7ED3 /* [CP] Check Pods Manifest.lock */, 160 | 27F977191E1B933C00AFB315 /* Sources */, 161 | 27F9771A1E1B933C00AFB315 /* Frameworks */, 162 | 27F9771B1E1B933C00AFB315 /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = KSPhotoBrowserDemo; 169 | productName = KSPhotoBrowserDemo; 170 | productReference = 27F9771D1E1B933C00AFB315 /* KSPhotoBrowserDemo.app */; 171 | productType = "com.apple.product-type.application"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | 27F977151E1B933C00AFB315 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0920; 180 | ORGANIZATIONNAME = "Kyle Sun"; 181 | TargetAttributes = { 182 | 27F9771C1E1B933C00AFB315 = { 183 | CreatedOnToolsVersion = 8.2; 184 | DevelopmentTeam = N2EGGRKXKW; 185 | ProvisioningStyle = Automatic; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 27F977181E1B933C00AFB315 /* Build configuration list for PBXProject "KSPhotoBrowserDemo" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | English, 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 27F977141E1B933C00AFB315; 199 | productRefGroup = 27F9771E1E1B933C00AFB315 /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 27F9771C1E1B933C00AFB315 /* KSPhotoBrowserDemo */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 27F9771B1E1B933C00AFB315 /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 27F977301E1B933C00AFB315 /* LaunchScreen.storyboard in Resources */, 214 | 27F9772D1E1B933C00AFB315 /* Assets.xcassets in Resources */, 215 | 27F9772B1E1B933C00AFB315 /* Main.storyboard in Resources */, 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXResourcesBuildPhase section */ 220 | 221 | /* Begin PBXShellScriptBuildPhase section */ 222 | 45C69FD0896EBE3C7FCA7ED3 /* [CP] Check Pods Manifest.lock */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 229 | "${PODS_ROOT}/Manifest.lock", 230 | ); 231 | name = "[CP] Check Pods Manifest.lock"; 232 | outputPaths = ( 233 | "$(DERIVED_FILE_DIR)/Pods-KSPhotoBrowserDemo-checkManifestLockResult.txt", 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | shellPath = /bin/sh; 237 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 238 | showEnvVarsInLog = 0; 239 | }; 240 | /* End PBXShellScriptBuildPhase section */ 241 | 242 | /* Begin PBXSourcesBuildPhase section */ 243 | 27F977191E1B933C00AFB315 /* Sources */ = { 244 | isa = PBXSourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 27B963971E1BACE600F32BAE /* KSDemoViewController.m in Sources */, 248 | 27F977251E1B933C00AFB315 /* AppDelegate.m in Sources */, 249 | 27F977221E1B933C00AFB315 /* main.m in Sources */, 250 | 27B963981E1BACE600F32BAE /* KSPreviewViewController.m in Sources */, 251 | F7F281321EB45F8E000C5561 /* KSPhotoCell.m in Sources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | /* End PBXSourcesBuildPhase section */ 256 | 257 | /* Begin PBXVariantGroup section */ 258 | 27F977291E1B933C00AFB315 /* Main.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | 27F9772A1E1B933C00AFB315 /* Base */, 262 | ); 263 | name = Main.storyboard; 264 | sourceTree = ""; 265 | }; 266 | 27F9772E1E1B933C00AFB315 /* LaunchScreen.storyboard */ = { 267 | isa = PBXVariantGroup; 268 | children = ( 269 | 27F9772F1E1B933C00AFB315 /* Base */, 270 | ); 271 | name = LaunchScreen.storyboard; 272 | sourceTree = ""; 273 | }; 274 | /* End PBXVariantGroup section */ 275 | 276 | /* Begin XCBuildConfiguration section */ 277 | 27F977321E1B933C00AFB315 /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_NONNULL = YES; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_MODULES = YES; 285 | CLANG_ENABLE_OBJC_ARC = YES; 286 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 287 | CLANG_WARN_BOOL_CONVERSION = YES; 288 | CLANG_WARN_COMMA = YES; 289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 292 | CLANG_WARN_EMPTY_BODY = YES; 293 | CLANG_WARN_ENUM_CONVERSION = YES; 294 | CLANG_WARN_INFINITE_RECURSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 297 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 298 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 299 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 300 | CLANG_WARN_STRICT_PROTOTYPES = YES; 301 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 302 | CLANG_WARN_UNREACHABLE_CODE = YES; 303 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 304 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 305 | COPY_PHASE_STRIP = NO; 306 | DEBUG_INFORMATION_FORMAT = dwarf; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | ENABLE_TESTABILITY = YES; 309 | GCC_C_LANGUAGE_STANDARD = gnu99; 310 | GCC_DYNAMIC_NO_PIC = NO; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_OPTIMIZATION_LEVEL = 0; 313 | GCC_PREPROCESSOR_DEFINITIONS = ( 314 | "DEBUG=1", 315 | "$(inherited)", 316 | ); 317 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 318 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 319 | GCC_WARN_UNDECLARED_SELECTOR = YES; 320 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 321 | GCC_WARN_UNUSED_FUNCTION = YES; 322 | GCC_WARN_UNUSED_VARIABLE = YES; 323 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 324 | MTL_ENABLE_DEBUG_INFO = YES; 325 | ONLY_ACTIVE_ARCH = YES; 326 | SDKROOT = iphoneos; 327 | }; 328 | name = Debug; 329 | }; 330 | 27F977331E1B933C00AFB315 /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_ANALYZER_NONNULL = YES; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_COMMA = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 344 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 345 | CLANG_WARN_EMPTY_BODY = YES; 346 | CLANG_WARN_ENUM_CONVERSION = YES; 347 | CLANG_WARN_INFINITE_RECURSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 353 | CLANG_WARN_STRICT_PROTOTYPES = YES; 354 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 355 | CLANG_WARN_UNREACHABLE_CODE = YES; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 360 | ENABLE_NS_ASSERTIONS = NO; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 371 | MTL_ENABLE_DEBUG_INFO = NO; 372 | SDKROOT = iphoneos; 373 | VALIDATE_PRODUCT = YES; 374 | }; 375 | name = Release; 376 | }; 377 | 27F977351E1B933C00AFB315 /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | baseConfigurationReference = 87AB18B986ED633B11439023 /* Pods-KSPhotoBrowserDemo.debug.xcconfig */; 380 | buildSettings = { 381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 382 | DEVELOPMENT_TEAM = N2EGGRKXKW; 383 | INFOPLIST_FILE = KSPhotoBrowserDemo/Info.plist; 384 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_BUNDLE_IDENTIFIER = com.skx926.KSPhotoBrowserDemo1; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | TARGETED_DEVICE_FAMILY = "1,2"; 389 | }; 390 | name = Debug; 391 | }; 392 | 27F977361E1B933C00AFB315 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | baseConfigurationReference = 7DB0997989D2CDB9B974C2FA /* Pods-KSPhotoBrowserDemo.release.xcconfig */; 395 | buildSettings = { 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | DEVELOPMENT_TEAM = N2EGGRKXKW; 398 | INFOPLIST_FILE = KSPhotoBrowserDemo/Info.plist; 399 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 400 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 401 | PRODUCT_BUNDLE_IDENTIFIER = com.skx926.KSPhotoBrowserDemo1; 402 | PRODUCT_NAME = "$(TARGET_NAME)"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | }; 405 | name = Release; 406 | }; 407 | /* End XCBuildConfiguration section */ 408 | 409 | /* Begin XCConfigurationList section */ 410 | 27F977181E1B933C00AFB315 /* Build configuration list for PBXProject "KSPhotoBrowserDemo" */ = { 411 | isa = XCConfigurationList; 412 | buildConfigurations = ( 413 | 27F977321E1B933C00AFB315 /* Debug */, 414 | 27F977331E1B933C00AFB315 /* Release */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | 27F977341E1B933C00AFB315 /* Build configuration list for PBXNativeTarget "KSPhotoBrowserDemo" */ = { 420 | isa = XCConfigurationList; 421 | buildConfigurations = ( 422 | 27F977351E1B933C00AFB315 /* Debug */, 423 | 27F977361E1B933C00AFB315 /* Release */, 424 | ); 425 | defaultConfigurationIsVisible = 0; 426 | defaultConfigurationName = Release; 427 | }; 428 | /* End XCConfigurationList section */ 429 | }; 430 | rootObject = 27F977151E1B933C00AFB315 /* Project object */; 431 | } 432 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 03/01/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 03/01/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Demo/KSPhotoBrowserDemo/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/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 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "120.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "180.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "1024x1024", 47 | "idiom" : "ios-marketing", 48 | "filename" : "1024.png", 49 | "scale" : "1x" 50 | } 51 | ], 52 | "info" : { 53 | "version" : 1, 54 | "author" : "xcode" 55 | } 56 | } -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/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 | 27 | 28 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/Base.lproj/Main.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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | NSPhotoLibraryAddUsageDescription 29 | Allows KSPhotoBrowser save images into your photo library. 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiresFullScreen 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemoViewController.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 30/12/2016. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KSDemoViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSDemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSDemoViewController.m 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 30/12/2016. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSDemoViewController.h" 10 | #import "KSPreviewViewController.h" 11 | #import "SDWebImageManager.h" 12 | 13 | @interface KSDemoViewController () 14 | 15 | @property (weak, nonatomic) IBOutlet UISegmentedControl *dismissalSegementedControl; 16 | @property (weak, nonatomic) IBOutlet UISegmentedControl *backgroundSegementedControl; 17 | @property (weak, nonatomic) IBOutlet UISegmentedControl *pageSegementedControl; 18 | @property (weak, nonatomic) IBOutlet UISegmentedControl *loadingSegementedControl; 19 | @property (weak, nonatomic) IBOutlet UISwitch *bouncesSwitch; 20 | 21 | @end 22 | 23 | @implementation KSDemoViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do any additional setup after loading the view. 28 | [UIApplication sharedApplication].keyWindow.tintColor = UIColor.blackColor; 29 | } 30 | 31 | - (void)didReceiveMemoryWarning { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 38 | // Get the new view controller using [segue destinationViewController]. 39 | // Pass the selected object to the new view controller. 40 | KSPreviewViewController *preview = [segue destinationViewController]; 41 | preview.dismissalStyle = _dismissalSegementedControl.selectedSegmentIndex; 42 | preview.backgroundStyle = _backgroundSegementedControl.selectedSegmentIndex; 43 | preview.pageindicatorStyle = _pageSegementedControl.selectedSegmentIndex; 44 | preview.loadingStyle = _loadingSegementedControl.selectedSegmentIndex; 45 | preview.bounces = _bouncesSwitch.on; 46 | } 47 | 48 | // MARK: - TableViewDelegate 49 | 50 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 51 | if (indexPath.section == 6) { 52 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 53 | [[SDWebImageManager sharedManager].imageCache clearWithCacheType:SDImageCacheTypeAll completion:nil]; 54 | } 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSPhotoCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoCell.h 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 2017/4/29. 6 | // Copyright © 2017年 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, KSPhotoCellType) { 12 | KSPhotoCellTypeRect, 13 | KSPhotoCellTypeRoundedRect, 14 | KSPhotoCellTypeCircular 15 | }; 16 | @interface KSPhotoCell : UICollectionViewCell 17 | 18 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 19 | @property (nonatomic, assign) KSPhotoCellType type; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSPhotoCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoCell.m 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 2017/4/29. 6 | // Copyright © 2017年 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSPhotoCell.h" 10 | 11 | @implementation KSPhotoCell 12 | 13 | - (void)layoutSubviews { 14 | [super layoutSubviews]; 15 | 16 | if (self.type == KSPhotoCellTypeRect) { 17 | self.imageView.layer.cornerRadius = 0; 18 | } else if (self.type == KSPhotoCellTypeCircular) { 19 | self.imageView.layer.cornerRadius = self.imageView.frame.size.width / 2; 20 | } else if (self.type == KSPhotoCellTypeRoundedRect) { 21 | self.imageView.layer.cornerRadius = self.imageView.frame.size.width / 4; 22 | } 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSPreviewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KSPhotoBrowser.h" 11 | 12 | typedef NS_ENUM(NSInteger, KSImageManagerType) { 13 | KSImageManagerTypeYYWebImage, 14 | KSImageManagerTypeSDWebImage 15 | }; 16 | 17 | @interface KSPreviewViewController : UIViewController 18 | 19 | @property (nonatomic, assign) KSPhotoBrowserInteractiveDismissalStyle dismissalStyle; 20 | @property (nonatomic, assign) KSPhotoBrowserBackgroundStyle backgroundStyle; 21 | @property (nonatomic, assign) KSPhotoBrowserPageIndicatorStyle pageindicatorStyle; 22 | @property (nonatomic, assign) KSPhotoBrowserImageLoadingStyle loadingStyle; 23 | @property (nonatomic, assign) BOOL bounces; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/KSPreviewViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSPreviewViewController.h" 10 | #import "KSPhotoCell.h" 11 | #import 12 | #import 13 | #import 14 | 15 | static NSString * const kAvatarUrl = @"https://tvax2.sinaimg.cn/crop.0.0.750.750.180/a15bd3a5ly8fqkp954lyyj20ku0kugn1.jpg"; 16 | 17 | @interface KSPreviewViewController () 18 | 19 | @property (nonatomic, strong) NSMutableArray *urls; 20 | @property (weak, nonatomic) IBOutlet UICollectionView *collectionView; 21 | @property (nonatomic, strong) NSArray *items; 22 | 23 | @end 24 | 25 | @implementation KSPreviewViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view, typically from a nib. 30 | NSArray *urls = @[ 31 | @"http://ww2.sinaimg.cn/thumbnail/642beb18gw1ep3629gfm0g206o050b2a.gif", 32 | @"http://ww4.sinaimg.cn/thumbnail/9e9cb0c9jw1ep7nlyu8waj20c80kptae.jpg", 33 | @"http://ww3.sinaimg.cn/thumbnail/8e88b0c1gw1e9lpr1xydcj20gy0o9q6s.jpg", 34 | @"http://ww2.sinaimg.cn/thumbnail/8e88b0c1gw1e9lpr2n1jjj20gy0o9tcc.jpg", 35 | @"http://ww4.sinaimg.cn/thumbnail/8e88b0c1gw1e9lpr4nndfj20gy0o9q6i.jpg", 36 | @"http://ww3.sinaimg.cn/thumbnail/8e88b0c1gw1e9lpr57tn9j20gy0obn0f.jpg", 37 | @"http://ww2.sinaimg.cn/thumbnail/677febf5gw1erma104rhyj20k03dz16y.jpg", 38 | @"http://ww4.sinaimg.cn/thumbnail/677febf5gw1erma1g5xd0j20k0esa7wj.jpg", 39 | @"http://ww4.sinaimg.cn/thumbnail/a15bd3a5jw1f12r9ku6wjj20u00mhn22.jpg", 40 | @"http://ww2.sinaimg.cn/thumbnail/a15bd3a5jw1f01hkxyjhej20u00jzacj.jpg", 41 | @"http://ww4.sinaimg.cn/thumbnail/a15bd3a5jw1f01hhs2omoj20u00jzwh9.jpg", 42 | @"http://ww2.sinaimg.cn/thumbnail/a15bd3a5jw1ey1oyiyut7j20u00mi0vb.jpg", 43 | @"http://ww2.sinaimg.cn/thumbnail/a15bd3a5jw1exkkw984e3j20u00miacm.jpg", 44 | @"http://ww4.sinaimg.cn/thumbnail/a15bd3a5jw1ezvdc5dt1pj20ku0kujt7.jpg", 45 | @"http://ww3.sinaimg.cn/thumbnail/a15bd3a5jw1ew68tajal7j20u011iacr.jpg", 46 | @"http://ww2.sinaimg.cn/thumbnail/a15bd3a5jw1eupveeuzajj20hs0hs75d.jpg", 47 | @"http://ww2.sinaimg.cn/thumbnail/d8937438gw1fb69b0hf5fj20hu13fjxj.jpg", 48 | ]; 49 | _urls = @[].mutableCopy; 50 | for (int i = 0; i < 10; i++) { 51 | [_urls addObjectsFromArray:urls]; 52 | } 53 | KSPhotoBrowser.imageViewBackgroundColor = UIColor.cyanColor; 54 | } 55 | 56 | - (void)didReceiveMemoryWarning { 57 | [super didReceiveMemoryWarning]; 58 | // Dispose of any resources that can be recreated. 59 | } 60 | 61 | - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { 62 | if (self.presentedViewController) { 63 | [coordinator animateAlongsideTransition:nil completion:^(id _Nonnull context) { 64 | int i = 0; 65 | for (KSPhotoItem *item in self.items) { 66 | KSPhotoCell *cell = (KSPhotoCell *)[self.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:i++ inSection:0]]; 67 | item.sourceView = cell.imageView; 68 | } 69 | }]; 70 | } 71 | } 72 | 73 | - (void)showBrowserWithPhotoItems:(NSArray *)items selectedIndex:(NSUInteger)selectedIndex { 74 | self.items = items; 75 | KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:selectedIndex]; 76 | browser.delegate = self; 77 | browser.dismissalStyle = _dismissalStyle; 78 | browser.backgroundStyle = _backgroundStyle; 79 | browser.loadingStyle = _loadingStyle; 80 | browser.pageindicatorStyle = _pageindicatorStyle; 81 | browser.bounces = _bounces; 82 | [browser showFromViewController:self]; 83 | } 84 | 85 | // MARK: - KSPhotoBrowserDelegate 86 | 87 | - (void)ks_photoBrowser:(KSPhotoBrowser *)browser didSelectItem:(KSPhotoItem *)item atIndex:(NSUInteger)index { 88 | NSLog(@"selected index: %ld", index); 89 | } 90 | 91 | //- (void)ks_photoBrowser:(KSPhotoBrowser *)browser didLongPressItem:(KSPhotoItem *)item atIndex:(NSUInteger)index { 92 | // UIImage *image = [browser imageForItem:item]; 93 | // NSLog(@"long pressed image:%@", image); 94 | //} 95 | 96 | // MARK: - CollectionViewDataSource 97 | 98 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 99 | return _urls.count; 100 | } 101 | 102 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 103 | KSPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"PhotoCell" forIndexPath:indexPath]; 104 | 105 | NSString *url = _urls[indexPath.row]; 106 | [cell.imageView sd_setImageWithURL:[NSURL URLWithString:url]]; 107 | if (indexPath.item % 3 == 0) { 108 | cell.type = KSPhotoCellTypeRect; 109 | } else if (indexPath.item % 3 == 1) { 110 | cell.type = KSPhotoCellTypeRoundedRect; 111 | } else { 112 | cell.type = KSPhotoCellTypeCircular; 113 | } 114 | return cell; 115 | } 116 | 117 | // MARK: - CollectionViewDelegate 118 | 119 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 120 | NSMutableArray *items = @[].mutableCopy; 121 | for (int i = 0; i < _urls.count; i++) { 122 | KSPhotoCell *cell = (KSPhotoCell *)[collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; 123 | NSString *url = [_urls[i] stringByReplacingOccurrencesOfString:@"thumbnail" withString:@"bmiddle"]; 124 | KSPhotoItem *item = [KSPhotoItem itemWithSourceView:cell.imageView imageUrl:[NSURL URLWithString:url]]; 125 | [items addObject:item]; 126 | } 127 | [self showBrowserWithPhotoItems:items selectedIndex:indexPath.item]; 128 | } 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /Demo/KSPhotoBrowserDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 03/01/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demo/Podfile: -------------------------------------------------------------------------------- 1 | 2 | platform :ios, '8.0' 3 | 4 | def all_pods 5 | pod 'KSPhotoBrowser', :path => '../' 6 | end 7 | 8 | target "KSPhotoBrowserDemo" do 9 | all_pods 10 | end 11 | -------------------------------------------------------------------------------- /Demo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - KSPhotoBrowser (0.3.1): 3 | - SDWebImage (~> 5.0) 4 | - SDWebImage (5.9.2): 5 | - SDWebImage/Core (= 5.9.2) 6 | - SDWebImage/Core (5.9.2) 7 | 8 | DEPENDENCIES: 9 | - KSPhotoBrowser (from `../`) 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - SDWebImage 14 | 15 | EXTERNAL SOURCES: 16 | KSPhotoBrowser: 17 | :path: "../" 18 | 19 | SPEC CHECKSUMS: 20 | KSPhotoBrowser: 61059046ffdc6d8c47bc0a4ae4b5fef6395f7b53 21 | SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb 22 | 23 | PODFILE CHECKSUM: 554f70c03ecd528e74dcc6fba4777d8e65be64de 24 | 25 | COCOAPODS: 1.7.5 26 | -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSImageManagerProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSImageManagerProtocol.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoBrowser.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSPhotoItem.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoItem.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSPhotoView.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSProgressLayer.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSProgressLayer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/KSSDImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSSDImageManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/KSPhotoBrowser/UIImage+KS.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/UIImage+KS.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSButton+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/NSImage+Compatibility.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSImage+Compatibility.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDAnimatedImage.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDAnimatedImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDAsyncBlockOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDDiskCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDDiskCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageAPNGCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageAPNGCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageAssetManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDImageAssetManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCacheDefine.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCacheDefine.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCachesManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCachesManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCachesManagerOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCoderHelper.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCodersManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageFrame.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageGIFCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageGraphics.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageGraphics.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageIOCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageLoader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageLoader.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageLoadersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageLoadersManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDImageTransformer.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageTransformer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDInternalMacros.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDInternalMacros.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDMemoryCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDMemoryCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWeakProxy.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDWeakProxy.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/WebImage/SDWebImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageCacheKeyFilter.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageCacheSerializer.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCompat.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageDefine.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDefine.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderRequestModifier.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageError.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageError.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageIndicator.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageIndicator.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageTransition.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/SDmetamacros.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Private/SDmetamacros.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIButton+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+GIF.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+MemoryCacheCost.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+Metadata.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+Metadata.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImage+Transform.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+Transform.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSImageManagerProtocol.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSImageManagerProtocol.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoBrowser.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSPhotoItem.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoItem.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSPhotoView.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSPhotoView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSProgressLayer.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSProgressLayer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/KSSDImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/KSSDImageManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/KSPhotoBrowser/UIImage+KS.h: -------------------------------------------------------------------------------- 1 | ../../../../../KSPhotoBrowser/UIImage+KS.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSButton+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/NSImage+Compatibility.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/NSImage+Compatibility.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDAnimatedImage.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDAnimatedImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDAnimatedImageView.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDDiskCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDDiskCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageAPNGCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageAPNGCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCacheDefine.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCacheDefine.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCachesManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCachesManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCoderHelper.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageCodersManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageFrame.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageGIFCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageGraphics.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageGraphics.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageIOCoder.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageLoader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageLoader.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageLoadersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageLoadersManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDImageTransformer.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDImageTransformer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDMemoryCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDMemoryCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/WebImage/SDWebImage.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageCacheKeyFilter.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageCacheSerializer.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageCompat.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageDefine.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDefine.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderRequestModifier.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageError.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageError.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageIndicator.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageIndicator.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageManager.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/SDWebImageTransition.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIButton+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+GIF.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+MemoryCacheCost.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+Metadata.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+Metadata.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImage+Transform.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImage+Transform.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIView+WebCache.h -------------------------------------------------------------------------------- /Demo/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Demo/Pods/Local Podspecs/KSPhotoBrowser.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "KSPhotoBrowser", 3 | "version": "0.3.1", 4 | "summary": "A beautiful photo browser with interactive dismissal animation.", 5 | "homepage": "https://github.com/skx926/KSPhotoBrowser", 6 | "license": "MIT", 7 | "authors": { 8 | "Kyle Sun": "skx926@gmail.com" 9 | }, 10 | "social_media_url": "https://twitter.com/skx926", 11 | "platforms": { 12 | "ios": "8.0" 13 | }, 14 | "source": { 15 | "git": "https://github.com/skx926/KSPhotoBrowser.git", 16 | "tag": "0.3.1" 17 | }, 18 | "source_files": [ 19 | "KSPhotoBrowser", 20 | "KSPhotoBrowser/**/*.{h,m}" 21 | ], 22 | "frameworks": "UIKit", 23 | "dependencies": { 24 | "SDWebImage": [ 25 | "~> 5.0" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Demo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - KSPhotoBrowser (0.3.1): 3 | - SDWebImage (~> 5.0) 4 | - SDWebImage (5.9.2): 5 | - SDWebImage/Core (= 5.9.2) 6 | - SDWebImage/Core (5.9.2) 7 | 8 | DEPENDENCIES: 9 | - KSPhotoBrowser (from `../`) 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - SDWebImage 14 | 15 | EXTERNAL SOURCES: 16 | KSPhotoBrowser: 17 | :path: "../" 18 | 19 | SPEC CHECKSUMS: 20 | KSPhotoBrowser: 61059046ffdc6d8c47bc0a4ae4b5fef6395f7b53 21 | SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb 22 | 23 | PODFILE CHECKSUM: 554f70c03ecd528e74dcc6fba4777d8e65be64de 24 | 25 | COCOAPODS: 1.7.5 26 | -------------------------------------------------------------------------------- /Demo/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2020 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 | -------------------------------------------------------------------------------- /Demo/Pods/SDWebImage/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | 6 | [![Build Status](http://img.shields.io/travis/SDWebImage/SDWebImage/master.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImage) 7 | [![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) 8 | [![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) 9 | [![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) 10 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/SDWebImage/SDWebImage) 11 | [![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager/) 12 | [![Mac Catalyst compatible](https://img.shields.io/badge/Catalyst-compatible-brightgreen.svg)](https://developer.apple.com/documentation/xcode/creating_a_mac_version_of_your_ipad_app/) 13 | [![codecov](https://codecov.io/gh/SDWebImage/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImage) 14 | 15 | This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like `UIImageView`, `UIButton`, `MKAnnotationView`. 16 | 17 | ## Features 18 | 19 | - [x] Categories for `UIImageView`, `UIButton`, `MKAnnotationView` adding web image and cache management 20 | - [x] An asynchronous image downloader 21 | - [x] An asynchronous memory + disk image caching with automatic cache expiration handling 22 | - [x] A background image decompression to avoid frame rate drop 23 | - [x] [Progressive image loading](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#progressive-animation) (including animated image, like GIF showing in Web browser) 24 | - [x] [Thumbnail image decoding](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#thumbnail-decoding-550) to save CPU && Memory for large images 25 | - [x] [Extendable image coder](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-coder-420) to support massive image format, like WebP 26 | - [x] [Full-stack solution for animated images](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-image-50) which keep a balance between CPU && Memory 27 | - [x] [Customizable and composable transformations](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#transformer-50) can be applied to the images right after download 28 | - [x] [Customizable and multiple caches system](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-cache-50) 29 | - [x] [Customizable and multiple loaders system](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-loader-50) to expand the capabilities, like [Photos Library](https://github.com/SDWebImage/SDWebImagePhotosPlugin) 30 | - [x] [Image loading indicators](https://github.com/SDWebImage/SDWebImage/wiki/How-to-use#use-view-indicator-50) 31 | - [x] [Image loading transition animation](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#image-transition-430) 32 | - [x] A guarantee that the same URL won't be downloaded several times 33 | - [x] A guarantee that bogus URLs won't be retried again and again 34 | - [x] A guarantee that main thread will never be blocked 35 | - [x] Modern Objective-C and better Swift support 36 | - [x] Performances! 37 | 38 | ## Supported Image Formats 39 | 40 | - Image formats supported by Apple system (JPEG, PNG, TIFF, HEIC, ...), including GIF/APNG/HEIC animation 41 | - WebP format, including animated WebP (use the [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) project). Note iOS 14/macOS 11.0 supports built-in WebP decoding (no encoding). 42 | - Support extendable coder plugins for new image formats like BPG, AVIF. And vector format like PDF, SVG. See all the list in [Image coder plugin List](https://github.com/SDWebImage/SDWebImage/wiki/Coder-Plugin-List) 43 | 44 | ## Additional modules and Ecosystem 45 | 46 | In order to keep SDWebImage focused and limited to the core features, but also allow extensibility and custom behaviors, during the 5.0 refactoring we focused on modularizing the library. 47 | As such, we have moved/built new modules to [SDWebImage org](https://github.com/SDWebImage). 48 | 49 | #### SwiftUI 50 | [SwiftUI](https://developer.apple.com/xcode/swiftui/) is an innovative UI framework written in Swift to build user interfaces across all Apple platforms. 51 | 52 | We support SwiftUI by building a brand new framework called [SDWebImageSwiftUI](https://github.com/SDWebImage/SDWebImageSwiftUI), which is built on top of SDWebImage core functions (caching, loading and animation). 53 | 54 | The new framework introduce two View structs `WebImage` and `AnimatedImage` for SwiftUI world, `ImageIndicator` modifier for any View, `ImageManager` observable object for data source. Supports iOS 13+/macOS 10.15+/tvOS 13+/watchOS 6+ and Swift 5.1. Have a nice try and provide feedback! 55 | 56 | #### Coders for additional image formats 57 | - [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) - coder for WebP format. iOS 8+/macOS 10.10+. Based on [libwebp](https://chromium.googlesource.com/webm/libwebp) 58 | - [SDWebImageHEIFCoder](https://github.com/SDWebImage/SDWebImageHEIFCoder) - coder for HEIF format, iOS 8+/macOS 10.10+ support. Based on [libheif](https://github.com/strukturag/libheif) 59 | - [SDWebImageBPGCoder](https://github.com/SDWebImage/SDWebImageBPGCoder) - coder for BPG format. Based on [libbpg](https://github.com/mirrorer/libbpg) 60 | - [SDWebImageFLIFCoder](https://github.com/SDWebImage/SDWebImageFLIFCoder) - coder for FLIF format. Based on [libflif](https://github.com/FLIF-hub/FLIF) 61 | - [SDWebImageAVIFCoder](https://github.com/SDWebImage/SDWebImageAVIFCoder) - coder for AVIF (AV1-based) format. Based on [libavif](https://github.com/AOMediaCodec/libavif) 62 | - [SDWebImagePDFCoder](https://github.com/SDWebImage/SDWebImagePDFCoder) - coder for PDF vector format. Using built-in frameworks 63 | - [SDWebImageSVGCoder](https://github.com/SDWebImage/SDWebImageSVGCoder) - coder for SVG vector format. Using built-in frameworks 64 | - [SDWebImageLottieCoder](https://github.com/SDWebImage/SDWebImageLottieCoder) - coder for Lottie animation format. Based on [rlottie](https://github.com/Samsung/rlottie) 65 | - and more from community! 66 | 67 | #### Custom Caches 68 | - [SDWebImageYYPlugin](https://github.com/SDWebImage/SDWebImageYYPlugin) - plugin to support caching images with [YYCache](https://github.com/ibireme/YYCache) 69 | - [SDWebImagePINPlugin](https://github.com/SDWebImage/SDWebImagePINPlugin) - plugin to support caching images with [PINCache](https://github.com/pinterest/PINCache) 70 | 71 | #### Custom Loaders 72 | - [SDWebImagePhotosPlugin](https://github.com/SDWebImage/SDWebImagePhotosPlugin) - plugin to support loading images from Photos (using `Photos.framework`) 73 | - [SDWebImageLinkPlugin](https://github.com/SDWebImage/SDWebImageLinkPlugin) - plugin to support loading images from rich link url, as well as `LPLinkView` (using `LinkPresentation.framework`) 74 | 75 | #### Integration with 3rd party libraries 76 | - [SDWebImageLottiePlugin](https://github.com/SDWebImage/SDWebImageLottiePlugin) - plugin to support [Lottie-iOS](https://github.com/airbnb/lottie-ios), vector animation rending with remote JSON files 77 | - [SDWebImageSVGKitPlugin](https://github.com/SDWebImage/SDWebImageLottiePlugin) - plugin to support [SVGKit](https://github.com/SVGKit/SVGKit), SVG rendering using Core Animation, iOS 8+/macOS 10.10+ support 78 | - [SDWebImageFLPlugin](https://github.com/SDWebImage/SDWebImageFLPlugin) - plugin to support [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) as the engine for animated GIFs 79 | - [SDWebImageYYPlugin](https://github.com/SDWebImage/SDWebImageYYPlugin) - plugin to integrate [YYImage](https://github.com/ibireme/YYImage) & [YYCache](https://github.com/ibireme/YYCache) for image rendering & caching 80 | 81 | #### Community driven popular libraries 82 | - [FirebaseUI](https://github.com/firebase/FirebaseUI-iOS) - Firebase Storage binding for query images, based on SDWebImage loader system 83 | - [react-native-fast-image](https://github.com/DylanVann/react-native-fast-image) - React Native fast image component, based on SDWebImage Animated Image solution 84 | - [flutter_image_compress](https://github.com/OpenFlutter/flutter_image_compress) - Flutter compresses image plugin, based on SDWebImage WebP coder plugin 85 | 86 | #### Make our lives easier 87 | - [libwebp-Xcode](https://github.com/SDWebImage/libwebp-Xcode) - A wrapper for [libwebp](https://chromium.googlesource.com/webm/libwebp) + an Xcode project. 88 | - [libheif-Xcode](https://github.com/SDWebImage/libheif-Xcode) - A wrapper for [libheif](https://github.com/strukturag/libheif) + an Xcode project. 89 | - [libavif-Xcode](https://github.com/SDWebImage/libavif-Xcode) - A wrapper for [libavif](https://github.com/AOMediaCodec/libavif) + an Xcode project. 90 | - and more third-party C/C++ image codec libraries with CocoaPods/Carthage/SwiftPM support. 91 | 92 | You can use those directly, or create similar components of your own, by using the customizable architecture of SDWebImage. 93 | 94 | ## Requirements 95 | 96 | - iOS 8.0 or later 97 | - tvOS 9.0 or later 98 | - watchOS 2.0 or later 99 | - macOS 10.10 or later (10.15 for Catalyst) 100 | - Xcode 10.0 or later 101 | 102 | #### Backwards compatibility 103 | 104 | - For iOS 7, macOS 10.9 or Xcode < 8, use [any 4.x version up to 4.4.6](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.6) 105 | - For macOS 10.8, use [any 4.x version up to 4.3.0](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0) 106 | - For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tag/3.7.6) 107 | - For iOS < 5.0, please use the last [2.0 version](https://github.com/SDWebImage/SDWebImage/tree/2.0-compat). 108 | 109 | ## Getting Started 110 | 111 | - Read this Readme doc 112 | - Read the [How to use section](https://github.com/SDWebImage/SDWebImage#how-to-use) 113 | - Read the [Latest Documentation](https://sdwebimage.github.io/) and [CocoaDocs for old version](http://cocoadocs.org/docsets/SDWebImage/) 114 | - Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage` 115 | - Read the [Installation Guide](https://github.com/SDWebImage/SDWebImage/wiki/Installation-Guide) 116 | - Read the [SDWebImage 5.0 Migration Guide](https://github.com/SDWebImage/SDWebImage/blob/master/Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x 117 | - Read the [SDWebImage 4.0 Migration Guide](https://github.com/SDWebImage/SDWebImage/blob/master/Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x 118 | - Read the [Common Problems](https://github.com/SDWebImage/SDWebImage/wiki/Common-Problems) to find the solution for common problems 119 | - Go to the [Wiki Page](https://github.com/SDWebImage/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage) 120 | 121 | ## Who Uses It 122 | - Find out [who uses SDWebImage](https://github.com/SDWebImage/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. 123 | 124 | ## Communication 125 | 126 | - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). (Tag 'sdwebimage') 127 | - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). 128 | - If you **found a bug**, open an issue. 129 | - If you **have a feature request**, open an issue. 130 | - If you **need IRC channel**, use [Gitter](https://gitter.im/SDWebImage/community). 131 | 132 | ## Contribution 133 | 134 | - If you **want to contribute**, read the [Contributing Guide](https://github.com/SDWebImage/SDWebImage/blob/master/.github/CONTRIBUTING.md) 135 | - For **development contribution guide**, read the [How-To-Contribute](https://github.com/SDWebImage/SDWebImage/wiki/How-to-Contribute) 136 | - For **understanding code architecture**, read the [Code Architecture Analysis](https://github.com/SDWebImage/SDWebImage/wiki/5.6-Code-Architecture-Analysis) 137 | 138 | ## How To Use 139 | 140 | * Objective-C 141 | 142 | ```objective-c 143 | #import 144 | ... 145 | [imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] 146 | placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; 147 | ``` 148 | 149 | * Swift 150 | 151 | ```swift 152 | import SDWebImage 153 | 154 | imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png")) 155 | ``` 156 | 157 | - For details about how to use the library and clear examples, see [The detailed How to use](https://github.com/SDWebImage/SDWebImage/blob/master/Docs/HowToUse.md) 158 | 159 | ## Animated Images (GIF) support 160 | 161 | In 5.0, we introduced a brand new mechanism for supporting animated images. This includes animated image loading, rendering, decoding, and also supports customizations (for advanced users). 162 | 163 | This animated image solution is available for `iOS`/`tvOS`/`macOS`. The `SDAnimatedImage` is subclass of `UIImage/NSImage`, and `SDAnimatedImageView` is subclass of `UIImageView/NSImageView`, to make them compatible with the common frameworks APIs. 164 | 165 | The `SDAnimatedImageView` supports the familiar image loading category methods, works like drop-in replacement for `UIImageView/NSImageView`. 166 | 167 | Don't have UIView (like WatchKit or CALayer)? you can still use `SDAnimatedPlayer` the player engine for advanced playback and rendering. 168 | 169 | See [Animated Image](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-image-50) for more detailed information. 170 | 171 | * Objective-C 172 | 173 | ```objective-c 174 | SDAnimatedImageView *imageView = [SDAnimatedImageView new]; 175 | SDAnimatedImage *animatedImage = [SDAnimatedImage imageNamed:@"image.gif"]; 176 | imageView.image = animatedImage; 177 | ``` 178 | 179 | * Swift 180 | 181 | ```swift 182 | let imageView = SDAnimatedImageView() 183 | let animatedImage = SDAnimatedImage(named: "image.gif") 184 | imageView.image = animatedImage 185 | ``` 186 | 187 | #### FLAnimatedImage integration has its own dedicated repo 188 | In order to clean up things and make our core project do less things, we decided that the `FLAnimatedImage` integration does not belong here. From 5.0, this will still be available, but under a dedicated repo [SDWebImageFLPlugin](https://github.com/SDWebImage/SDWebImageFLPlugin). 189 | 190 | ## Installation 191 | 192 | There are four ways to use SDWebImage in your project: 193 | - using CocoaPods 194 | - using Carthage 195 | - using Swift Package Manager 196 | - manual install (build frameworks or embed Xcode Project) 197 | 198 | ### Installation with CocoaPods 199 | 200 | [CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details. 201 | 202 | #### Podfile 203 | ``` 204 | platform :ios, '8.0' 205 | pod 'SDWebImage', '~> 5.0' 206 | ``` 207 | 208 | ##### Swift and static framework 209 | 210 | Swift project previously have to use `use_frameworks!` to make all Pods into dynamic framework to let CocoaPods works. 211 | 212 | However, start with `CocoaPods 1.5.0+` (with `Xcode 9+`), which supports to build both Objective-C && Swift code into static framework. You can use modular headers to use SDWebImage as static framework, without the need of `use_frameworks!`: 213 | 214 | ``` 215 | platform :ios, '8.0' 216 | # Uncomment the next line when you want all Pods as static framework 217 | # use_modular_headers! 218 | pod 'SDWebImage', :modular_headers => true 219 | ``` 220 | 221 | See more on [CocoaPods 1.5.0 — Swift Static Libraries](http://blog.cocoapods.org/CocoaPods-1.5.0/) 222 | 223 | If not, you still need to add `use_frameworks!` to use SDWebImage as dynamic framework: 224 | 225 | ``` 226 | platform :ios, '8.0' 227 | use_frameworks! 228 | pod 'SDWebImage' 229 | ``` 230 | 231 | #### Subspecs 232 | 233 | There are 2 subspecs available now: `Core` and `MapKit` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `MapKit`, you need to specify it). 234 | 235 | Podfile example: 236 | 237 | ``` 238 | pod 'SDWebImage/MapKit' 239 | ``` 240 | 241 | ### Installation with Carthage (iOS 8+) 242 | 243 | [Carthage](https://github.com/Carthage/Carthage) is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. 244 | 245 | To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage) 246 | 247 | Carthage users can point to this repository and use whichever generated framework they'd like: SDWebImage, SDWebImageMapKit or both. 248 | 249 | Make the following entry in your Cartfile: `github "SDWebImage/SDWebImage"` 250 | Then run `carthage update` 251 | If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application). 252 | 253 | > NOTE: At this time, Carthage does not provide a way to build only specific repository subcomponents (or equivalent of CocoaPods's subspecs). All components and their dependencies will be built with the above command. However, you don't need to copy frameworks you aren't using into your project. For instance, if you aren't using `SDWebImageMapKit`, feel free to delete that framework from the Carthage Build directory after `carthage update` completes. 254 | 255 | ### Installation with Swift Package Manager (Xcode 11+) 256 | 257 | [Swift Package Manager](https://swift.org/package-manager/) (SwiftPM) is a tool for managing the distribution of Swift code as well as C-family dependency. From Xcode 11, SwiftPM got natively integrated with Xcode. 258 | 259 | SDWebImage support SwiftPM from version 5.1.0. To use SwiftPM, you should use Xcode 11 to open your project. Click `File` -> `Swift Packages` -> `Add Package Dependency`, enter [SDWebImage repo's URL](https://github.com/SDWebImage/SDWebImage.git). Or you can login Xcode with your GitHub account and just type `SDWebImage` to search. 260 | 261 | After select the package, you can choose the dependency type (tagged version, branch or commit). Then Xcode will setup all the stuff for you. 262 | 263 | If you're a framework author and use SDWebImage as a dependency, update your `Package.swift` file: 264 | 265 | ```swift 266 | let package = Package( 267 | // 5.1.0 ..< 6.0.0 268 | dependencies: [ 269 | .package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.1.0") 270 | ], 271 | // ... 272 | ) 273 | ``` 274 | 275 | ### Manual Installation Guide 276 | 277 | See more on [Manual install Guide](https://github.com/SDWebImage/SDWebImage/wiki/Installation-Guide#manual-installation-guide) 278 | 279 | ### Import headers in your source files 280 | 281 | In the source files where you need to use the library, import the umbrella header file: 282 | 283 | ```objective-c 284 | #import 285 | ``` 286 | 287 | It's also recommend to use the module import syntax, available for CocoaPods(enable `modular_headers`)/Carthage/SwiftPM. 288 | 289 | ```objecitivec 290 | @import SDWebImage; 291 | ``` 292 | 293 | ### Build Project 294 | 295 | At this point your workspace should build without error. If you are having problem, post to the Issue and the 296 | community can help you solve it. 297 | 298 | ## Author 299 | - [Olivier Poitrey](https://github.com/rs) 300 | 301 | ## Collaborators 302 | - [Konstantinos K.](https://github.com/mythodeia) 303 | - [Bogdan Poplauschi](https://github.com/bpoplauschi) 304 | - [Chester Liu](https://github.com/skyline75489) 305 | - [DreamPiggy](https://github.com/dreampiggy) 306 | - [Wu Zhong](https://github.com/zhongwuzw) 307 | 308 | ## Credits 309 | 310 | Thank you to all the people who have already contributed to SDWebImage. 311 | 312 | [![Contributors](https://opencollective.com/SDWebImage/contributors.svg?width=890)](https://github.com/SDWebImage/SDWebImage/graphs/contributors) 313 | 314 | ## Licenses 315 | 316 | All source code is licensed under the [MIT License](https://github.com/SDWebImage/SDWebImage/blob/master/LICENSE). 317 | 318 | ## Architecture 319 | 320 | To learn about SDWebImage's architecture design for contribution, read [The Core of SDWebImage v5.6 Architecture](https://github.com/SDWebImage/SDWebImage/wiki/5.6-Code-Architecture-Analysis). Thanks @looseyi for the post and translation. 321 | 322 | #### High Level Diagram 323 |

324 | 325 |

326 | 327 | #### Overall Class Diagram 328 |

329 | 330 |

331 | 332 | #### Top Level API Diagram 333 |

334 | 335 |

336 | 337 | #### Main Sequence Diagram 338 |

339 | 340 |

341 | 342 | #### More detailed diagrams 343 | - [Manager API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/Diagrams/SDWebImageManagerClassDiagram.png) 344 | - [Coders API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/Diagrams/SDWebImageCodersClassDiagram.png) 345 | - [Loader API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/Diagrams/SDWebImageLoaderClassDiagram.png) 346 | - [Cache API Diagram](https://raw.githubusercontent.com/SDWebImage/SDWebImage/master/Docs/Diagrams/SDWebImageCacheClassDiagram.png) 347 | 348 | -------------------------------------------------------------------------------- /Demo/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 | /// A async block operation, success after you call `completer` (not like `NSBlockOperation` which is for sync block, success on return) 15 | @interface SDAsyncBlockOperation : NSOperation 16 | 17 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block; 18 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block; 19 | - (void)complete; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Demo/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 | @synchronized (self) { 39 | if (self.isCancelled) { 40 | self.finished = YES; 41 | return; 42 | } 43 | 44 | self.finished = NO; 45 | self.executing = YES; 46 | 47 | if (self.executionBlock) { 48 | self.executionBlock(self); 49 | } else { 50 | self.executing = NO; 51 | self.finished = YES; 52 | } 53 | } 54 | } 55 | 56 | - (void)cancel { 57 | @synchronized (self) { 58 | [super cancel]; 59 | if (self.isExecuting) { 60 | self.executing = NO; 61 | self.finished = YES; 62 | } 63 | } 64 | } 65 | 66 | 67 | - (void)complete { 68 | @synchronized (self) { 69 | if (self.isExecuting) { 70 | self.finished = YES; 71 | self.executing = NO; 72 | } 73 | } 74 | } 75 | 76 | - (void)setFinished:(BOOL)finished { 77 | [self willChangeValueForKey:@"isFinished"]; 78 | _finished = finished; 79 | [self didChangeValueForKey:@"isFinished"]; 80 | } 81 | 82 | - (void)setExecuting:(BOOL)executing { 83 | [self willChangeValueForKey:@"isExecuting"]; 84 | _executing = executing; 85 | [self didChangeValueForKey:@"isExecuting"]; 86 | } 87 | 88 | - (BOOL)isConcurrent { 89 | return YES; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /Demo/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 | /// A Image-Asset manager to work like UIKit/AppKit's image cache behavior 13 | /// 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 :) 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 | -------------------------------------------------------------------------------- /Demo/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.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 "SDImageAssetManager.h" 10 | #import "SDInternalMacros.h" 11 | 12 | static NSArray *SDBundlePreferredScales() { 13 | static NSArray *scales; 14 | static dispatch_once_t onceToken; 15 | dispatch_once(&onceToken, ^{ 16 | #if SD_WATCH 17 | CGFloat screenScale = [WKInterfaceDevice currentDevice].screenScale; 18 | #elif SD_UIKIT 19 | CGFloat screenScale = [UIScreen mainScreen].scale; 20 | #elif SD_MAC 21 | CGFloat screenScale = [NSScreen mainScreen].backingScaleFactor; 22 | #endif 23 | if (screenScale <= 1) { 24 | scales = @[@1,@2,@3]; 25 | } else if (screenScale <= 2) { 26 | scales = @[@2,@3,@1]; 27 | } else { 28 | scales = @[@3,@2,@1]; 29 | } 30 | }); 31 | return scales; 32 | } 33 | 34 | @implementation SDImageAssetManager { 35 | dispatch_semaphore_t _lock; 36 | } 37 | 38 | + (instancetype)sharedAssetManager { 39 | static dispatch_once_t onceToken; 40 | static SDImageAssetManager *assetManager; 41 | dispatch_once(&onceToken, ^{ 42 | assetManager = [[SDImageAssetManager alloc] init]; 43 | }); 44 | return assetManager; 45 | } 46 | 47 | - (instancetype)init { 48 | self = [super init]; 49 | if (self) { 50 | NSPointerFunctionsOptions valueOptions; 51 | #if SD_MAC 52 | // Apple says that NSImage use a weak reference to value 53 | valueOptions = NSPointerFunctionsWeakMemory; 54 | #else 55 | // Apple says that UIImage use a strong reference to value 56 | valueOptions = NSPointerFunctionsStrongMemory; 57 | #endif 58 | _imageTable = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsCopyIn valueOptions:valueOptions]; 59 | _lock = dispatch_semaphore_create(1); 60 | #if SD_UIKIT 61 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 62 | #endif 63 | } 64 | return self; 65 | } 66 | 67 | - (void)dealloc { 68 | #if SD_UIKIT 69 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 70 | #endif 71 | } 72 | 73 | - (void)didReceiveMemoryWarning:(NSNotification *)notification { 74 | SD_LOCK(_lock); 75 | [self.imageTable removeAllObjects]; 76 | SD_UNLOCK(_lock); 77 | } 78 | 79 | - (NSString *)getPathForName:(NSString *)name bundle:(NSBundle *)bundle preferredScale:(CGFloat *)scale { 80 | NSParameterAssert(name); 81 | NSParameterAssert(bundle); 82 | NSString *path; 83 | if (name.length == 0) { 84 | return path; 85 | } 86 | if ([name hasSuffix:@"/"]) { 87 | return path; 88 | } 89 | NSString *extension = name.pathExtension; 90 | if (extension.length == 0) { 91 | // If no extension, follow Apple's doc, check PNG format 92 | extension = @"png"; 93 | } 94 | name = [name stringByDeletingPathExtension]; 95 | 96 | CGFloat providedScale = *scale; 97 | NSArray *scales = SDBundlePreferredScales(); 98 | 99 | // Check if file name contains scale 100 | for (size_t i = 0; i < scales.count; i++) { 101 | NSNumber *scaleValue = scales[i]; 102 | if ([name hasSuffix:[NSString stringWithFormat:@"@%@x", scaleValue]]) { 103 | path = [bundle pathForResource:name ofType:extension]; 104 | if (path) { 105 | *scale = scaleValue.doubleValue; // override 106 | return path; 107 | } 108 | } 109 | } 110 | 111 | // Search with provided scale first 112 | if (providedScale != 0) { 113 | NSString *scaledName = [name stringByAppendingFormat:@"@%@x", @(providedScale)]; 114 | path = [bundle pathForResource:scaledName ofType:extension]; 115 | if (path) { 116 | return path; 117 | } 118 | } 119 | 120 | // Search with preferred scale 121 | for (size_t i = 0; i < scales.count; i++) { 122 | NSNumber *scaleValue = scales[i]; 123 | if (scaleValue.doubleValue == providedScale) { 124 | // Ignore provided scale 125 | continue; 126 | } 127 | NSString *scaledName = [name stringByAppendingFormat:@"@%@x", scaleValue]; 128 | path = [bundle pathForResource:scaledName ofType:extension]; 129 | if (path) { 130 | *scale = scaleValue.doubleValue; // override 131 | return path; 132 | } 133 | } 134 | 135 | // Search without scale 136 | path = [bundle pathForResource:name ofType:extension]; 137 | 138 | return path; 139 | } 140 | 141 | - (UIImage *)imageForName:(NSString *)name { 142 | NSParameterAssert(name); 143 | UIImage *image; 144 | SD_LOCK(_lock); 145 | image = [self.imageTable objectForKey:name]; 146 | SD_UNLOCK(_lock); 147 | return image; 148 | } 149 | 150 | - (void)storeImage:(UIImage *)image forName:(NSString *)name { 151 | NSParameterAssert(image); 152 | NSParameterAssert(name); 153 | SD_LOCK(_lock); 154 | [self.imageTable setObject:image forKey:name]; 155 | SD_UNLOCK(_lock); 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/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 SD_CSTRING 25 | #define SD_CSTRING(str) #str 26 | #endif 27 | 28 | #ifndef SD_NSSTRING 29 | #define SD_NSSTRING(str) @(SD_CSTRING(str)) 30 | #endif 31 | 32 | #ifndef SD_SEL_SPI 33 | #define SD_SEL_SPI(name) NSSelectorFromString([NSString stringWithFormat:@"_%@", SD_NSSTRING(name)]) 34 | #endif 35 | 36 | #ifndef weakify 37 | #define weakify(...) \ 38 | sd_keywordify \ 39 | metamacro_foreach_cxt(sd_weakify_,, __weak, __VA_ARGS__) 40 | #endif 41 | 42 | #ifndef strongify 43 | #define strongify(...) \ 44 | sd_keywordify \ 45 | _Pragma("clang diagnostic push") \ 46 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \ 47 | metamacro_foreach(sd_strongify_,, __VA_ARGS__) \ 48 | _Pragma("clang diagnostic pop") 49 | #endif 50 | 51 | #define sd_weakify_(INDEX, CONTEXT, VAR) \ 52 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); 53 | 54 | #define sd_strongify_(INDEX, VAR) \ 55 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); 56 | 57 | #if DEBUG 58 | #define sd_keywordify autoreleasepool {} 59 | #else 60 | #define sd_keywordify try {} @catch (...) {} 61 | #endif 62 | 63 | #ifndef onExit 64 | #define onExit \ 65 | sd_keywordify \ 66 | __strong sd_cleanupBlock_t metamacro_concat(sd_exitBlock_, __LINE__) __attribute__((cleanup(sd_executeCleanupBlock), unused)) = ^ 67 | #endif 68 | 69 | typedef void (^sd_cleanupBlock_t)(void); 70 | 71 | #if defined(__cplusplus) 72 | extern "C" { 73 | #endif 74 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block); 75 | #if defined(__cplusplus) 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/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 | /// A weak proxy which forward all the message to the target 13 | @interface SDWeakProxy : NSProxy 14 | 15 | @property (nonatomic, weak, readonly, nullable) id target; 16 | 17 | - (nonnull instancetype)initWithTarget:(nonnull id)target; 18 | + (nonnull instancetype)proxyWithTarget:(nonnull id)target; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/Pods/SDWebImage/WebImage/SDWebImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Florent Vilmart 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 | //! Project version number for SDWebImage. 13 | FOUNDATION_EXPORT double SDWebImageVersionNumber; 14 | 15 | //! Project version string for SDWebImage. 16 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; 17 | 18 | // In this header, you should import all the public headers of your framework using statements like #import 19 | 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | #import 55 | #import 56 | #import 57 | #import 58 | #import 59 | #import 60 | #import 61 | #import 62 | #import 63 | #import 64 | #import 65 | #import 66 | #import 67 | #import 68 | #import 69 | #import 70 | #import 71 | #import 72 | #import 73 | #import 74 | 75 | // Mac 76 | #if __has_include() 77 | #import 78 | #endif 79 | #if __has_include() 80 | #import 81 | #endif 82 | #if __has_include() 83 | #import 84 | #endif 85 | 86 | // MapKit 87 | #if __has_include() 88 | #import 89 | #endif 90 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/KSPhotoBrowser/KSPhotoBrowser-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_KSPhotoBrowser : NSObject 3 | @end 4 | @implementation PodsDummy_KSPhotoBrowser 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/KSPhotoBrowser/KSPhotoBrowser-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 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/KSPhotoBrowser/KSPhotoBrowser.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KSPhotoBrowser 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/KSPhotoBrowser" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KSPhotoBrowser" "${PODS_ROOT}/Headers/Public/SDWebImage" 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}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## KSPhotoBrowser 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 Kyle Sun 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | ## SDWebImage 30 | 31 | Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is furnished 38 | to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 49 | THE SOFTWARE. 50 | 51 | 52 | Generated by CocoaPods - https://cocoapods.org 53 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2017 Kyle Sun 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | KSPhotoBrowser 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is furnished 55 | to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 66 | THE SOFTWARE. 67 | 68 | 69 | License 70 | MIT 71 | Title 72 | SDWebImage 73 | Type 74 | PSGroupSpecifier 75 | 76 | 77 | FooterText 78 | Generated by CocoaPods - https://cocoapods.org 79 | Title 80 | 81 | Type 82 | PSGroupSpecifier 83 | 84 | 85 | StringsTable 86 | Acknowledgements 87 | Title 88 | Acknowledgements 89 | 90 | 91 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_KSPhotoBrowserDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_KSPhotoBrowserDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KSPhotoBrowser" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KSPhotoBrowser" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"KSPhotoBrowser" -l"SDWebImage" -framework "ImageIO" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/Pods-KSPhotoBrowserDemo/Pods-KSPhotoBrowserDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KSPhotoBrowser" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/KSPhotoBrowser" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"KSPhotoBrowser" -l"SDWebImage" -framework "ImageIO" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Demo/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Demo/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 | -------------------------------------------------------------------------------- /Demo/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 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" 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 | -------------------------------------------------------------------------------- /Images/Blur.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Blur.gif -------------------------------------------------------------------------------- /Images/Corner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Corner.gif -------------------------------------------------------------------------------- /Images/Index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Index.png -------------------------------------------------------------------------------- /Images/Orientation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Orientation.gif -------------------------------------------------------------------------------- /Images/Rotation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Rotation.gif -------------------------------------------------------------------------------- /Images/Scale.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skx926/KSPhotoBrowser/7c4d57adf3da703ef428972f2b4fe5f4c82b9548/Images/Scale.gif -------------------------------------------------------------------------------- /KSPhotoBrowser.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint KSPhotoBrowser.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "KSPhotoBrowser" 19 | s.version = "0.3.1" 20 | s.summary = "A beautiful photo browser with interactive dismissal animation." 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | # s.description = <<-DESC 28 | # DESC 29 | 30 | s.homepage = "https://github.com/skx926/KSPhotoBrowser" 31 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 32 | 33 | 34 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 35 | # 36 | # Licensing your code is important. See http://choosealicense.com for more info. 37 | # CocoaPods will detect a license file if there is a named LICENSE* 38 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 39 | # 40 | 41 | s.license = "MIT" 42 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 43 | 44 | 45 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 46 | # 47 | # Specify the authors of the library, with email addresses. Email addresses 48 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 49 | # accepts just a name if you'd rather not provide an email address. 50 | # 51 | # Specify a social_media_url where others can refer to, for example a twitter 52 | # profile URL. 53 | # 54 | 55 | s.author = { "Kyle Sun" => "skx926@gmail.com" } 56 | # Or just: s.author = "Kyle Sun" 57 | # s.authors = { "Kyle Sun" => "skx926@gmail.com" } 58 | s.social_media_url = "https://twitter.com/skx926" 59 | 60 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 61 | # 62 | # If this Pod runs only on iOS or OS X, then specify the platform and 63 | # the deployment target. You can optionally include the target after the platform. 64 | # 65 | 66 | # s.platform = :ios 67 | s.platform = :ios, "8.0" 68 | 69 | # When using multiple platforms 70 | # s.ios.deployment_target = "5.0" 71 | # s.osx.deployment_target = "10.7" 72 | # s.watchos.deployment_target = "2.0" 73 | # s.tvos.deployment_target = "9.0" 74 | 75 | 76 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 77 | # 78 | # Specify the location from where the source should be retrieved. 79 | # Supports git, hg, bzr, svn and HTTP. 80 | # 81 | 82 | s.source = { :git => "https://github.com/skx926/KSPhotoBrowser.git", :tag => "#{s.version}" } 83 | 84 | 85 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 86 | # 87 | # CocoaPods is smart about how it includes source code. For source files 88 | # giving a folder will include any swift, h, m, mm, c & cpp files. 89 | # For header files it will include any header in the folder. 90 | # Not including the public_header_files will make all headers public. 91 | # 92 | 93 | s.source_files = "KSPhotoBrowser", "KSPhotoBrowser/**/*.{h,m}" 94 | # s.exclude_files = "Classes/Exclude" 95 | 96 | # s.public_header_files = "KSPhotoBrowser/**/*.h" 97 | 98 | 99 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 100 | # 101 | # A list of resources included with the Pod. These are copied into the 102 | # target bundle with a build phase script. Anything else will be cleaned. 103 | # You can preserve files from being cleaned, please don't preserve 104 | # non-essential files like tests, examples and documentation. 105 | # 106 | 107 | # s.resource = "icon.png" 108 | # s.resources = "Resources/*.png" 109 | 110 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 111 | 112 | 113 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 114 | # 115 | # Link your library with frameworks, or libraries. Libraries do not include 116 | # the lib prefix of their name. 117 | # 118 | 119 | s.framework = "UIKit" 120 | # s.frameworks = "SomeFramework", "AnotherFramework" 121 | 122 | # s.library = "iconv" 123 | # s.libraries = "iconv", "xml2" 124 | 125 | 126 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 127 | # 128 | # If your library depends on compiler flags you can set them in the xcconfig hash 129 | # where they will only apply to your library. If you depend on other Podspecs 130 | # you can include multiple dependencies to ensure it works. 131 | 132 | # s.requires_arc = true 133 | 134 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 135 | s.dependency 'SDWebImage', '~> 5.0' 136 | 137 | end 138 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSImageManagerProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSWebImageProtocol.h 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 22/05/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^KSImageManagerProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); 12 | 13 | typedef void (^KSImageManagerCompletionBlock)(UIImage * _Nullable image, NSURL * _Nullable url, BOOL success, NSError * _Nullable error); 14 | 15 | @protocol KSImageManager 16 | 17 | + (Class _Nonnull)imageViewClass; 18 | 19 | + (void)setImageForImageView:(nullable UIImageView *)imageView 20 | withURL:(nullable NSURL *)imageURL 21 | placeholder:(nullable UIImage *)placeholder 22 | progress:(nullable KSImageManagerProgressBlock)progress 23 | completion:(nullable KSImageManagerCompletionBlock)completion; 24 | 25 | + (void)cancelImageRequestForImageView:(nullable UIImageView *)imageView; 26 | 27 | + (UIImage *_Nullable)imageFromMemoryForURL:(nullable NSURL *)url; 28 | 29 | + (UIImage *_Nullable)imageForURL:(nullable NSURL *)url; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoBrowser.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KSPhotoItem.h" 11 | #import "KSImageManagerProtocol.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | typedef NS_ENUM(NSUInteger, KSPhotoBrowserInteractiveDismissalStyle) { 16 | KSPhotoBrowserInteractiveDismissalStyleRotation, 17 | KSPhotoBrowserInteractiveDismissalStyleScale, 18 | KSPhotoBrowserInteractiveDismissalStyleSlide, 19 | KSPhotoBrowserInteractiveDismissalStyleNone 20 | }; 21 | 22 | typedef NS_ENUM(NSUInteger, KSPhotoBrowserBackgroundStyle) { 23 | KSPhotoBrowserBackgroundStyleBlurPhoto, 24 | KSPhotoBrowserBackgroundStyleBlur, 25 | KSPhotoBrowserBackgroundStyleBlack 26 | }; 27 | 28 | typedef NS_ENUM(NSUInteger, KSPhotoBrowserPageIndicatorStyle) { 29 | KSPhotoBrowserPageIndicatorStyleDot, 30 | KSPhotoBrowserPageIndicatorStyleText 31 | }; 32 | 33 | typedef NS_ENUM(NSUInteger, KSPhotoBrowserImageLoadingStyle) { 34 | KSPhotoBrowserImageLoadingStyleIndeterminate, 35 | KSPhotoBrowserImageLoadingStyleDeterminate 36 | }; 37 | 38 | @protocol KSPhotoBrowserDelegate, KSImageManager; 39 | @interface KSPhotoBrowser : UIViewController 40 | 41 | @property (nonatomic, assign) KSPhotoBrowserInteractiveDismissalStyle dismissalStyle; 42 | @property (nonatomic, assign) KSPhotoBrowserBackgroundStyle backgroundStyle; 43 | @property (nonatomic, assign) KSPhotoBrowserPageIndicatorStyle pageindicatorStyle; 44 | @property (nonatomic, assign) KSPhotoBrowserImageLoadingStyle loadingStyle; 45 | @property (nonatomic, assign) BOOL bounces; 46 | @property (nonatomic, weak) id delegate; 47 | @property (class, nonatomic, strong) Class imageManagerClass; 48 | @property (class, nonatomic, strong) UIColor *imageViewBackgroundColor; 49 | 50 | + (instancetype)browserWithPhotoItems:(NSArray *)photoItems selectedIndex:(NSUInteger)selectedIndex; 51 | - (instancetype)initWithPhotoItems:(NSArray *)photoItems selectedIndex:(NSUInteger)selectedIndex; 52 | - (void)showFromViewController:(UIViewController *)vc; 53 | - (UIImage *)imageForItem:(KSPhotoItem *)item; 54 | - (UIImage *)imageAtIndex:(NSUInteger)index; 55 | 56 | @end 57 | 58 | @protocol KSPhotoBrowserDelegate 59 | 60 | @optional 61 | - (void)ks_photoBrowser:(KSPhotoBrowser *)browser didSelectItem:(KSPhotoItem *)item atIndex:(NSUInteger)index; 62 | 63 | // If you do not implement this method, there will be a default implementation which will call the system share sheet `UIActivityViewController` 64 | - (void)ks_photoBrowser:(KSPhotoBrowser *)browser didLongPressItem:(KSPhotoItem *)item atIndex:(NSUInteger)index; 65 | 66 | @end 67 | 68 | NS_ASSUME_NONNULL_END 69 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSPhotoItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoItem.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface KSPhotoItem : NSObject 12 | 13 | @property (nonatomic, strong, nullable) UIView *sourceView; 14 | @property (nonatomic, strong, readonly, nullable) UIImage *thumbImage; 15 | @property (nonatomic, strong, readonly, nullable) UIImage *image; 16 | @property (nonatomic, strong, readonly, nullable) NSURL *imageUrl; 17 | @property (nonatomic, assign) BOOL finished; 18 | 19 | - (nonnull instancetype)initWithSourceView:(nullable UIView *)view 20 | thumbImage:(nullable UIImage *)image 21 | imageUrl:(nullable NSURL *)url; 22 | - (nonnull instancetype)initWithSourceView:(nullable UIImageView * )view 23 | imageUrl:(nullable NSURL *)url; 24 | - (nonnull instancetype)initWithSourceView:(nullable UIImageView *)view 25 | image:(nullable UIImage *)image; 26 | 27 | + (nonnull instancetype)itemWithSourceView:(nullable UIView *)view 28 | thumbImage:(nullable UIImage *)image 29 | imageUrl:(nullable NSURL *)url; 30 | + (nonnull instancetype)itemWithSourceView:(nullable UIImageView *)view 31 | imageUrl:(nullable NSURL *)url; 32 | + (nonnull instancetype)itemWithSourceView:(nullable UIImageView *)view 33 | image:(nullable UIImage *)image; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSPhotoItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoItem.m 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSPhotoItem.h" 10 | 11 | @interface KSPhotoItem () 12 | 13 | @property (nonatomic, strong, readwrite) UIImage *thumbImage; 14 | @property (nonatomic, strong, readwrite) UIImage *image; 15 | @property (nonatomic, strong, readwrite) NSURL *imageUrl; 16 | 17 | @end 18 | 19 | @implementation KSPhotoItem 20 | 21 | - (instancetype)initWithSourceView:(UIView *)view 22 | thumbImage:(UIImage *)image 23 | imageUrl:(NSURL *)url { 24 | self = [super init]; 25 | if (self) { 26 | _sourceView = view; 27 | _thumbImage = image; 28 | _imageUrl = url; 29 | } 30 | return self; 31 | } 32 | 33 | - (instancetype)initWithSourceView:(UIImageView *)view 34 | imageUrl:(NSURL *)url 35 | { 36 | return [self initWithSourceView:view 37 | thumbImage:view.image 38 | imageUrl:url]; 39 | } 40 | 41 | - (instancetype)initWithSourceView:(UIImageView *)view 42 | image:(UIImage *)image { 43 | self = [super init]; 44 | if (self) { 45 | _sourceView = view; 46 | _thumbImage = image; 47 | _imageUrl = nil; 48 | _image = image; 49 | } 50 | return self; 51 | } 52 | 53 | + (instancetype)itemWithSourceView:(UIView *)view 54 | thumbImage:(UIImage *)image 55 | imageUrl:(NSURL *)url 56 | { 57 | return [[KSPhotoItem alloc] initWithSourceView:view 58 | thumbImage:image 59 | imageUrl:url]; 60 | } 61 | 62 | + (instancetype)itemWithSourceView:(UIImageView *)view 63 | imageUrl:(NSURL *)url 64 | { 65 | return [[KSPhotoItem alloc] initWithSourceView:view 66 | imageUrl:url]; 67 | } 68 | 69 | + (instancetype)itemWithSourceView:(UIImageView *)view 70 | image:(UIImage *)image 71 | { 72 | return [[KSPhotoItem alloc] initWithSourceView:view 73 | image:image]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSPhotoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoView.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KSProgressLayer.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | extern const CGFloat kKSPhotoViewPadding; 15 | 16 | @protocol KSImageManager; 17 | @class KSPhotoItem; 18 | 19 | @interface KSPhotoView : UIScrollView 20 | 21 | @property (nonatomic, strong, readonly) UIImageView *imageView; 22 | @property (nonatomic, strong, readonly) KSProgressLayer *progressLayer; 23 | @property (nonatomic, strong, readonly) KSPhotoItem *item; 24 | @property (class, nonatomic, strong) UIColor *backgroundColor; 25 | 26 | - (instancetype)initWithFrame:(CGRect)frame; 27 | - (void)setItem:(KSPhotoItem *)item determinate:(BOOL)determinate; 28 | - (void)resizeImageView; 29 | - (void)cancelCurrentImageLoad; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSPhotoView.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSPhotoView.m 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 12/25/16. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSPhotoView.h" 10 | #import "KSPhotoItem.h" 11 | #import "KSProgressLayer.h" 12 | #import "KSPhotoBrowser.h" 13 | 14 | const CGFloat kKSPhotoViewPadding = 10; 15 | const CGFloat kKSPhotoViewMaxScale = 3; 16 | 17 | static UIColor *BackgroundColor = nil; 18 | 19 | @interface KSPhotoView () 20 | 21 | @property (nonatomic, strong, readwrite) UIImageView *imageView; 22 | @property (nonatomic, strong, readwrite) KSProgressLayer *progressLayer; 23 | @property (nonatomic, strong, readwrite) KSPhotoItem *item; 24 | 25 | @end 26 | 27 | @implementation KSPhotoView 28 | 29 | - (instancetype)initWithFrame:(CGRect)frame { 30 | self = [super initWithFrame:frame]; 31 | if (self) { 32 | self.bouncesZoom = YES; 33 | self.maximumZoomScale = kKSPhotoViewMaxScale; 34 | self.multipleTouchEnabled = YES; 35 | self.showsHorizontalScrollIndicator = YES; 36 | self.showsVerticalScrollIndicator = YES; 37 | self.delegate = self; 38 | if (@available(iOS 11.0, *)) { 39 | self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 40 | } 41 | 42 | _imageView = [[[KSPhotoBrowser.imageManagerClass imageViewClass] alloc] init]; 43 | _imageView.backgroundColor = KSPhotoView.backgroundColor; 44 | _imageView.contentMode = UIViewContentModeScaleAspectFill; 45 | _imageView.clipsToBounds = YES; 46 | [self addSubview:_imageView]; 47 | [self resizeImageView]; 48 | 49 | _progressLayer = [[KSProgressLayer alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; 50 | 51 | _progressLayer.hidden = YES; 52 | [self.layer addSublayer:_progressLayer]; 53 | } 54 | return self; 55 | } 56 | 57 | - (void)layoutSubviews { 58 | [super layoutSubviews]; 59 | _progressLayer.position = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 60 | } 61 | 62 | - (void)setItem:(KSPhotoItem *)item determinate:(BOOL)determinate { 63 | _item = item; 64 | [KSPhotoBrowser.imageManagerClass cancelImageRequestForImageView:_imageView]; 65 | if (item) { 66 | if (item.image) { 67 | _imageView.image = item.image; 68 | _item.finished = YES; 69 | [_progressLayer stopSpin]; 70 | _progressLayer.hidden = YES; 71 | [self resizeImageView]; 72 | return; 73 | } 74 | __weak typeof(self) wself = self; 75 | KSImageManagerProgressBlock progressBlock = nil; 76 | if (determinate) { 77 | progressBlock = ^(NSInteger receivedSize, NSInteger expectedSize) { 78 | __strong typeof(wself) sself = wself; 79 | double progress = (double)receivedSize / expectedSize; 80 | sself.progressLayer.hidden = NO; 81 | sself.progressLayer.strokeEnd = MAX(progress, 0.01); 82 | }; 83 | } else { 84 | [_progressLayer startSpin]; 85 | } 86 | _progressLayer.hidden = NO; 87 | 88 | _imageView.image = item.thumbImage; 89 | [KSPhotoBrowser.imageManagerClass setImageForImageView:_imageView withURL:item.imageUrl placeholder:item.thumbImage progress:progressBlock completion:^(UIImage *image, NSURL *url, BOOL finished, NSError *error) { 90 | __strong typeof(wself) sself = wself; 91 | if (finished) { 92 | [sself resizeImageView]; 93 | } 94 | [sself.progressLayer stopSpin]; 95 | sself.progressLayer.hidden = YES; 96 | sself.item.finished = YES; 97 | }]; 98 | } else { 99 | [_progressLayer stopSpin]; 100 | _progressLayer.hidden = YES; 101 | _imageView.image = nil; 102 | } 103 | [self resizeImageView]; 104 | } 105 | 106 | - (void)resizeImageView { 107 | if (_imageView.image) { 108 | CGSize imageSize = _imageView.image.size; 109 | CGFloat width = self.frame.size.width - 2 * kKSPhotoViewPadding; 110 | CGFloat height = width * (imageSize.height / imageSize.width); 111 | CGRect rect = CGRectMake(0, 0, width, height); 112 | 113 | _imageView.frame = rect; 114 | 115 | // If image is very high, show top content. 116 | if (height <= self.bounds.size.height) { 117 | _imageView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 118 | } else { 119 | _imageView.center = CGPointMake(self.bounds.size.width/2, height/2); 120 | } 121 | 122 | // If image is very wide, make sure user can zoom to fullscreen. 123 | if (width / height > 2) { 124 | self.maximumZoomScale = self.bounds.size.height / height; 125 | } 126 | } else { 127 | CGFloat width = self.frame.size.width - 2 * kKSPhotoViewPadding; 128 | _imageView.frame = CGRectMake(0, 0, width, width * 2.0 / 3); 129 | _imageView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2); 130 | } 131 | self.contentSize = _imageView.frame.size; 132 | self.zoomScale = 1.f; 133 | } 134 | 135 | - (void)cancelCurrentImageLoad { 136 | [KSPhotoBrowser.imageManagerClass cancelImageRequestForImageView:_imageView]; 137 | [_progressLayer stopSpin]; 138 | } 139 | 140 | - (BOOL)isScrollViewOnTopOrBottom { 141 | CGPoint translation = [self.panGestureRecognizer translationInView:self]; 142 | if (translation.y > 0 && self.contentOffset.y <= 0) { 143 | return YES; 144 | } 145 | CGFloat maxOffsetY = floor(self.contentSize.height - self.bounds.size.height); 146 | if (translation.y < 0 && self.contentOffset.y >= maxOffsetY) { 147 | return YES; 148 | } 149 | return NO; 150 | } 151 | 152 | #pragma mark - ScrollViewDelegate 153 | 154 | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { 155 | return _imageView; 156 | } 157 | 158 | - (void)scrollViewDidZoom:(UIScrollView *)scrollView { 159 | CGFloat offsetX = (scrollView.bounds.size.width > scrollView.contentSize.width)? 160 | (scrollView.bounds.size.width - scrollView.contentSize.width) * 0.5 : 0.0; 161 | 162 | CGFloat offsetY = (scrollView.bounds.size.height > scrollView.contentSize.height)? 163 | (scrollView.bounds.size.height - scrollView.contentSize.height) * 0.5 : 0.0; 164 | 165 | _imageView.center = CGPointMake(scrollView.contentSize.width * 0.5 + offsetX, 166 | scrollView.contentSize.height * 0.5 + offsetY); 167 | } 168 | 169 | #pragma mark - GestureRecognizerDelegate 170 | 171 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 172 | if (gestureRecognizer == self.panGestureRecognizer) { 173 | if (gestureRecognizer.state == UIGestureRecognizerStatePossible) { 174 | if ([self isScrollViewOnTopOrBottom]) { 175 | return NO; 176 | } 177 | } 178 | } 179 | return YES; 180 | } 181 | 182 | #pragma mark - Setter & Getter 183 | 184 | + (void)setBackgroundColor:(UIColor *)backgroundColor { 185 | BackgroundColor = backgroundColor; 186 | } 187 | 188 | + (UIColor *)backgroundColor { 189 | return BackgroundColor ?: UIColor.darkGrayColor; 190 | } 191 | 192 | 193 | @end 194 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSProgressLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSProgressLayer.h 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 30/12/2016. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface KSProgressLayer : CAShapeLayer 14 | 15 | - (instancetype)initWithFrame:(CGRect)frame; 16 | - (void)startSpin; 17 | - (void)stopSpin; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSProgressLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSProgressLayer.m 3 | // KSPhotoBrowser 4 | // 5 | // Created by Kyle Sun on 30/12/2016. 6 | // Copyright © 2016 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSProgressLayer.h" 10 | 11 | @interface KSProgressLayer () 12 | 13 | @property (nonatomic, assign) BOOL isSpinning; 14 | 15 | @end 16 | 17 | @implementation KSProgressLayer 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame { 20 | self = [super init]; 21 | if (self) { 22 | self.frame = frame; 23 | self.cornerRadius = 20; 24 | self.fillColor = [UIColor clearColor].CGColor; 25 | self.strokeColor = [UIColor whiteColor].CGColor; 26 | self.lineWidth = 4; 27 | self.lineCap = kCALineCapRound; 28 | self.strokeStart = 0; 29 | self.strokeEnd = 0.01; 30 | self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5].CGColor; 31 | 32 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(self.bounds, 2, 2) cornerRadius:20-2]; 33 | self.path = path.CGPath; 34 | 35 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil]; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)dealloc { 41 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(NSNotification *)notification { 45 | if (self.isSpinning) { 46 | [self startSpin]; 47 | } 48 | } 49 | 50 | - (void)startSpin { 51 | self.isSpinning = YES; 52 | [self spinWithAngle:M_PI]; 53 | } 54 | 55 | - (void)spinWithAngle:(CGFloat)angle { 56 | self.strokeEnd = 0.33; 57 | CABasicAnimation *rotationAnimation; 58 | rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 59 | rotationAnimation.toValue = @(M_PI-0.5); 60 | rotationAnimation.duration = 0.4; 61 | rotationAnimation.cumulative = YES; 62 | rotationAnimation.repeatCount = HUGE; 63 | [self addAnimation:rotationAnimation forKey:nil]; 64 | } 65 | 66 | - (void)stopSpin { 67 | self.isSpinning = NO; 68 | [self removeAllAnimations]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSSDImageManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // KSSDWebImage.h 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 22/05/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSImageManagerProtocol.h" 10 | 11 | @interface KSSDImageManager : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /KSPhotoBrowser/KSSDImageManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // KSSDWebImage.m 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle Sun on 22/05/2017. 6 | // Copyright © 2017 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import "KSSDImageManager.h" 10 | 11 | #if __has_include() 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #else 18 | #import "UIImageView+WebCache.h" 19 | #import "UIView+WebCache.h" 20 | #import "SDWebImageDownloader.h" 21 | #import "SDImageCache.h" 22 | #import "SDAnimatedImageView.h" 23 | #endif 24 | 25 | @implementation KSSDImageManager 26 | 27 | + (Class)imageViewClass { 28 | return SDAnimatedImageView.class; 29 | } 30 | 31 | + (void)setImageForImageView:(UIImageView *)imageView 32 | withURL:(NSURL *)imageURL 33 | placeholder:(UIImage *)placeholder 34 | progress:(KSImageManagerProgressBlock)progress 35 | completion:(KSImageManagerCompletionBlock)completion 36 | { 37 | SDWebImageDownloaderProgressBlock progressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL *targetURL) { 38 | if (progress) { 39 | progress(receivedSize, expectedSize); 40 | } 41 | }; 42 | SDExternalCompletionBlock completionBlock = ^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 43 | if (completion) { 44 | completion(image, imageURL, !error, error); 45 | } 46 | }; 47 | [imageView sd_setImageWithURL:imageURL placeholderImage:placeholder options:SDWebImageRetryFailed progress:progressBlock completed:completionBlock]; 48 | } 49 | 50 | + (void)cancelImageRequestForImageView:(UIImageView *)imageView { 51 | [imageView sd_cancelCurrentImageLoad]; 52 | } 53 | 54 | + (UIImage *)imageFromMemoryForURL:(NSURL *)url { 55 | NSString *key = [SDWebImageManager.sharedManager cacheKeyForURL:url]; 56 | return [SDImageCache.sharedImageCache imageFromMemoryCacheForKey:key]; 57 | } 58 | 59 | + (UIImage *)imageForURL:(NSURL *)url { 60 | NSString *key = [SDWebImageManager.sharedManager cacheKeyForURL:url]; 61 | return [SDImageCache.sharedImageCache imageFromCacheForKey:key]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /KSPhotoBrowser/UIImage+KS.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+KS.h 3 | // KSPhotoBrowserDemo 4 | // 5 | // Created by Kyle on 2018/8/2. 6 | // Copyright © 2018年 Kyle Sun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (KS) 12 | 13 | #pragma mark - Create image 14 | ///============================================================================= 15 | /// @name Create image 16 | ///============================================================================= 17 | 18 | /** 19 | Create an animated image with GIF data. After created, you can access 20 | the images via property '.images'. If the data is not animated gif, this 21 | function is same as [UIImage imageWithData:data scale:scale]; 22 | 23 | @discussion It has a better display performance, but costs more memory 24 | (width * height * frames Bytes). It only suited to display small 25 | gif such as animated emoticon. If you want to display large gif, 26 | see `YYImage`. 27 | 28 | @param data GIF data. 29 | 30 | @param scale The scale factor 31 | 32 | @return A new image created from GIF, or nil when an error occurs. 33 | */ 34 | + (nullable UIImage *)ks_imageWithSmallGIFData:(NSData *)data scale:(CGFloat)scale; 35 | 36 | /** 37 | Create and return a 1x1 point size image with the given color. 38 | 39 | @param color The color. 40 | */ 41 | + (nullable UIImage *)ks_imageWithColor:(UIColor *)color; 42 | 43 | /** 44 | Create and return a pure color image with the given color and size. 45 | 46 | @param color The color. 47 | @param size New image's type. 48 | */ 49 | + (nullable UIImage *)ks_imageWithColor:(UIColor *)color size:(CGSize)size; 50 | 51 | /** 52 | Create and return an image with custom draw code. 53 | 54 | @param size The image size. 55 | @param drawBlock The draw block. 56 | 57 | @return The new image. 58 | */ 59 | + (nullable UIImage *)ks_imageWithSize:(CGSize)size drawBlock:(void (^)(CGContextRef context))drawBlock; 60 | 61 | #pragma mark - Image Info 62 | ///============================================================================= 63 | /// @name Image Info 64 | ///============================================================================= 65 | 66 | /** 67 | Whether this image has alpha channel. 68 | */ 69 | - (BOOL)ks_hasAlphaChannel; 70 | 71 | 72 | #pragma mark - Modify Image 73 | ///============================================================================= 74 | /// @name Modify Image 75 | ///============================================================================= 76 | 77 | /** 78 | Draws the entire image in the specified rectangle, content changed with 79 | the contentMode. 80 | 81 | @discussion This method draws the entire image in the current graphics context, 82 | respecting the image's orientation setting. In the default coordinate system, 83 | images are situated down and to the right of the origin of the specified 84 | rectangle. This method respects any transforms applied to the current graphics 85 | context, however. 86 | 87 | @param rect The rectangle in which to draw the image. 88 | 89 | @param contentMode Draw content mode 90 | 91 | @param clips A Boolean value that determines whether content are confined to the rect. 92 | */ 93 | - (void)ks_drawInRect:(CGRect)rect withContentMode:(UIViewContentMode)contentMode clipsToBounds:(BOOL)clips; 94 | 95 | /** 96 | Returns a new image which is scaled from this image. 97 | The image will be stretched as needed. 98 | 99 | @param size The new size to be scaled, values should be positive. 100 | 101 | @return The new image with the given size. 102 | */ 103 | - (nullable UIImage *)ks_imageByResizeToSize:(CGSize)size; 104 | 105 | /** 106 | Returns a new image which is scaled from this image. 107 | The image content will be changed with thencontentMode. 108 | 109 | @param size The new size to be scaled, values should be positive. 110 | 111 | @param contentMode The content mode for image content. 112 | 113 | @return The new image with the given size. 114 | */ 115 | - (nullable UIImage *)ks_imageByResizeToSize:(CGSize)size contentMode:(UIViewContentMode)contentMode; 116 | 117 | /** 118 | Returns a new image which is cropped from this image. 119 | 120 | @param rect Image's inner rect. 121 | 122 | @return The new image, or nil if an error occurs. 123 | */ 124 | - (nullable UIImage *)ks_imageByCropToRect:(CGRect)rect; 125 | 126 | /** 127 | Returns a new image which is edge inset from this image. 128 | 129 | @param insets Inset (positive) for each of the edges, values can be negative to 'outset'. 130 | 131 | @param color Extend edge's fill color, nil means clear color. 132 | 133 | @return The new image, or nil if an error occurs. 134 | */ 135 | - (nullable UIImage *)ks_imageByInsetEdge:(UIEdgeInsets)insets withColor:(nullable UIColor *)color; 136 | 137 | /** 138 | Rounds a new image with a given corner size. 139 | 140 | @param radius The radius of each corner oval. Values larger than half the 141 | rectangle's width or height are clamped appropriately to half 142 | the width or height. 143 | */ 144 | - (nullable UIImage *)ks_imageByRoundCornerRadius:(CGFloat)radius; 145 | 146 | /** 147 | Rounds a new image with a given corner size. 148 | 149 | @param radius The radius of each corner oval. Values larger than half the 150 | rectangle's width or height are clamped appropriately to 151 | half the width or height. 152 | 153 | @param borderWidth The inset border line width. Values larger than half the rectangle's 154 | width or height are clamped appropriately to half the width 155 | or height. 156 | 157 | @param borderColor The border stroke color. nil means clear color. 158 | */ 159 | - (nullable UIImage *)ks_imageByRoundCornerRadius:(CGFloat)radius 160 | borderWidth:(CGFloat)borderWidth 161 | borderColor:(nullable UIColor *)borderColor; 162 | 163 | /** 164 | Rounds a new image with a given corner size. 165 | 166 | @param radius The radius of each corner oval. Values larger than half the 167 | rectangle's width or height are clamped appropriately to 168 | half the width or height. 169 | 170 | @param corners A bitmask value that identifies the corners that you want 171 | rounded. You can use this parameter to round only a subset 172 | of the corners of the rectangle. 173 | 174 | @param borderWidth The inset border line width. Values larger than half the rectangle's 175 | width or height are clamped appropriately to half the width 176 | or height. 177 | 178 | @param borderColor The border stroke color. nil means clear color. 179 | 180 | @param borderLineJoin The border line join. 181 | */ 182 | - (nullable UIImage *)ks_imageByRoundCornerRadius:(CGFloat)radius 183 | corners:(UIRectCorner)corners 184 | borderWidth:(CGFloat)borderWidth 185 | borderColor:(nullable UIColor *)borderColor 186 | borderLineJoin:(CGLineJoin)borderLineJoin; 187 | 188 | /** 189 | Returns a new rotated image (relative to the center). 190 | 191 | @param radians Rotated radians in counterclockwise.⟲ 192 | 193 | @param fitSize YES: new image's size is extend to fit all content. 194 | NO: image's size will not change, content may be clipped. 195 | */ 196 | - (nullable UIImage *)ks_imageByRotate:(CGFloat)radians fitSize:(BOOL)fitSize; 197 | 198 | /** 199 | Returns a new image rotated counterclockwise by a quarter‑turn (90°). ⤺ 200 | The width and height will be exchanged. 201 | */ 202 | - (nullable UIImage *)ks_imageByRotateLeft90; 203 | 204 | /** 205 | Returns a new image rotated clockwise by a quarter‑turn (90°). ⤼ 206 | The width and height will be exchanged. 207 | */ 208 | - (nullable UIImage *)ks_imageByRotateRight90; 209 | 210 | /** 211 | Returns a new image rotated 180° . ↻ 212 | */ 213 | - (nullable UIImage *)ks_imageByRotate180; 214 | 215 | /** 216 | Returns a vertically flipped image. ⥯ 217 | */ 218 | - (nullable UIImage *)ks_imageByFlipVertical; 219 | 220 | /** 221 | Returns a horizontally flipped image. ⇋ 222 | */ 223 | - (nullable UIImage *)ks_imageByFlipHorizontal; 224 | 225 | 226 | #pragma mark - Image Effect 227 | ///============================================================================= 228 | /// @name Image Effect 229 | ///============================================================================= 230 | 231 | /** 232 | Tint the image in alpha channel with the given color. 233 | 234 | @param color The color. 235 | */ 236 | - (nullable UIImage *)ks_imageByTintColor:(UIColor *)color; 237 | 238 | /** 239 | Returns a grayscaled image. 240 | */ 241 | - (nullable UIImage *)ks_imageByGrayscale; 242 | 243 | /** 244 | Applies a blur effect to this image. Suitable for blur any content. 245 | */ 246 | - (nullable UIImage *)ks_imageByBlurSoft; 247 | 248 | /** 249 | Applies a blur effect to this image. Suitable for blur any content except pure white. 250 | (same as iOS Control Panel) 251 | */ 252 | - (nullable UIImage *)ks_imageByBlurLight; 253 | 254 | /** 255 | Applies a blur effect to this image. Suitable for displaying black text. 256 | (same as iOS Navigation Bar White) 257 | */ 258 | - (nullable UIImage *)ks_imageByBlurExtraLight; 259 | 260 | /** 261 | Applies a blur effect to this image. Suitable for displaying white text. 262 | (same as iOS Notification Center) 263 | */ 264 | - (nullable UIImage *)ks_imageByBlurDark; 265 | 266 | /** 267 | Applies a blur and tint color to this image. 268 | 269 | @param tintColor The tint color. 270 | */ 271 | - (nullable UIImage *)ks_imageByBlurWithTint:(UIColor *)tintColor; 272 | 273 | /** 274 | Applies a blur, tint color, and saturation adjustment to this image, 275 | optionally within the area specified by @a maskImage. 276 | 277 | @param blurRadius The radius of the blur in points, 0 means no blur effect. 278 | 279 | @param tintColor An optional UIColor object that is uniformly blended with 280 | the result of the blur and saturation operations. The 281 | alpha channel of this color determines how strong the 282 | tint is. nil means no tint. 283 | 284 | @param tintBlendMode The @a tintColor blend mode. Default is kCGBlendModeNormal (0). 285 | 286 | @param saturation A value of 1.0 produces no change in the resulting image. 287 | Values less than 1.0 will desaturation the resulting image 288 | while values greater than 1.0 will have the opposite effect. 289 | 0 means gray scale. 290 | 291 | @param maskImage If specified, @a inputImage is only modified in the area(s) 292 | defined by this mask. This must be an image mask or it 293 | must meet the requirements of the mask parameter of 294 | CGContextClipToMask. 295 | 296 | @return image with effect, or nil if an error occurs (e.g. no 297 | enough memory). 298 | */ 299 | - (nullable UIImage *)ks_imageByBlurRadius:(CGFloat)blurRadius 300 | tintColor:(nullable UIColor *)tintColor 301 | tintMode:(CGBlendMode)tintBlendMode 302 | saturation:(CGFloat)saturation 303 | maskImage:(nullable UIImage *)maskImage; 304 | 305 | @end 306 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Kyle Sun 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | KSPhotoBrowser 2 | ============== 3 | [![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/skx926/KSPhotoBrowser/master/LICENSE)  4 | [![CocoaPods](http://img.shields.io/cocoapods/v/KSPhotoBrowser.svg?style=flat)](http://cocoapods.org/?q=KSPhotoBrowser)  5 | [![CocoaPods](http://img.shields.io/cocoapods/p/KSPhotoBrowser.svg?style=flat)](http://cocoapods.org/?q=KSPhotoBrowser)  6 | [![Support](https://img.shields.io/badge/support-iOS%208.0%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  7 | 8 | ### A beautiful photo browser with interactive dismissal animation. 9 | 10 | ![Rotation~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Rotation.gif) 11 | ![Blur~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Blur.gif) 12 | ![Scale~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Scale.gif) 13 | ![Corner~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Corner.gif) 14 | ![Orientation~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Orientation.gif) 15 | ![Index~](https://raw.github.com/skx926/KSPhotoBrowser/master/Images/Index.png) 16 | 17 | 18 | Features 19 | ============== 20 | - [x] 4 different interactive dismissal animations (Rotation, Scale, Slide) 21 | - [x] 3 different background styles (Blur Photo, Blur, Black) 22 | - [x] 2 different loading styles (Determinate, Indeterminate) 23 | - [x] 2 different pager styles (Dot, Text) 24 | - [x] Support bounce animation 25 | - [x] Optimized for image which has a very large height 26 | - [x] Can display one or more images by providing either image urls or UIImage objects 27 | - [x] Custom image downloader library support 28 | - [x] Smooth animation with corner radius 29 | - [x] Support both portrait and landscape device orientation 30 | - [ ] Support video browse 31 | 32 | 33 | Usage 34 | ============== 35 | ### Display images from urls 36 | ```objc 37 | NSArray *urls = @[@"https://ww4.sinaimg.cn/bmiddle/a15bd3a5jw1f12r9ku6wjj20u00mhn22.jpg", 38 | @"https://ww2.sinaimg.cn/bmiddle/a15bd3a5jw1f01hkxyjhej20u00jzacj.jpg"]; 39 | NSMutableArray *items = @[].mutableCopy; 40 | for (int i = 0; i < urls.count; i++) { 41 | // Get the large image url 42 | NSString *url = [urls[i] stringByReplacingOccurrencesOfString:@"bmiddle" withString:@"large"]; 43 | UIImageView *imageView = _imageViews[i]; 44 | KSPhotoItem *item = [KSPhotoItem itemWithSourceView:imageView imageUrl:[NSURL URLWithString:url]]; 45 | [items addObject:item]; 46 | } 47 | KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:0]; 48 | [browser showFromViewController:self]; 49 | ``` 50 | 51 | ### Display images from UIImage objects 52 | ```objc 53 | NSArray *names = @[@"a.jpg", @"b.jpg"]; 54 | NSMutableArray *items = @[].mutableCopy; 55 | for (int i = 0; i < names.count; i++) { 56 | UIImageView *imageView = _imageViews[i]; 57 | KSPhotoItem *item = [KSPhotoItem itemWithSourceView:imageView image:[UIImage imageNamed:names[i]]]; 58 | [items addObject:item]; 59 | } 60 | KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:0]; 61 | [browser showFromViewController:self]; 62 | ``` 63 | 64 | Installation 65 | ============== 66 | ### Cocoapods 67 | 1. Update cocoapods to the latest version. 68 | 2. Add `pod 'KSPhotoBrowser'` to your Podfile. 69 | 3. Run `pod install` or `pod update`. 70 | 4. Import `KSPhotoBrowser.h`. 71 | 72 | 73 | ### Manually 74 | 1. Download all the files of KSPhotoBrowser and add source files to your project. 75 | 2. Manually install [SDWebImage](https://github.com/rs/SDWebImage) to your project. 76 | 3. Import `KSPhotoBrowser.h`. 77 | 78 | ### Custom Image Downloader 79 | It use `SDWebImage` as default image downloader, you can also use your custom image downloader like `YYWebImage`, `Kingfisher` and so on. 80 | 81 | To use a custom image downloader, you need to create a class and make it conforms to `KSImageManagerProtocol` and implement those methods inside that protocol. 82 | 83 | For convenience, I have already created `KSYYImageManager` to support `YYWebImage` as an example in the demo, you can also use it directly. 84 | 85 | Finally, just use the code below to set your class to `KSPhotoBrowser` before you use the browser to show images. 86 | 87 | ```objc 88 | [KSPhotoBrowser setImageManagerClass:KSYYImageManager.class] 89 | ``` 90 | 91 | Requirements 92 | ============== 93 | This library requires `iOS 8.0+` and `Xcode 8.0+`. 94 | 95 | 96 | License 97 | ============== 98 | KSPhotoBrowser is provided under the MIT license. See LICENSE file for details. 99 | --------------------------------------------------------------------------------