├── JZLPhotoBrowser ├── Podfile.lock ├── Pods │ ├── Manifest.lock │ └── Target Support Files │ │ └── Pods-JZLPhotoBrowser │ │ ├── Pods-JZLPhotoBrowser.modulemap │ │ ├── Pods-JZLPhotoBrowser-acknowledgements.markdown │ │ ├── Pods-JZLPhotoBrowser-dummy.m │ │ ├── Pods-JZLPhotoBrowser.debug.xcconfig │ │ ├── Pods-JZLPhotoBrowser.release.xcconfig │ │ ├── Pods-JZLPhotoBrowser-umbrella.h │ │ ├── Info.plist │ │ └── Pods-JZLPhotoBrowser-acknowledgements.plist ├── JZLPhotoBrowser │ ├── Third │ │ ├── SDWebImage │ │ │ ├── .svn │ │ │ │ ├── prop-base │ │ │ │ │ ├── SDImageCache.h.svn-base │ │ │ │ │ ├── SDImageCache.m.svn-base │ │ │ │ │ ├── UIImage+GIF.h.svn-base │ │ │ │ │ ├── UIImage+GIF.m.svn-base │ │ │ │ │ ├── UIImage+WebP.h.svn-base │ │ │ │ │ ├── UIImage+WebP.m.svn-base │ │ │ │ │ ├── SDWebImageCompat.h.svn-base │ │ │ │ │ ├── SDWebImageCompat.m.svn-base │ │ │ │ │ ├── SDWebImageDecoder.h.svn-base │ │ │ │ │ ├── SDWebImageDecoder.m.svn-base │ │ │ │ │ ├── SDWebImageManager.h.svn-base │ │ │ │ │ ├── SDWebImageManager.m.svn-base │ │ │ │ │ ├── SDWebImageOperation.h.svn-base │ │ │ │ │ ├── UIButton+WebCache.h.svn-base │ │ │ │ │ ├── UIButton+WebCache.m.svn-base │ │ │ │ │ ├── UIImage+MultiFormat.h.svn-base │ │ │ │ │ ├── UIImage+MultiFormat.m.svn-base │ │ │ │ │ ├── NSData+ImageContentType.h.svn-base │ │ │ │ │ ├── NSData+ImageContentType.m.svn-base │ │ │ │ │ ├── SDWebImageDownloader.h.svn-base │ │ │ │ │ ├── SDWebImageDownloader.m.svn-base │ │ │ │ │ ├── SDWebImagePrefetcher.h.svn-base │ │ │ │ │ ├── SDWebImagePrefetcher.m.svn-base │ │ │ │ │ ├── UIImageView+WebCache.h.svn-base │ │ │ │ │ ├── UIImageView+WebCache.m.svn-base │ │ │ │ │ ├── UIView+WebCacheOperation.h.svn-base │ │ │ │ │ ├── UIView+WebCacheOperation.m.svn-base │ │ │ │ │ ├── MKAnnotationView+WebCache.h.svn-base │ │ │ │ │ ├── MKAnnotationView+WebCache.m.svn-base │ │ │ │ │ ├── SDWebImageDownloaderOperation.h.svn-base │ │ │ │ │ ├── SDWebImageDownloaderOperation.m.svn-base │ │ │ │ │ ├── UIImageView+HighlightedWebCache.h.svn-base │ │ │ │ │ └── UIImageView+HighlightedWebCache.m.svn-base │ │ │ │ └── text-base │ │ │ │ │ ├── UIImage+MultiFormat.h.svn-base │ │ │ │ │ ├── SDWebImageOperation.h.svn-base │ │ │ │ │ ├── UIImage+GIF.h.svn-base │ │ │ │ │ ├── SDWebImageDecoder.h.svn-base │ │ │ │ │ ├── UIImage+WebP.h.svn-base │ │ │ │ │ ├── NSData+ImageContentType.h.svn-base │ │ │ │ │ ├── UIView+WebCacheOperation.h.svn-base │ │ │ │ │ ├── NSData+ImageContentType.m.svn-base │ │ │ │ │ ├── SDWebImageCompat.m.svn-base │ │ │ │ │ ├── SDWebImageCompat.h.svn-base │ │ │ │ │ ├── UIView+WebCacheOperation.m.svn-base │ │ │ │ │ ├── UIImage+WebP.m.svn-base │ │ │ │ │ ├── SDWebImageDecoder.m.svn-base │ │ │ │ │ ├── SDWebImageDownloaderOperation.h.svn-base │ │ │ │ │ ├── UIImage+MultiFormat.m.svn-base │ │ │ │ │ ├── SDWebImagePrefetcher.h.svn-base │ │ │ │ │ ├── UIImageView+HighlightedWebCache.m.svn-base │ │ │ │ │ ├── MKAnnotationView+WebCache.m.svn-base │ │ │ │ │ ├── UIImageView+HighlightedWebCache.h.svn-base │ │ │ │ │ └── UIImage+GIF.m.svn-base │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── UIImage+WebP.h │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── UIView+WebCacheOperation.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── SDWebImageCompat.m │ │ │ ├── SDWebImageCompat.h │ │ │ ├── UIView+WebCacheOperation.m │ │ │ ├── UIImage+WebP.m │ │ │ ├── SDWebImageDecoder.m │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── UIImage+MultiFormat.m │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── MKAnnotationView+WebCache.m │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImage+GIF.m │ │ │ └── SDWebImagePrefetcher.m │ │ ├── JGProgressHUD │ │ │ ├── JGProgressHUD │ │ │ │ ├── JGProgressHUD Resources.bundle │ │ │ │ │ ├── jg_hud_error.png │ │ │ │ │ ├── jg_hud_error@2x.png │ │ │ │ │ ├── jg_hud_error@3x.png │ │ │ │ │ ├── jg_hud_success.png │ │ │ │ │ ├── jg_hud_success@2x.png │ │ │ │ │ └── jg_hud_success@3x.png │ │ │ │ ├── JGProgressHUDErrorIndicatorView.h │ │ │ │ ├── JGProgressHUDSuccessIndicatorView.h │ │ │ │ ├── JGProgressHUDImageIndicatorView.m │ │ │ │ ├── JGProgressHUDFadeAnimation.h │ │ │ │ ├── JGProgressHUDImageIndicatorView.h │ │ │ │ ├── JGProgressHUDIndeterminateIndicatorView.h │ │ │ │ ├── JGProgressHUDFadeZoomAnimation.h │ │ │ │ ├── JGProgressHUDPieIndicatorView.h │ │ │ │ ├── JGProgressHUDAnimation.m │ │ │ │ ├── JGProgressHUDErrorIndicatorView.m │ │ │ │ ├── JGProgressHUDSuccessIndicatorView.m │ │ │ │ ├── JGProgressHUDIndeterminateIndicatorView.m │ │ │ │ ├── JGProgressHUDRingIndicatorView.h │ │ │ │ ├── JGProgressHUDFadeAnimation.m │ │ │ │ ├── JGProgressHUDAnimation.h │ │ │ │ ├── JGProgressHUDIndicatorView.h │ │ │ │ ├── JGProgressHUD-Defines.h │ │ │ │ ├── JGProgressHUDIndicatorView.m │ │ │ │ ├── JGProgressHUDFadeZoomAnimation.m │ │ │ │ └── JGProgressHUDPieIndicatorView.m │ │ │ ├── JGProgressHUD-Prefix.pch │ │ │ └── JGProgressHUD Framework │ │ │ │ └── Info.plist │ │ └── Masonry │ │ │ ├── MASLayoutConstraint.m │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── Info.plist │ │ │ ├── Masonry.h │ │ │ ├── ViewController+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── MASViewAttribute.m │ │ │ ├── MASViewAttribute.h │ │ │ ├── ViewController+MASAdditions.m │ │ │ ├── MASViewConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ └── MASCompositeConstraint.m │ ├── Img │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ ├── 9.jpg │ │ └── placeholder.jpg │ ├── ViewController.h │ ├── LocalViewController.h │ ├── JZLPhotoBrowser │ │ ├── JZLPhoto.h │ │ ├── JZLProgressView.h │ │ ├── JZLPhoto.m │ │ ├── JZLPhotoBrowser.h │ │ └── JZLProgressView.m │ ├── AppDelegate.h │ ├── LocalCollectionViewCell.h │ ├── main.m │ ├── LocalCollectionViewCell.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── AppDelegate.m │ ├── ViewController.m │ └── LocalViewController.m ├── JZLPhotoBrowser.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Podfile ├── README.md └── .gitignore /JZLPhotoBrowser/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: 6a8c1a895caa6dfc3f17f6e1d0ce7ceda1819423 2 | 3 | COCOAPODS: 1.5.3 4 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODFILE CHECKSUM: 6a8c1a895caa6dfc3f17f6e1d0ce7ceda1819423 2 | 3 | COCOAPODS: 1.5.3 4 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDImageCache.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDImageCache.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+GIF.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+GIF.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+WebP.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+WebP.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/1.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/2.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/3.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/4.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/5.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/6.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/7.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/8.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/9.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageCompat.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageCompat.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDecoder.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDecoder.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageManager.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageManager.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageOperation.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIButton+WebCache.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIButton+WebCache.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+MultiFormat.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImage+MultiFormat.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/NSData+ImageContentType.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/NSData+ImageContentType.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDownloader.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDownloader.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImagePrefetcher.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImagePrefetcher.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImageView+WebCache.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImageView+WebCache.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIView+WebCacheOperation.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIView+WebCacheOperation.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/MKAnnotationView+WebCache.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/MKAnnotationView+WebCache.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDownloaderOperation.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/SDWebImageDownloaderOperation.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImageView+HighlightedWebCache.h.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/prop-base/UIImageView+HighlightedWebCache.m.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 0 4 | 5 | END 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Img/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Img/placeholder.jpg -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_JZLPhotoBrowser { 2 | umbrella header "Pods-JZLPhotoBrowser-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JZLPhotoBrowser : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JZLPhotoBrowser 5 | @end 6 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error@2x.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_error@3x.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success@2x.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/allenjzl/JZlPhotoBrowser/HEAD/JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle/jg_hud_success@3x.png -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/LocalViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocalViewController.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LocalViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | 4 | target 'JZLPhotoBrowser' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for JZLPhotoBrowser 9 | 10 | 11 | end 12 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser/JZLPhoto.h: -------------------------------------------------------------------------------- 1 | // 2 | // JZLPhoto.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/7/4. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JZLPhoto : UIImageView 12 | /** 大图url */ 13 | @property (nonatomic, strong) NSMutableArray *bigImageUrl; 14 | @end 15 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser/JZLProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JZLProgressView.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/7/14. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JZLProgressView : UIView 12 | /** 下载进度 */ 13 | @property (nonatomic, assign) CGFloat progress; 14 | @end 15 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. 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 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/LocalCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LocalCollectionViewCell.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LocalCollectionViewCell : UICollectionViewCell 12 | @property (nonatomic, strong) UIImageView *imageView; 13 | @end 14 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+MultiFormat.h.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. 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 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageOperation.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_JZLPhotoBrowserVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_JZLPhotoBrowserVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDErrorIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDErrorIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.08.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDImageIndicatorView.h" 10 | 11 | @interface JGProgressHUDErrorIndicatorView : JGProgressHUDImageIndicatorView 12 | 13 | /** 14 | Default initializer for this class. 15 | */ 16 | - (instancetype)init; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDSuccessIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDSuccessIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.08.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDImageIndicatorView.h" 10 | 11 | @interface JGProgressHUDSuccessIndicatorView : JGProgressHUDImageIndicatorView 12 | 13 | /** 14 | Default initializer for this class. 15 | */ 16 | - (instancetype)init; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+GIF.h.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageDecoder.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDImageIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDImageIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 05.08.15. 6 | // Copyright (c) 2015 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDImageIndicatorView.h" 10 | 11 | @implementation JGProgressHUDImageIndicatorView 12 | 13 | - (instancetype)initWithImage:(UIImage *)image { 14 | UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; 15 | 16 | self = [super initWithContentView:imageView]; 17 | 18 | return self; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+WebP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | 11 | #import 12 | 13 | // Fix for issue #416 Undefined symbols for architecture armv7 since WebP introduction when deploying to device 14 | void WebPInitPremultiplyNEON(void); 15 | 16 | void WebPInitUpsamplersNEON(void); 17 | 18 | void VP8DspInitNEON(void); 19 | 20 | @interface UIImage (WebP) 21 | 22 | + (UIImage *)sd_imageWithWebPData:(NSData *)data; 23 | 24 | @end 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+WebP.h.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | 11 | #import 12 | 13 | // Fix for issue #416 Undefined symbols for architecture armv7 since WebP introduction when deploying to device 14 | void WebPInitPremultiplyNEON(void); 15 | 16 | void WebPInitUpsamplersNEON(void); 17 | 18 | void VP8DspInitNEON(void); 19 | 20 | @interface UIImage (WebP) 21 | 22 | + (UIImage *)sd_imageWithWebPData:(NSData *)data; 23 | 24 | @end 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser/JZLPhoto.m: -------------------------------------------------------------------------------- 1 | // 2 | // JZLPhoto.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/7/4. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "JZLPhoto.h" 10 | 11 | @implementation JZLPhoto 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | 18 | } 19 | return self; 20 | } 21 | 22 | 23 | 24 | - (NSMutableArray *)bigImageUrl { 25 | if (!_bigImageUrl) { 26 | _bigImageUrl = [NSMutableArray array]; 27 | } 28 | return _bigImageUrl; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDFadeAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDFadeAnimation.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDAnimation.h" 10 | 11 | @interface JGProgressHUDFadeAnimation : JGProgressHUDAnimation 12 | 13 | /** 14 | Duration of the animation. 15 | 16 | @b Default: 0.4. 17 | */ 18 | @property (nonatomic, assign) NSTimeInterval duration; 19 | 20 | /** 21 | Animation options 22 | 23 | @b Default: UIViewAnimationOptionCurveEaseInOut. 24 | */ 25 | @property (nonatomic, assign) UIViewAnimationOptions animationOptions; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/NSData+ImageContentType.h.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDImageIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDImageIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 05.08.15. 6 | // Copyright (c) 2015 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDIndicatorView.h" 10 | 11 | /** 12 | An indicator for displaying custom images. Supports animated images. 13 | 14 | You may subclass this class to create a custom image indicator view. 15 | */ 16 | @interface JGProgressHUDImageIndicatorView : JGProgressHUDIndicatorView 17 | 18 | /** 19 | Initializes the indicator view with an UIImageView showing the @c image. 20 | 21 | @param image The image to show in the indicator view. 22 | */ 23 | - (instancetype)initWithImage:(UIImage *)image; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/LocalCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocalCollectionViewCell.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "LocalCollectionViewCell.h" 10 | 11 | @implementation LocalCollectionViewCell 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | [self.contentView addSubview:self.imageView]; 24 | } 25 | return self; 26 | } 27 | 28 | 29 | 30 | 31 | - (UIImageView *)imageView { 32 | if (!_imageView) { 33 | _imageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds]; 34 | } 35 | 36 | return _imageView; 37 | } 38 | 39 | 40 | 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDIndeterminateIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDIndeterminateIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.07.14. 6 | // Copyright (c) 2014 Hardtack. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUD-Defines.h" 10 | #import "JGProgressHUDIndicatorView.h" 11 | 12 | @interface JGProgressHUDIndeterminateIndicatorView : JGProgressHUDIndicatorView 13 | 14 | /** 15 | Initializes the indicator view and sets the correct color to match the HUD style. 16 | */ 17 | - (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style; 18 | 19 | /** 20 | Set the color of the activity indicator view. 21 | @param color The color to apply to the activity indicator view. 22 | */ 23 | - (void)setColor:(UIColor *)color; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JZlPhotoBrowser 2 | 简单的封装图片浏览器,一句代码调用,简单易用 3 | 4 | 1.封装图片浏览器,调用的时候直接把JZLPhotoBrowser文件夹拖入到自己的项目,导入头文件即可 5 | 6 | 2.#import "JZLPhotoBrowser.h" 7 | 8 | 3.一句代码调用,对于自己项目中的图片用collectionView做的,在点击的代理方法中调用代码,如果是直接创建的imageView,在imageView的点击事件中调用代码 9 | 10 | ``` 11 | [JZLPhotoBrowser showPhotoBrowserWithUrlArr:urlArr currentIndex:indexPath.row originalImageViewArr:self.frameArr]; 12 | ``` 13 | 14 | 15 | 4.注意点: 16 | 17 |  1. demo中导入了三个第三方库,其中masonry是demo布局用到的,SDWebImage和JGPProgressHUD是图片浏览器用到的,如果自己的项目缺少这两个库,注意一下(SDWebImage肯定不会缺少,HUD可能每个人用的不一样,可以把我的替换掉,用自己项目中集成的HUD) 18 | 19 |  2.如果保存图片崩掉的话注意看一下自己的项目相册权限有没有添加 20 | 21 |  3.图片的缩放效果必须传入原imageView才会有,不然就只有默认的效果 22 | 23 |  4.没有仔细的测试,如果发现bug请提出来,继续改进 24 | 25 |  5.图片选择器还没写,后期继续完成 26 | 27 |  6.如果能帮助到你,请star一下,给我动力继续努力 28 | 29 |  5.特别感谢: 30 |  框架参考了JLPhotoBrowser这个图片浏览器,参考了下大体的思路,然后自己又进一步的封装,然后增加了一些新的功能,谢谢! 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDFadeZoomAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDFadeZoomAnimation.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDAnimation.h" 10 | 11 | @interface JGProgressHUDFadeZoomAnimation : JGProgressHUDAnimation 12 | 13 | /** 14 | Duration of the animation from or to the shrinked state. 15 | 16 | @b Default: 0.2. 17 | */ 18 | @property (nonatomic, assign) NSTimeInterval shrinkAnimationDuaration; 19 | 20 | /** 21 | Duration of the animation from or to the expanded state. 22 | 23 | @b Default: 0.1. 24 | */ 25 | @property (nonatomic, assign) NSTimeInterval expandAnimationDuaration; 26 | 27 | /** 28 | The scale to apply to the HUD when expanding. 29 | 30 | @b Default: (1.1f, 1.1f). 31 | */ 32 | @property (nonatomic, assign) CGSize expandScale; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD Framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | JGProgressHUD 25 | 26 | 27 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDPieIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDPieIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.07.14. 6 | // Copyright (c) 2014 Hardtack. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUD-Defines.h" 10 | #import "JGProgressHUDIndicatorView.h" 11 | 12 | @interface JGProgressHUDPieIndicatorView : JGProgressHUDIndicatorView 13 | 14 | /** 15 | Initializes the indicator view and sets the correct color to match the HUD style. 16 | */ 17 | - (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style; 18 | 19 | /** 20 | Tint color of the Pie. 21 | 22 | @b Default: White for JGProgressHUDStyleDark, otherwise black. 23 | */ 24 | @property (nonatomic, strong) UIColor *color; 25 | 26 | /** 27 | The background fill color inside the pie. 28 | 29 | @b Default: Dark gray for JGProgressHUDStyleDark, otherwise light gray. 30 | */ 31 | @property (nonatomic, strong) UIColor *fillColor; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/Pods/Target Support Files/Pods-JZLPhotoBrowser/Pods-JZLPhotoBrowser-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 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDAnimation.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDAnimation.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @interface JGProgressHUD (Private) 13 | 14 | - (void)animationDidFinish:(BOOL)presenting; 15 | 16 | @end 17 | 18 | @interface JGProgressHUDAnimation () { 19 | BOOL _presenting; 20 | } 21 | 22 | @property (nonatomic, weak) JGProgressHUD *progressHUD; 23 | 24 | @end 25 | 26 | @implementation JGProgressHUDAnimation 27 | 28 | #pragma mark - Initializers 29 | 30 | + (instancetype)animation { 31 | return [[self alloc] init]; 32 | } 33 | 34 | #pragma mark - Public methods 35 | 36 | - (void)show { 37 | _presenting = YES; 38 | } 39 | 40 | - (void)hide { 41 | _presenting = NO; 42 | } 43 | 44 | - (void)animationFinished { 45 | [self.progressHUD animationDidFinish:_presenting]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDErrorIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDErrorIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.08.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDErrorIndicatorView.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @implementation JGProgressHUDErrorIndicatorView 13 | 14 | - (instancetype)initWithContentView:(UIView *__unused)contentView { 15 | NSBundle *resourceBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[JGProgressHUD class]] pathForResource:@"JGProgressHUD Resources" ofType:@"bundle"]]; 16 | 17 | NSString *imgPath = [resourceBundle pathForResource:@"jg_hud_error" ofType:@"png"]; 18 | 19 | self = [super initWithImage:[UIImage imageWithContentsOfFile:imgPath]]; 20 | 21 | return self; 22 | } 23 | 24 | - (instancetype)init { 25 | return [self initWithContentView:nil]; 26 | } 27 | 28 | - (void)updateAccessibility { 29 | self.accessibilityLabel = NSLocalizedString(@"Error",); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDSuccessIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDSuccessIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.08.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDSuccessIndicatorView.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @implementation JGProgressHUDSuccessIndicatorView 13 | 14 | - (instancetype)initWithContentView:(UIView *__unused)contentView { 15 | NSBundle *resourceBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[JGProgressHUD class]] pathForResource:@"JGProgressHUD Resources" ofType:@"bundle"]]; 16 | 17 | NSString *imgPath = [resourceBundle pathForResource:@"jg_hud_success" ofType:@"png"]; 18 | 19 | self = [super initWithImage:[UIImage imageWithContentsOfFile:imgPath]]; 20 | 21 | return self; 22 | } 23 | 24 | - (instancetype)init { 25 | return [self initWithContentView:nil]; 26 | } 27 | 28 | - (void)updateAccessibility { 29 | self.accessibilityLabel = NSLocalizedString(@"Success",); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // JZLPhotoBrowser.h 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JZLPhotoBrowser : UIView 12 | /** 存放JZLPhoto */ 13 | @property (nonatomic, strong) NSMutableArray *photos; 14 | /** 存放图片url */ 15 | @property (nonatomic, strong) NSArray *urlArr; 16 | /** 点击的下标 */ 17 | @property (nonatomic, assign) NSInteger index; 18 | /** 索引显示 */ 19 | @property (nonatomic, strong) UILabel *indexLbl; 20 | /** 保存按钮 */ 21 | @property (nonatomic, strong) UIButton *saveBtn; 22 | /** 原始图片 */ 23 | @property (nonatomic, strong) NSMutableArray *originalImageViewArr; 24 | /** 没涨图片的父视图(小的scrollview) */ 25 | @property (nonatomic, strong) NSMutableArray *smallScViewArray; 26 | 27 | 28 | /** 29 | * 返回图片浏览器 30 | */ 31 | + (instancetype)photoBrowser; 32 | 33 | 34 | + (instancetype)showPhotoBrowserWithUrlArr:(NSArray *)urlArr currentIndex:(NSInteger)index originalImageViewArr:(NSArray *)originalImageViewArr ; 35 | 36 | 37 | /** 38 | 展示图片浏览器 39 | */ 40 | - (void)show; 41 | @end 42 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIView+WebCacheOperation.h.svn-base: -------------------------------------------------------------------------------- 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 "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDIndeterminateIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDIndeterminateIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.07.14. 6 | // Copyright (c) 2014 Hardtack. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDIndeterminateIndicatorView.h" 10 | 11 | @implementation JGProgressHUDIndeterminateIndicatorView 12 | 13 | - (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style { 14 | UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 15 | [activityIndicatorView startAnimating]; 16 | self = [super initWithContentView:activityIndicatorView]; 17 | 18 | if (self) { 19 | if (style != JGProgressHUDStyleDark) { 20 | self.color = [UIColor blackColor]; 21 | } 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (instancetype)init { 28 | return [self initWithHUDStyle:0]; 29 | } 30 | 31 | - (void)setColor:(UIColor *)color { 32 | [(UIActivityIndicatorView *)self.contentView setColor:color]; 33 | } 34 | 35 | - (void)updateAccessibility { 36 | self.accessibilityLabel = NSLocalizedString(@"Indeterminate progress",); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDRingIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDRingIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUD-Defines.h" 10 | #import "JGProgressHUDIndicatorView.h" 11 | 12 | @interface JGProgressHUDRingIndicatorView : JGProgressHUDIndicatorView 13 | 14 | /** 15 | Initializes the indicator view and sets the correct color to match the HUD style. 16 | */ 17 | - (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style; 18 | 19 | /** 20 | Background color of the ring. 21 | 22 | @b Default: Black for JGProgressHUDStyleDark, light gray otherwise. 23 | */ 24 | @property (nonatomic, strong) UIColor *ringBackgroundColor; 25 | 26 | /** 27 | Progress color of the progress ring. 28 | 29 | @b Default: White for JGProgressHUDStyleDark, otherwise black. 30 | */ 31 | @property (nonatomic, strong) UIColor *ringColor; 32 | 33 | /** 34 | Sets if the progress ring should have rounded corners. 35 | 36 | @b Default: NO. 37 | */ 38 | @property (nonatomic, assign) BOOL roundProgressLine; 39 | 40 | /** 41 | Width of the ring. 42 | 43 | @b Default: 3.0. 44 | */ 45 | @property (nonatomic, assign) CGFloat ringWidth; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/NSData+ImageContentType.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPhotoLibraryUsageDescription 6 | APP需要访问您的相册 7 | NSAppTransportSecurity 8 | 9 | NSAllowsArbitraryLoads 10 | 11 | 12 | CFBundleDevelopmentRegion 13 | en 14 | CFBundleExecutable 15 | $(PRODUCT_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | $(PRODUCT_NAME) 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | 1.0 26 | CFBundleVersion 27 | 1 28 | LSRequiresIPhoneOS 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDFadeAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDFadeAnimation.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDFadeAnimation.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @implementation JGProgressHUDFadeAnimation 13 | 14 | #pragma mark - Initializers 15 | 16 | - (instancetype)init { 17 | self = [super init]; 18 | if (self) { 19 | self.duration = 0.4; 20 | self.animationOptions = UIViewAnimationOptionCurveEaseInOut; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)setAnimationOptions:(UIViewAnimationOptions)animationOptions { 26 | _animationOptions = (animationOptions | UIViewAnimationOptionBeginFromCurrentState); 27 | } 28 | 29 | #pragma mark - Showing 30 | 31 | - (void)show { 32 | [super show]; 33 | 34 | self.progressHUD.alpha = 0.0f; 35 | 36 | self.progressHUD.hidden = NO; 37 | 38 | [UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{ 39 | self.progressHUD.alpha = 1.0f; 40 | } completion:^(BOOL __unused finished) { 41 | [self animationFinished]; 42 | }]; 43 | } 44 | 45 | #pragma mark - Hiding 46 | 47 | - (void)hide { 48 | [super hide]; 49 | 50 | [UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{ 51 | self.progressHUD.alpha = 0.0f; 52 | } completion:^(BOOL __unused finished) { 53 | [self animationFinished]; 54 | }]; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /.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 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDAnimation.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class JGProgressHUD; 13 | 14 | /** 15 | You may subclass this class to create a custom progress indicator view. 16 | */ 17 | @interface JGProgressHUDAnimation : NSObject 18 | 19 | /** 20 | Convenience method for initializing an animation. 21 | */ 22 | + (instancetype)animation; 23 | 24 | 25 | 26 | 27 | /** 28 | The HUD which uses this animation. 29 | */ 30 | @property (nonatomic, weak, readonly) JGProgressHUD *progressHUD; 31 | 32 | /** 33 | The @c progressHUD is hidden from screen with @c alpha = 1 and @c hidden = @c YES. Ideally, you should prepare the HUD for presentation, then set @c hidden to @c NO on the @c progressHUD and then perform the animation. 34 | @post Call @c animationFinished. 35 | */ 36 | - (void)show NS_REQUIRES_SUPER; 37 | 38 | /** 39 | The @c progressHUD wis visible on screen with @c alpha = 1 and @c hidden = @c NO. You should only perform the animation in this method, the @c progressHUD itself will take care of hiding itself and removing itself from superview. 40 | @post Call @c animationFinished. 41 | */ 42 | - (void)hide NS_REQUIRES_SUPER; 43 | 44 | /** 45 | @pre This method should only be called at the end of a @c show or @c hide animaiton. 46 | @attention ALWAYS call this method after completing a @c show or @c hide animation. 47 | */ 48 | - (void)animationFinished NS_REQUIRES_SUPER; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/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 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. or @3x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x./@3x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | 39 | range = [key rangeOfString:@"@3x." options:0 range:NSMakeRange(key.length - 8, 5)]; 40 | if (range.location != NSNotFound) { 41 | scale = 3.0; 42 | } 43 | } 44 | 45 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 46 | image = scaledImage; 47 | } 48 | return image; 49 | } 50 | } 51 | 52 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 53 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/JZLPhotoBrowser/JZLProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JZLProgressView.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/7/14. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "JZLProgressView.h" 10 | 11 | @implementation JZLProgressView 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | self.backgroundColor = [UIColor clearColor]; 17 | } 18 | return self; 19 | } 20 | 21 | 22 | - (void)drawRect:(CGRect)rect { 23 | //画外圆 24 | CGContextRef context = UIGraphicsGetCurrentContext(); 25 | [[UIColor whiteColor] set]; 26 | 27 | CGContextSetLineWidth(context, 2); 28 | CGContextAddArc(context, rect.size.width / 2, rect.size.height / 2, 22, 0, M_PI * 2, 0); 29 | // CGContextDrawPath(context, kCGPathStroke); 30 | CGContextStrokePath(context); 31 | //画内园 32 | 33 | 34 | CGContextSetLineWidth(context, 20); 35 | CGContextAddArc(context, rect.size.width / 2, rect.size.height / 2, 10, -M_PI/2, -M_PI/2 + M_PI * 2 * self.progress , 0); 36 | // CGContextDrawPath(context, kCGPathFill); 37 | CGContextStrokePath(context); 38 | 39 | // //画扇形,也就画圆,只不过是设置角度的大小,形成一个扇形 40 | //// aColor = [UIColor colorWithRed:0 green:1 blue:1 alpha:1]; 41 | // CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);//填充颜色 42 | // //以10为半径围绕圆心画指定角度扇形 43 | // CGContextMoveToPoint(context, rect.size.width / 2, rect.size.height / 2); 44 | // CGContextAddArc(context, rect.size.width / 2, rect.size.height / 2, 10, -M_PI/2, -M_PI/2 + M_PI * 2 * self.progress , 0); 45 | // CGContextClosePath(context); 46 | // CGContextDrawPath(context, kCGPathFillStroke); //绘制路径 47 | 48 | 49 | 50 | 51 | } 52 | 53 | - (void)setProgress:(CGFloat)progress { 54 | if (_progress != progress) { 55 | _progress = progress; 56 | } 57 | [self setNeedsDisplay]; 58 | } 59 | 60 | 61 | 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageCompat.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. or @3x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x./@3x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | 39 | range = [key rangeOfString:@"@3x." options:0 range:NSMakeRange(key.length - 8, 5)]; 40 | if (range.location != NSNotFound) { 41 | scale = 3.0; 42 | } 43 | } 44 | 45 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 46 | image = scaledImage; 47 | } 48 | return image; 49 | } 50 | } 51 | 52 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 53 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | extern NSString *const SDWebImageErrorDomain; 59 | 60 | #define dispatch_main_sync_safe(block)\ 61 | if ([NSThread isMainThread]) {\ 62 | block();\ 63 | } else {\ 64 | dispatch_sync(dispatch_get_main_queue(), block);\ 65 | } 66 | 67 | #define dispatch_main_async_safe(block)\ 68 | if ([NSThread isMainThread]) {\ 69 | block();\ 70 | } else {\ 71 | dispatch_async(dispatch_get_main_queue(), block);\ 72 | } 73 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDIndicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDIndicatorView.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | You may subclass this class to create a custom progress indicator view. 14 | */ 15 | @interface JGProgressHUDIndicatorView : UIView 16 | 17 | /** 18 | Designated initializer for this class. 19 | 20 | @param contentView The content view to place on the container view (the container is the JGProgressHUDIndicatorView). 21 | */ 22 | - (instancetype)initWithContentView:(UIView *)contentView; 23 | 24 | 25 | 26 | 27 | /** 28 | Ranges from 0.0 to 1.0. 29 | */ 30 | @property (nonatomic, assign) float progress; 31 | 32 | /** 33 | Adjusts the current progress shown by the receiver, optionally animating the change. 34 | 35 | The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits. 36 | 37 | @param progress The new progress value. 38 | @param animated YES if the change should be animated, NO if the change should happen immediately. 39 | */ 40 | - (void)setProgress:(float)progress animated:(BOOL)animated; 41 | 42 | /** 43 | The content view which displays the progress. 44 | */ 45 | @property (nonatomic, strong, readonly) UIView *contentView; 46 | 47 | /** 48 | Schedules an accessibility update on the next run loop. 49 | */ 50 | - (void)setNeedsAccessibilityUpdate; 51 | 52 | /** 53 | Runs @c updateAccessibility immediately if an accessibility update has been scheduled (through @c setNeedsAccessibilityUpdate) but has not executed yet. 54 | */ 55 | - (void)updateAccessibilityIfNeeded; 56 | 57 | /** 58 | Override to set custom accessibility properties. This method gets called once when initializing the view and after calling @c setNeedsAccessibilityUpdate. 59 | */ 60 | - (void)updateAccessibility; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageCompat.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | extern NSString *const SDWebImageErrorDomain; 59 | 60 | #define dispatch_main_sync_safe(block)\ 61 | if ([NSThread isMainThread]) {\ 62 | block();\ 63 | } else {\ 64 | dispatch_sync(dispatch_get_main_queue(), block);\ 65 | } 66 | 67 | #define dispatch_main_async_safe(block)\ 68 | if ([NSThread isMainThread]) {\ 69 | block();\ 70 | } else {\ 71 | dispatch_async(dispatch_get_main_queue(), block);\ 72 | } 73 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIView+WebCacheOperation.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 "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIView+WebCacheOperation.m.svn-base: -------------------------------------------------------------------------------- 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 "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+WebP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | #import "UIImage+WebP.h" 11 | #import "webp/decode.h" 12 | 13 | // Callback for CGDataProviderRelease 14 | static void FreeImageData(void *info, const void *data, size_t size) 15 | { 16 | free((void *)data); 17 | } 18 | 19 | @implementation UIImage (WebP) 20 | 21 | + (UIImage *)sd_imageWithWebPData:(NSData *)data { 22 | WebPDecoderConfig config; 23 | if (!WebPInitDecoderConfig(&config)) { 24 | return nil; 25 | } 26 | 27 | if (WebPGetFeatures(data.bytes, data.length, &config.input) != VP8_STATUS_OK) { 28 | return nil; 29 | } 30 | 31 | config.output.colorspace = config.input.has_alpha ? MODE_rgbA : MODE_RGB; 32 | config.options.use_threads = 1; 33 | 34 | // Decode the WebP image data into a RGBA value array. 35 | if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK) { 36 | return nil; 37 | } 38 | 39 | int width = config.input.width; 40 | int height = config.input.height; 41 | if (config.options.use_scaling) { 42 | width = config.options.scaled_width; 43 | height = config.options.scaled_height; 44 | } 45 | 46 | // Construct a UIImage from the decoded RGBA value array. 47 | CGDataProviderRef provider = 48 | CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData); 49 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); 50 | CGBitmapInfo bitmapInfo = config.input.has_alpha ? kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast : 0; 51 | size_t components = config.input.has_alpha ? 4 : 3; 52 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; 53 | CGImageRef imageRef = CGImageCreate(width, height, 8, components * 8, components * width, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent); 54 | 55 | CGColorSpaceRelease(colorSpaceRef); 56 | CGDataProviderRelease(provider); 57 | 58 | UIImage *image = [[UIImage alloc] initWithCGImage:imageRef]; 59 | CGImageRelease(imageRef); 60 | 61 | return image; 62 | } 63 | 64 | @end 65 | 66 | #if !COCOAPODS 67 | // Functions to resolve some undefined symbols when using WebP and force_load flag 68 | void WebPInitPremultiplyNEON(void) {} 69 | void WebPInitUpsamplersNEON(void) {} 70 | void VP8DspInitNEON(void) {} 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+WebP.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | #import "UIImage+WebP.h" 11 | #import "webp/decode.h" 12 | 13 | // Callback for CGDataProviderRelease 14 | static void FreeImageData(void *info, const void *data, size_t size) 15 | { 16 | free((void *)data); 17 | } 18 | 19 | @implementation UIImage (WebP) 20 | 21 | + (UIImage *)sd_imageWithWebPData:(NSData *)data { 22 | WebPDecoderConfig config; 23 | if (!WebPInitDecoderConfig(&config)) { 24 | return nil; 25 | } 26 | 27 | if (WebPGetFeatures(data.bytes, data.length, &config.input) != VP8_STATUS_OK) { 28 | return nil; 29 | } 30 | 31 | config.output.colorspace = config.input.has_alpha ? MODE_rgbA : MODE_RGB; 32 | config.options.use_threads = 1; 33 | 34 | // Decode the WebP image data into a RGBA value array. 35 | if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK) { 36 | return nil; 37 | } 38 | 39 | int width = config.input.width; 40 | int height = config.input.height; 41 | if (config.options.use_scaling) { 42 | width = config.options.scaled_width; 43 | height = config.options.scaled_height; 44 | } 45 | 46 | // Construct a UIImage from the decoded RGBA value array. 47 | CGDataProviderRef provider = 48 | CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData); 49 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); 50 | CGBitmapInfo bitmapInfo = config.input.has_alpha ? kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast : 0; 51 | size_t components = config.input.has_alpha ? 4 : 3; 52 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; 53 | CGImageRef imageRef = CGImageCreate(width, height, 8, components * 8, components * width, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent); 54 | 55 | CGColorSpaceRelease(colorSpaceRef); 56 | CGDataProviderRelease(provider); 57 | 58 | UIImage *image = [[UIImage alloc] initWithCGImage:imageRef]; 59 | CGImageRelease(imageRef); 60 | 61 | return image; 62 | } 63 | 64 | @end 65 | 66 | #if !COCOAPODS 67 | // Functions to resolve some undefined symbols when using WebP and force_load flag 68 | void WebPInitPremultiplyNEON(void) {} 69 | void WebPInitUpsamplersNEON(void) {} 70 | void VP8DspInitNEON(void) {} 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | ViewController *rootVC = [[ViewController alloc] init]; 21 | UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:rootVC]; 22 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | self.window.rootViewController = navVC; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | // 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. 32 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 33 | } 34 | 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // 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. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | 42 | - (void)applicationWillEnterForeground:(UIApplication *)application { 43 | // 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. 44 | } 45 | 46 | 47 | - (void)applicationDidBecomeActive:(UIApplication *)application { 48 | // 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. 49 | } 50 | 51 | 52 | - (void)applicationWillTerminate:(UIApplication *)application { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUD-Defines.h: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUD-Defines.h 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 28.04.15. 6 | // Copyright (c) 2015 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Positions of the HUD. 13 | */ 14 | typedef NS_ENUM(NSUInteger, JGProgressHUDPosition) { 15 | /** Center position. */ 16 | JGProgressHUDPositionCenter = 0, 17 | /** Top left position. */ 18 | JGProgressHUDPositionTopLeft, 19 | /** Top center position. */ 20 | JGProgressHUDPositionTopCenter, 21 | /** Top right position. */ 22 | JGProgressHUDPositionTopRight, 23 | /** Center left position. */ 24 | JGProgressHUDPositionCenterLeft, 25 | /** Center right position. */ 26 | JGProgressHUDPositionCenterRight, 27 | /** Bottom left position. */ 28 | JGProgressHUDPositionBottomLeft, 29 | /** Bottom center position. */ 30 | JGProgressHUDPositionBottomCenter, 31 | /** Bottom right position. */ 32 | JGProgressHUDPositionBottomRight 33 | }; 34 | 35 | /** 36 | Appearance styles of the HUD. 37 | */ 38 | typedef NS_ENUM(NSUInteger, JGProgressHUDStyle) { 39 | /** Extra light HUD with dark elements. */ 40 | JGProgressHUDStyleExtraLight = 0, 41 | /** Light HUD with dark elemets. */ 42 | JGProgressHUDStyleLight, 43 | /** Dark HUD with light elements. */ 44 | JGProgressHUDStyleDark 45 | }; 46 | 47 | /** 48 | Interaction types. 49 | */ 50 | typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) { 51 | /** Block all touches. No interaction behin the HUD is possible. */ 52 | JGProgressHUDInteractionTypeBlockAllTouches = 0, 53 | /** Block touches on the HUD view. */ 54 | JGProgressHUDInteractionTypeBlockTouchesOnHUDView, 55 | /** Block no touches. */ 56 | JGProgressHUDInteractionTypeBlockNoTouches 57 | }; 58 | 59 | /** 60 | Parallax Modes. 61 | */ 62 | typedef NS_ENUM(NSUInteger, JGProgressHUDParallaxMode) { 63 | /** Follows the device setting for parallax. If "Reduce Motion" is enabled, no parallax effect is added to the HUD, if "Reduce Motion" is disabled the HUD will have a parallax effect. This behaviour is only supported on iOS 8 and higher. */ 64 | JGProgressHUDParallaxModeDevice = 0, 65 | /** Always adds a parallax effect to the HUD. Parallax is only supported on iOS 7 and higher. */ 66 | JGProgressHUDParallaxModeAlwaysOn, 67 | /** Never adds a parallax effect to the HUD. */ 68 | JGProgressHUDParallaxModeAlwaysOff 69 | }; 70 | 71 | #ifndef fequal 72 | /** 73 | Macro for safe floating point comparison (for internal use in JGProgressHUD). 74 | */ 75 | #define fequal(a,b) (fabs((a) - (b)) < FLT_EPSILON) 76 | #endif 77 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LocalViewController.h" 11 | 12 | @interface ViewController () 13 | @property (nonatomic, strong) UITableView *tableview; 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | [self setupUI]; 22 | } 23 | 24 | 25 | - (void)setupUI { 26 | [self.view addSubview:self.tableview]; 27 | 28 | 29 | 30 | } 31 | 32 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 33 | return 2; 34 | } 35 | 36 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 37 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseID" forIndexPath:indexPath]; 38 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 39 | if (indexPath.row == 0) { 40 | cell.textLabel.text = @"图片浏览器"; 41 | }else { 42 | cell.textLabel.text = @"图片选择器"; 43 | } 44 | return cell; 45 | 46 | 47 | } 48 | 49 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 50 | if (indexPath.row == 0) { 51 | LocalViewController *vc = [[LocalViewController alloc] init]; 52 | [self.navigationController pushViewController:vc animated:YES]; 53 | }else { 54 | UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:nil message:@"嘿嘿,图片选择器还没完成,以后会加上的,谢谢!" preferredStyle:UIAlertControllerStyleAlert]; 55 | UIAlertAction *ensureAc = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 56 | 57 | }]; 58 | 59 | 60 | [alertVc addAction:ensureAc]; 61 | 62 | [self presentViewController:alertVc animated:YES completion:^{ 63 | 64 | }]; 65 | } 66 | 67 | 68 | 69 | } 70 | 71 | 72 | 73 | 74 | 75 | 76 | #pragma mark - lazy 77 | - (UITableView *)tableview { 78 | if (!_tableview) { 79 | _tableview = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; 80 | _tableview.delegate = self; 81 | _tableview.dataSource = self; 82 | [_tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuseID"]; 83 | _tableview.rowHeight = 44; 84 | 85 | 86 | } 87 | return _tableview; 88 | } 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDIndicatorView.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @interface JGProgressHUDIndicatorView () { 13 | BOOL _accessibilityUpdateScheduled; 14 | } 15 | 16 | + (void)runBlock:(void (^)(void))block; 17 | 18 | @end 19 | 20 | NS_INLINE void runOnNextRunLoop(void (^block)(void)) { 21 | [[NSRunLoop currentRunLoop] performSelector:@selector(runBlock:) target:[JGProgressHUDIndicatorView class] argument:(id)block order:0 modes:@[NSRunLoopCommonModes]]; 22 | } 23 | 24 | @implementation JGProgressHUDIndicatorView 25 | 26 | #pragma mark - Initializers 27 | 28 | - (instancetype)initWithFrame:(CGRect __unused)frame { 29 | return [self init]; 30 | } 31 | 32 | - (instancetype)init { 33 | return [self initWithContentView:nil]; 34 | } 35 | 36 | - (instancetype)initWithContentView:(UIView *)contentView { 37 | self = [super initWithFrame:(contentView ? contentView.frame : CGRectMake(0.0f, 0.0f, 50.0f, 50.0f))]; 38 | if (self) { 39 | self.opaque = NO; 40 | self.backgroundColor = [UIColor clearColor]; 41 | 42 | self.isAccessibilityElement = YES; 43 | [self setNeedsAccessibilityUpdate]; 44 | 45 | if (contentView) { 46 | _contentView = contentView; 47 | 48 | [self addSubview:self.contentView]; 49 | } 50 | } 51 | return self; 52 | } 53 | 54 | #pragma mark - Accessibility 55 | 56 | + (void)runBlock:(void (^)(void))block { 57 | if (block != nil) { 58 | block(); 59 | } 60 | } 61 | 62 | - (void)setNeedsAccessibilityUpdate { 63 | if (!_accessibilityUpdateScheduled) { 64 | _accessibilityUpdateScheduled = YES; 65 | 66 | runOnNextRunLoop(^{ 67 | [self updateAccessibilityIfNeeded]; 68 | }); 69 | } 70 | } 71 | 72 | - (void)updateAccessibilityIfNeeded { 73 | if (_accessibilityUpdateScheduled) { 74 | [self updateAccessibility]; 75 | _accessibilityUpdateScheduled = NO; 76 | } 77 | } 78 | 79 | - (void)updateAccessibility { 80 | self.accessibilityLabel = [NSLocalizedString(@"Loading",) stringByAppendingFormat:@" %.f %%", self.progress]; 81 | } 82 | 83 | #pragma mark - Getters & Setters 84 | 85 | - (void)setProgress:(float)progress { 86 | [self setProgress:progress animated:NO]; 87 | } 88 | 89 | - (void)setProgress:(float)progress animated:(__unused BOOL)animated { 90 | if (fequal(self.progress, progress)) { 91 | return; 92 | } 93 | 94 | _progress = progress; 95 | 96 | [self setNeedsAccessibilityUpdate]; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageDecoder.m.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImageDownloaderOperation.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 "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | extern NSString *const SDWebImageDownloadStartNotification; 14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification; 15 | extern NSString *const SDWebImageDownloadStopNotification; 16 | extern NSString *const SDWebImageDownloadFinishNotification; 17 | 18 | @interface SDWebImageDownloaderOperation : NSOperation 19 | 20 | /** 21 | * The request used by the operation's connection. 22 | */ 23 | @property (strong, nonatomic, readonly) NSURLRequest *request; 24 | 25 | 26 | @property (assign, nonatomic) BOOL shouldDecompressImages; 27 | 28 | /** 29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 30 | * 31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 32 | */ 33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 34 | 35 | /** 36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 37 | * 38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 39 | */ 40 | @property (nonatomic, strong) NSURLCredential *credential; 41 | 42 | /** 43 | * The SDWebImageDownloaderOptions for the receiver. 44 | */ 45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 46 | 47 | /** 48 | * The expected size of data. 49 | */ 50 | @property (assign, nonatomic) NSInteger expectedSize; 51 | 52 | /** 53 | * The response returned by the operation's connection. 54 | */ 55 | @property (strong, nonatomic) NSURLResponse *response; 56 | 57 | /** 58 | * Initializes a `SDWebImageDownloaderOperation` object 59 | * 60 | * @see SDWebImageDownloaderOperation 61 | * 62 | * @param request the URL request 63 | * @param options downloader options 64 | * @param progressBlock the block executed when a new chunk of data arrives. 65 | * @note the progress block is executed on a background queue 66 | * @param completedBlock the block executed when the download is done. 67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 68 | * @param cancelBlock the block executed if the download (operation) is cancelled 69 | * 70 | * @return the initialized instance 71 | */ 72 | - (id)initWithRequest:(NSURLRequest *)request 73 | options:(SDWebImageDownloaderOptions)options 74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImageDownloaderOperation.h.svn-base: -------------------------------------------------------------------------------- 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 "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | extern NSString *const SDWebImageDownloadStartNotification; 14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification; 15 | extern NSString *const SDWebImageDownloadStopNotification; 16 | extern NSString *const SDWebImageDownloadFinishNotification; 17 | 18 | @interface SDWebImageDownloaderOperation : NSOperation 19 | 20 | /** 21 | * The request used by the operation's connection. 22 | */ 23 | @property (strong, nonatomic, readonly) NSURLRequest *request; 24 | 25 | 26 | @property (assign, nonatomic) BOOL shouldDecompressImages; 27 | 28 | /** 29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 30 | * 31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 32 | */ 33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 34 | 35 | /** 36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 37 | * 38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 39 | */ 40 | @property (nonatomic, strong) NSURLCredential *credential; 41 | 42 | /** 43 | * The SDWebImageDownloaderOptions for the receiver. 44 | */ 45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 46 | 47 | /** 48 | * The expected size of data. 49 | */ 50 | @property (assign, nonatomic) NSInteger expectedSize; 51 | 52 | /** 53 | * The response returned by the operation's connection. 54 | */ 55 | @property (strong, nonatomic) NSURLResponse *response; 56 | 57 | /** 58 | * Initializes a `SDWebImageDownloaderOperation` object 59 | * 60 | * @see SDWebImageDownloaderOperation 61 | * 62 | * @param request the URL request 63 | * @param options downloader options 64 | * @param progressBlock the block executed when a new chunk of data arrives. 65 | * @note the progress block is executed on a background queue 66 | * @param completedBlock the block executed when the download is done. 67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 68 | * @param cancelBlock the block executed if the download (operation) is cancelled 69 | * 70 | * @return the initialized instance 71 | */ 72 | - (id)initWithRequest:(NSURLRequest *)request 73 | options:(SDWebImageDownloaderOptions)options 74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDFadeZoomAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDFadeZoomAnimation.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 20.7.14. 6 | // Copyright (c) 2014 Jonas Gessner. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDFadeZoomAnimation.h" 10 | #import "JGProgressHUD.h" 11 | 12 | @implementation JGProgressHUDFadeZoomAnimation 13 | 14 | #pragma mark - Initializers 15 | 16 | - (instancetype)init { 17 | self = [super init]; 18 | if (self) { 19 | self.shrinkAnimationDuaration = 0.2; 20 | self.expandAnimationDuaration = 0.1; 21 | self.expandScale = CGSizeMake(1.1f, 1.1f); 22 | } 23 | return self; 24 | } 25 | 26 | #pragma mark - Showing 27 | 28 | - (void)show { 29 | [super show]; 30 | 31 | self.progressHUD.alpha = 0.0f; 32 | self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1f, 0.1f); 33 | 34 | NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration; 35 | 36 | self.progressHUD.hidden = NO; 37 | 38 | [UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{ 39 | self.progressHUD.alpha = 1.0f; 40 | } completion:nil]; 41 | 42 | [UIView animateWithDuration:self.shrinkAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) animations:^{ 43 | self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(self.expandScale.width, self.expandScale.height); 44 | } completion:^(BOOL __unused _finished) { 45 | [UIView animateWithDuration:self.expandAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState) animations:^{ 46 | self.progressHUD.HUDView.transform = CGAffineTransformIdentity; 47 | } completion:^(BOOL __unused __finished) { 48 | [self animationFinished]; 49 | }]; 50 | }]; 51 | } 52 | 53 | #pragma mark - Hiding 54 | 55 | - (void)hide { 56 | [super hide]; 57 | 58 | NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration; 59 | 60 | [UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{ 61 | self.progressHUD.alpha = 0.0f; 62 | } completion:nil]; 63 | 64 | [UIView animateWithDuration:self.expandAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState) animations:^{ 65 | self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(self.expandScale.width, self.expandScale.height); 66 | } completion:^(BOOL __unused _finished) { 67 | [UIView animateWithDuration:self.shrinkAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState) animations:^{ 68 | self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1f, 0.1f); 69 | } completion:^(BOOL __unused __finished) { 70 | self.progressHUD.HUDView.transform = CGAffineTransformIdentity; 71 | 72 | [self animationFinished]; 73 | }]; 74 | }]; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage sd_imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+MultiFormat.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage sd_imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/LocalViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LocalViewController.m 3 | // JZLPhotoBrowser 4 | // 5 | // Created by allenjzl on 2017/6/5. 6 | // Copyright © 2017年 allenjzl. All rights reserved. 7 | // 8 | 9 | #import "LocalViewController.h" 10 | #import "LocalCollectionViewCell.h" 11 | #import "JZLPhotoBrowser.h" 12 | 13 | @interface LocalViewController () 14 | @property (nonatomic, strong) UICollectionView *collectionView; 15 | @property (nonatomic, strong) NSMutableArray *frameArr; 16 | @end 17 | 18 | 19 | static NSString *const LocalCollectionViewCellReuseID = @"LocalCollectionViewCellReuseID"; 20 | @implementation LocalViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | self.view.backgroundColor = [UIColor whiteColor]; 25 | [self.view addSubview:self.collectionView]; 26 | 27 | } 28 | 29 | 30 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 31 | return 9; 32 | } 33 | 34 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 35 | LocalCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:LocalCollectionViewCellReuseID forIndexPath:indexPath]; 36 | cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%ld.jpg",(indexPath.item + 1)]]; 37 | 38 | 39 | return cell; 40 | 41 | } 42 | 43 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 44 | NSArray *urlArr = [NSArray arrayWithObjects: 45 | @"http://cdn.duitang.com/uploads/item/201112/15/20111215182922_rawVz.thumb.700_0.jpg", 46 | @"http://pic1.win4000.com/mobile/5/52023317b2c3d.jpg", 47 | @"http://img4q.duitang.com/uploads/item/201406/11/20140611041502_SNiL5.thumb.700_0.jpeg", 48 | @"http://img1.gamedog.cn/2012/04/07/20-12040G54U0.jpg", 49 | @"http://img.kutoo8.com/upload/image/48980280/2013xinkuanmengdiao_320x480.jpg", 50 | @"http://ww1.sinaimg.cn/orj480/bd8686degw1f2o211mzevj20hs0vkdlg.jpg", 51 | @"http://i4.download.fd.pchome.net/t_320x520/g1/M00/10/00/ooYBAFVtCdKIToUrAAB7FiveNpMAACg_gIBVqwAAHsu136.jpg", 52 | @"http://img1.gamedog.cn/2012/03/20/20-120320103U7.jpg", 53 | @"http://p18.qhimg.com/bdr/__/d/_open360/sun1111/6.jpg", nil]; 54 | 55 | 56 | [self.frameArr removeAllObjects]; 57 | for (int i = 0; i < 9; i ++) { 58 | NSIndexPath *index = [NSIndexPath indexPathForItem:i inSection:0]; 59 | LocalCollectionViewCell *cell = (LocalCollectionViewCell *)[collectionView cellForItemAtIndexPath:index]; 60 | [self.frameArr addObject:cell.imageView]; 61 | } 62 | 63 | [JZLPhotoBrowser showPhotoBrowserWithUrlArr:urlArr currentIndex:indexPath.row originalImageViewArr:self.frameArr]; 64 | 65 | } 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | - (UICollectionView *)collectionView { 74 | if (!_collectionView) { 75 | UICollectionViewFlowLayout *flowOut = [[UICollectionViewFlowLayout alloc] init]; 76 | flowOut.itemSize = CGSizeMake(100, 100); 77 | flowOut.minimumLineSpacing = 10; 78 | flowOut.minimumInteritemSpacing = 10; 79 | _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(20, 20, self.view.bounds.size.width - 40, self.view.bounds.size.height) collectionViewLayout:flowOut]; 80 | _collectionView.backgroundColor = [UIColor whiteColor]; 81 | _collectionView.delegate = self; 82 | _collectionView.dataSource = self; 83 | [_collectionView registerClass:[LocalCollectionViewCell class] forCellWithReuseIdentifier:LocalCollectionViewCellReuseID]; 84 | } 85 | 86 | return _collectionView; 87 | } 88 | 89 | - (NSMutableArray *)frameArr { 90 | if (!_frameArr) { 91 | _frameArr = [NSMutableArray array]; 92 | } 93 | 94 | return _frameArr; 95 | } 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImagePrefetcher.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 "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/SDWebImagePrefetcher.h.svn-base: -------------------------------------------------------------------------------- 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 "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 53 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 54 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 55 | 56 | @end 57 | 58 | #define MAS_ATTR_FORWARD(attr) \ 59 | - (MASViewAttribute *)attr { \ 60 | return [self mas_##attr]; \ 61 | } 62 | 63 | @implementation MAS_VIEW (MASShorthandAdditions) 64 | 65 | MAS_ATTR_FORWARD(top); 66 | MAS_ATTR_FORWARD(left); 67 | MAS_ATTR_FORWARD(bottom); 68 | MAS_ATTR_FORWARD(right); 69 | MAS_ATTR_FORWARD(leading); 70 | MAS_ATTR_FORWARD(trailing); 71 | MAS_ATTR_FORWARD(width); 72 | MAS_ATTR_FORWARD(height); 73 | MAS_ATTR_FORWARD(centerX); 74 | MAS_ATTR_FORWARD(centerY); 75 | MAS_ATTR_FORWARD(baseline); 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 78 | 79 | MAS_ATTR_FORWARD(firstBaseline); 80 | MAS_ATTR_FORWARD(lastBaseline); 81 | 82 | #endif 83 | 84 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 85 | 86 | MAS_ATTR_FORWARD(leftMargin); 87 | MAS_ATTR_FORWARD(rightMargin); 88 | MAS_ATTR_FORWARD(topMargin); 89 | MAS_ATTR_FORWARD(bottomMargin); 90 | MAS_ATTR_FORWARD(leadingMargin); 91 | MAS_ATTR_FORWARD(trailingMargin); 92 | MAS_ATTR_FORWARD(centerXWithinMargins); 93 | MAS_ATTR_FORWARD(centerYWithinMargins); 94 | 95 | #endif 96 | 97 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 98 | return [self mas_attribute]; 99 | } 100 | 101 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 102 | return [self mas_makeConstraints:block]; 103 | } 104 | 105 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 106 | return [self mas_updateConstraints:block]; 107 | } 108 | 109 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 110 | return [self mas_remakeConstraints:block]; 111 | } 112 | 113 | @end 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | /** 56 | * a key to associate with this view 57 | */ 58 | @property (nonatomic, strong) id mas_key; 59 | 60 | /** 61 | * Finds the closest common superview between this view and another view 62 | * 63 | * @param view other view 64 | * 65 | * @return returns nil if common superview could not be found 66 | */ 67 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 68 | 69 | /** 70 | * Creates a MASConstraintMaker with the callee view. 71 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 72 | * 73 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 74 | * 75 | * @return Array of created MASConstraints 76 | */ 77 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 82 | * If an existing constraint exists then it will be updated instead. 83 | * 84 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 85 | * 86 | * @return Array of created/updated MASConstraints 87 | */ 88 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 89 | 90 | /** 91 | * Creates a MASConstraintMaker with the callee view. 92 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 93 | * All constraints previously installed for the view will be removed. 94 | * 95 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 96 | * 97 | * @return Array of created/updated MASConstraints 98 | */ 99 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImageView+HighlightedWebCache.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 "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak __typeof(self)wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImageView+HighlightedWebCache.m.svn-base: -------------------------------------------------------------------------------- 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 "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak __typeof(self)wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/MKAnnotationView+WebCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+WebCache.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 14/03/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "MKAnnotationView+WebCache.h" 10 | #import "objc/runtime.h" 11 | #import "UIView+WebCacheOperation.h" 12 | 13 | static char imageURLKey; 14 | 15 | @implementation MKAnnotationView (WebCache) 16 | 17 | - (NSURL *)sd_imageURL { 18 | return objc_getAssociatedObject(self, &imageURLKey); 19 | } 20 | 21 | - (void)sd_setImageWithURL:(NSURL *)url { 22 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 23 | } 24 | 25 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 26 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 27 | } 28 | 29 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 30 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 31 | } 32 | 33 | - (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 34 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:completedBlock]; 35 | } 36 | 37 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { 38 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:completedBlock]; 39 | } 40 | 41 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 42 | [self sd_cancelCurrentImageLoad]; 43 | 44 | objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | self.image = placeholder; 46 | 47 | if (url) { 48 | __weak __typeof(self)wself = self; 49 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 50 | if (!wself) return; 51 | dispatch_main_sync_safe(^{ 52 | __strong MKAnnotationView *sself = wself; 53 | if (!sself) return; 54 | if (image) { 55 | sself.image = image; 56 | } 57 | if (completedBlock && finished) { 58 | completedBlock(image, error, cacheType, url); 59 | } 60 | }); 61 | }]; 62 | [self sd_setImageLoadOperation:operation forKey:@"MKAnnotationViewImage"]; 63 | } else { 64 | dispatch_main_async_safe(^{ 65 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 66 | if (completedBlock) { 67 | completedBlock(nil, error, SDImageCacheTypeNone, url); 68 | } 69 | }); 70 | } 71 | } 72 | 73 | - (void)sd_cancelCurrentImageLoad { 74 | [self sd_cancelImageLoadOperationWithKey:@"MKAnnotationViewImage"]; 75 | } 76 | 77 | @end 78 | 79 | 80 | @implementation MKAnnotationView (WebCacheDeprecated) 81 | 82 | - (NSURL *)imageURL { 83 | return [self sd_imageURL]; 84 | } 85 | 86 | - (void)setImageWithURL:(NSURL *)url { 87 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 88 | } 89 | 90 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 91 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 92 | } 93 | 94 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 95 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 96 | } 97 | 98 | - (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 99 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 100 | if (completedBlock) { 101 | completedBlock(image, error, cacheType); 102 | } 103 | }]; 104 | } 105 | 106 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { 107 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 108 | if (completedBlock) { 109 | completedBlock(image, error, cacheType); 110 | } 111 | }]; 112 | } 113 | 114 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 115 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 116 | if (completedBlock) { 117 | completedBlock(image, error, cacheType); 118 | } 119 | }]; 120 | } 121 | 122 | - (void)cancelCurrentImageLoad { 123 | [self sd_cancelCurrentImageLoad]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/MKAnnotationView+WebCache.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+WebCache.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 14/03/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "MKAnnotationView+WebCache.h" 10 | #import "objc/runtime.h" 11 | #import "UIView+WebCacheOperation.h" 12 | 13 | static char imageURLKey; 14 | 15 | @implementation MKAnnotationView (WebCache) 16 | 17 | - (NSURL *)sd_imageURL { 18 | return objc_getAssociatedObject(self, &imageURLKey); 19 | } 20 | 21 | - (void)sd_setImageWithURL:(NSURL *)url { 22 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 23 | } 24 | 25 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 26 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 27 | } 28 | 29 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 30 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 31 | } 32 | 33 | - (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 34 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:completedBlock]; 35 | } 36 | 37 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { 38 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:completedBlock]; 39 | } 40 | 41 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 42 | [self sd_cancelCurrentImageLoad]; 43 | 44 | objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | self.image = placeholder; 46 | 47 | if (url) { 48 | __weak __typeof(self)wself = self; 49 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 50 | if (!wself) return; 51 | dispatch_main_sync_safe(^{ 52 | __strong MKAnnotationView *sself = wself; 53 | if (!sself) return; 54 | if (image) { 55 | sself.image = image; 56 | } 57 | if (completedBlock && finished) { 58 | completedBlock(image, error, cacheType, url); 59 | } 60 | }); 61 | }]; 62 | [self sd_setImageLoadOperation:operation forKey:@"MKAnnotationViewImage"]; 63 | } else { 64 | dispatch_main_async_safe(^{ 65 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 66 | if (completedBlock) { 67 | completedBlock(nil, error, SDImageCacheTypeNone, url); 68 | } 69 | }); 70 | } 71 | } 72 | 73 | - (void)sd_cancelCurrentImageLoad { 74 | [self sd_cancelImageLoadOperationWithKey:@"MKAnnotationViewImage"]; 75 | } 76 | 77 | @end 78 | 79 | 80 | @implementation MKAnnotationView (WebCacheDeprecated) 81 | 82 | - (NSURL *)imageURL { 83 | return [self sd_imageURL]; 84 | } 85 | 86 | - (void)setImageWithURL:(NSURL *)url { 87 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 88 | } 89 | 90 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 91 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 92 | } 93 | 94 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 95 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 96 | } 97 | 98 | - (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 99 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 100 | if (completedBlock) { 101 | completedBlock(image, error, cacheType); 102 | } 103 | }]; 104 | } 105 | 106 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { 107 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 108 | if (completedBlock) { 109 | completedBlock(image, error, cacheType); 110 | } 111 | }]; 112 | } 113 | 114 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 115 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 116 | if (completedBlock) { 117 | completedBlock(image, error, cacheType); 118 | } 119 | }]; 120 | } 121 | 122 | - (void)cancelCurrentImageLoad { 123 | [self sd_cancelCurrentImageLoad]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/JGProgressHUD/JGProgressHUD/JGProgressHUDPieIndicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // JGProgressHUDPieIndicatorView.m 3 | // JGProgressHUD 4 | // 5 | // Created by Jonas Gessner on 19.07.14. 6 | // Copyright (c) 2014 Hardtack. All rights reserved. 7 | // 8 | 9 | #import "JGProgressHUDPieIndicatorView.h" 10 | 11 | @interface JGProgressHUDPieIndicatorLayer : CALayer 12 | 13 | @property (nonatomic, assign) float progress; 14 | 15 | @property (nonatomic, weak) UIColor *color; 16 | 17 | @property (nonatomic, weak) UIColor *fillColor; 18 | 19 | @end 20 | 21 | @implementation JGProgressHUDPieIndicatorLayer 22 | 23 | @dynamic progress, color, fillColor; 24 | 25 | + (BOOL)needsDisplayForKey:(NSString *)key { 26 | return ([key isEqualToString:@"progress"] || [key isEqualToString:@"color"] || [key isEqualToString:@"fillColor"] || [super needsDisplayForKey:key]); 27 | } 28 | 29 | - (id )actionForKey:(NSString *)key { 30 | if ([key isEqualToString:@"progress"]) { 31 | CABasicAnimation *progressAnimation = [CABasicAnimation animation]; 32 | progressAnimation.fromValue = [self.presentationLayer valueForKey:key]; 33 | 34 | progressAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 35 | 36 | return progressAnimation; 37 | } 38 | 39 | return [super actionForKey:key]; 40 | } 41 | 42 | - (void)drawInContext:(CGContextRef)ctx { 43 | UIGraphicsPushContext(ctx); 44 | 45 | CGRect rect = self.bounds; 46 | 47 | CGPoint center = CGPointMake(rect.origin.x + (CGFloat)floor(rect.size.height/2.0f), rect.origin.y + (CGFloat)floor(rect.size.height/2.0f)); 48 | CGFloat lineWidth = 2.0f; 49 | CGFloat radius = (CGFloat)floor(MIN(rect.size.width, rect.size.height)/2.0f)-lineWidth; 50 | 51 | //Border && Fill 52 | UIBezierPath *borderPath = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:0.0f endAngle:2.0f*(CGFloat)M_PI clockwise:NO]; 53 | 54 | [borderPath setLineWidth:lineWidth]; 55 | 56 | if (self.fillColor) { 57 | [self.fillColor setFill]; 58 | 59 | [borderPath fill]; 60 | } 61 | 62 | [self.color set]; 63 | 64 | [borderPath stroke]; 65 | 66 | 67 | //Progress 68 | if (self.progress > 0.0) { 69 | UIBezierPath *processPath = [UIBezierPath bezierPath]; 70 | 71 | [processPath setLineWidth:radius]; 72 | 73 | CGFloat startAngle = -((CGFloat)M_PI/2.0f); 74 | CGFloat endAngle = startAngle + 2.0f * (CGFloat)M_PI * self.progress; 75 | 76 | [processPath addArcWithCenter:center radius:radius/2.0f startAngle:startAngle endAngle:endAngle clockwise:YES]; 77 | 78 | [processPath stroke]; 79 | 80 | UIGraphicsPopContext(); 81 | } 82 | } 83 | 84 | @end 85 | 86 | 87 | @implementation JGProgressHUDPieIndicatorView 88 | 89 | #pragma mark - Initializers 90 | 91 | - (instancetype)initWithHUDStyle:(JGProgressHUDStyle)style { 92 | self = [super init]; 93 | 94 | if (self) { 95 | self.layer.contentsScale = [UIScreen mainScreen].scale; 96 | [self.layer setNeedsDisplay]; 97 | 98 | if (style == JGProgressHUDStyleDark) { 99 | self.color = [UIColor whiteColor]; 100 | self.fillColor = [UIColor colorWithWhite:0.2f alpha:1.0f]; 101 | } 102 | else { 103 | self.color = [UIColor blackColor]; 104 | if (style == JGProgressHUDStyleLight) { 105 | self.fillColor = [UIColor colorWithWhite:0.85f alpha:1.0f]; 106 | } 107 | else { 108 | self.fillColor = [UIColor colorWithWhite:0.9f alpha:1.0f]; 109 | } 110 | } 111 | } 112 | 113 | return self; 114 | } 115 | 116 | - (instancetype)initWithContentView:(UIView *)contentView { 117 | self = [super initWithContentView:contentView]; 118 | 119 | if (self) { 120 | self.layer.contentsScale = [UIScreen mainScreen].scale; 121 | [self.layer setNeedsDisplay]; 122 | 123 | self.color = [UIColor whiteColor]; 124 | } 125 | 126 | return self; 127 | } 128 | 129 | #pragma mark - Getters & Setters 130 | 131 | - (void)setColor:(UIColor *)tintColor { 132 | if ([tintColor isEqual:self.color]) { 133 | return; 134 | } 135 | 136 | _color = tintColor; 137 | 138 | [(JGProgressHUDPieIndicatorLayer *)self.layer setColor:self.color]; 139 | } 140 | 141 | - (void)setFillColor:(UIColor *)fillColor { 142 | if ([fillColor isEqual:self.fillColor]) { 143 | return; 144 | } 145 | 146 | _fillColor = fillColor; 147 | 148 | [(JGProgressHUDPieIndicatorLayer *)self.layer setFillColor:self.fillColor]; 149 | } 150 | 151 | - (void)setProgress:(float)progress animated:(BOOL)animated { 152 | if (fequal(self.progress, progress)) { 153 | return; 154 | } 155 | 156 | [super setProgress:progress animated:animated]; 157 | 158 | [CATransaction begin]; 159 | [CATransaction setAnimationDuration:(animated ? 0.3 : 0.0)]; 160 | 161 | [(JGProgressHUDPieIndicatorLayer *)self.layer setProgress:progress]; 162 | 163 | [CATransaction commit]; 164 | } 165 | 166 | #pragma mark - Overrides 167 | 168 | + (Class)layerClass { 169 | return [JGProgressHUDPieIndicatorLayer class]; 170 | } 171 | 172 | @end 173 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageManager.h" 12 | 13 | /** 14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 15 | */ 16 | @interface UIImageView (HighlightedWebCache) 17 | 18 | /** 19 | * Set the imageView `highlightedImage` with an `url`. 20 | * 21 | * The download is asynchronous and cached. 22 | * 23 | * @param url The url for the image. 24 | */ 25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url; 26 | 27 | /** 28 | * Set the imageView `highlightedImage` with an `url` and custom options. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 34 | */ 35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; 36 | 37 | /** 38 | * Set the imageView `highlightedImage` with an `url`. 39 | * 40 | * The download is asynchronous and cached. 41 | * 42 | * @param url The url for the image. 43 | * @param completedBlock A block called when operation has been completed. This block has no return value 44 | * and takes the requested UIImage as first parameter. In case of error the image parameter 45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 46 | * indicating if the image was retrived from the local cache or from the network. 47 | * The fourth parameter is the original image url. 48 | */ 49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 50 | 51 | /** 52 | * Set the imageView `highlightedImage` with an `url` and custom options. 53 | * 54 | * The download is asynchronous and cached. 55 | * 56 | * @param url The url for the image. 57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrived from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 65 | 66 | /** 67 | * Set the imageView `highlightedImage` with an `url` and custom options. 68 | * 69 | * The download is asynchronous and cached. 70 | * 71 | * @param url The url for the image. 72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 73 | * @param progressBlock A block called while image is downloading 74 | * @param completedBlock A block called when operation has been completed. This block has no return value 75 | * and takes the requested UIImage as first parameter. In case of error the image parameter 76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 77 | * indicating if the image was retrived from the local cache or from the network. 78 | * The fourth parameter is the original image url. 79 | */ 80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; 81 | 82 | /** 83 | * Cancel the current download 84 | */ 85 | - (void)sd_cancelCurrentHighlightedImageLoad; 86 | 87 | @end 88 | 89 | 90 | @interface UIImageView (HighlightedWebCacheDeprecated) 91 | 92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); 93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); 94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); 96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); 97 | 98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImageView+HighlightedWebCache.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageManager.h" 12 | 13 | /** 14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 15 | */ 16 | @interface UIImageView (HighlightedWebCache) 17 | 18 | /** 19 | * Set the imageView `highlightedImage` with an `url`. 20 | * 21 | * The download is asynchronous and cached. 22 | * 23 | * @param url The url for the image. 24 | */ 25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url; 26 | 27 | /** 28 | * Set the imageView `highlightedImage` with an `url` and custom options. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 34 | */ 35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; 36 | 37 | /** 38 | * Set the imageView `highlightedImage` with an `url`. 39 | * 40 | * The download is asynchronous and cached. 41 | * 42 | * @param url The url for the image. 43 | * @param completedBlock A block called when operation has been completed. This block has no return value 44 | * and takes the requested UIImage as first parameter. In case of error the image parameter 45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 46 | * indicating if the image was retrived from the local cache or from the network. 47 | * The fourth parameter is the original image url. 48 | */ 49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 50 | 51 | /** 52 | * Set the imageView `highlightedImage` with an `url` and custom options. 53 | * 54 | * The download is asynchronous and cached. 55 | * 56 | * @param url The url for the image. 57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrived from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 65 | 66 | /** 67 | * Set the imageView `highlightedImage` with an `url` and custom options. 68 | * 69 | * The download is asynchronous and cached. 70 | * 71 | * @param url The url for the image. 72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 73 | * @param progressBlock A block called while image is downloading 74 | * @param completedBlock A block called when operation has been completed. This block has no return value 75 | * and takes the requested UIImage as first parameter. In case of error the image parameter 76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 77 | * indicating if the image was retrived from the local cache or from the network. 78 | * The fourth parameter is the original image url. 79 | */ 80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; 81 | 82 | /** 83 | * Cancel the current download 84 | */ 85 | - (void)sd_cancelCurrentHighlightedImageLoad; 86 | 87 | @end 88 | 89 | 90 | @interface UIImageView (HighlightedWebCacheDeprecated) 91 | 92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); 93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); 94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); 96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); 97 | 98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.m 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "UIImage+GIF.h" 10 | #import 11 | 12 | @implementation UIImage (GIF) 13 | 14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 15 | if (!data) { 16 | return nil; 17 | } 18 | 19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 20 | 21 | size_t count = CGImageSourceGetCount(source); 22 | 23 | UIImage *animatedImage; 24 | 25 | if (count <= 1) { 26 | animatedImage = [[UIImage alloc] initWithData:data]; 27 | } 28 | else { 29 | NSMutableArray *images = [NSMutableArray array]; 30 | 31 | NSTimeInterval duration = 0.0f; 32 | 33 | for (size_t i = 0; i < count; i++) { 34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); 35 | 36 | duration += [self sd_frameDurationAtIndex:i source:source]; 37 | 38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; 39 | 40 | CGImageRelease(image); 41 | } 42 | 43 | if (!duration) { 44 | duration = (1.0f / 10.0f) * count; 45 | } 46 | 47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration]; 48 | } 49 | 50 | CFRelease(source); 51 | 52 | return animatedImage; 53 | } 54 | 55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { 56 | float frameDuration = 0.1f; 57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); 58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; 59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; 60 | 61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; 62 | if (delayTimeUnclampedProp) { 63 | frameDuration = [delayTimeUnclampedProp floatValue]; 64 | } 65 | else { 66 | 67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; 68 | if (delayTimeProp) { 69 | frameDuration = [delayTimeProp floatValue]; 70 | } 71 | } 72 | 73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 75 | // a duration of <= 10 ms. See and 76 | // for more information. 77 | 78 | if (frameDuration < 0.011f) { 79 | frameDuration = 0.100f; 80 | } 81 | 82 | CFRelease(cfFrameProperties); 83 | return frameDuration; 84 | } 85 | 86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name { 87 | CGFloat scale = [UIScreen mainScreen].scale; 88 | 89 | if (scale > 1.0f) { 90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; 91 | 92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath]; 93 | 94 | if (data) { 95 | return [UIImage sd_animatedGIFWithData:data]; 96 | } 97 | 98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 99 | 100 | data = [NSData dataWithContentsOfFile:path]; 101 | 102 | if (data) { 103 | return [UIImage sd_animatedGIFWithData:data]; 104 | } 105 | 106 | return [UIImage imageNamed:name]; 107 | } 108 | else { 109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 110 | 111 | NSData *data = [NSData dataWithContentsOfFile:path]; 112 | 113 | if (data) { 114 | return [UIImage sd_animatedGIFWithData:data]; 115 | } 116 | 117 | return [UIImage imageNamed:name]; 118 | } 119 | } 120 | 121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { 122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { 123 | return self; 124 | } 125 | 126 | CGSize scaledSize = size; 127 | CGPoint thumbnailPoint = CGPointZero; 128 | 129 | CGFloat widthFactor = size.width / self.size.width; 130 | CGFloat heightFactor = size.height / self.size.height; 131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; 132 | scaledSize.width = self.size.width * scaleFactor; 133 | scaledSize.height = self.size.height * scaleFactor; 134 | 135 | if (widthFactor > heightFactor) { 136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; 137 | } 138 | else if (widthFactor < heightFactor) { 139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; 140 | } 141 | 142 | NSMutableArray *scaledImages = [NSMutableArray array]; 143 | 144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); 145 | 146 | for (UIImage *image in self.images) { 147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; 148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 149 | 150 | [scaledImages addObject:newImage]; 151 | } 152 | 153 | UIGraphicsEndImageContext(); 154 | 155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/.svn/text-base/UIImage+GIF.m.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.m 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "UIImage+GIF.h" 10 | #import 11 | 12 | @implementation UIImage (GIF) 13 | 14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 15 | if (!data) { 16 | return nil; 17 | } 18 | 19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 20 | 21 | size_t count = CGImageSourceGetCount(source); 22 | 23 | UIImage *animatedImage; 24 | 25 | if (count <= 1) { 26 | animatedImage = [[UIImage alloc] initWithData:data]; 27 | } 28 | else { 29 | NSMutableArray *images = [NSMutableArray array]; 30 | 31 | NSTimeInterval duration = 0.0f; 32 | 33 | for (size_t i = 0; i < count; i++) { 34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); 35 | 36 | duration += [self sd_frameDurationAtIndex:i source:source]; 37 | 38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; 39 | 40 | CGImageRelease(image); 41 | } 42 | 43 | if (!duration) { 44 | duration = (1.0f / 10.0f) * count; 45 | } 46 | 47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration]; 48 | } 49 | 50 | CFRelease(source); 51 | 52 | return animatedImage; 53 | } 54 | 55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { 56 | float frameDuration = 0.1f; 57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); 58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; 59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; 60 | 61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; 62 | if (delayTimeUnclampedProp) { 63 | frameDuration = [delayTimeUnclampedProp floatValue]; 64 | } 65 | else { 66 | 67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; 68 | if (delayTimeProp) { 69 | frameDuration = [delayTimeProp floatValue]; 70 | } 71 | } 72 | 73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 75 | // a duration of <= 10 ms. See and 76 | // for more information. 77 | 78 | if (frameDuration < 0.011f) { 79 | frameDuration = 0.100f; 80 | } 81 | 82 | CFRelease(cfFrameProperties); 83 | return frameDuration; 84 | } 85 | 86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name { 87 | CGFloat scale = [UIScreen mainScreen].scale; 88 | 89 | if (scale > 1.0f) { 90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; 91 | 92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath]; 93 | 94 | if (data) { 95 | return [UIImage sd_animatedGIFWithData:data]; 96 | } 97 | 98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 99 | 100 | data = [NSData dataWithContentsOfFile:path]; 101 | 102 | if (data) { 103 | return [UIImage sd_animatedGIFWithData:data]; 104 | } 105 | 106 | return [UIImage imageNamed:name]; 107 | } 108 | else { 109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 110 | 111 | NSData *data = [NSData dataWithContentsOfFile:path]; 112 | 113 | if (data) { 114 | return [UIImage sd_animatedGIFWithData:data]; 115 | } 116 | 117 | return [UIImage imageNamed:name]; 118 | } 119 | } 120 | 121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { 122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { 123 | return self; 124 | } 125 | 126 | CGSize scaledSize = size; 127 | CGPoint thumbnailPoint = CGPointZero; 128 | 129 | CGFloat widthFactor = size.width / self.size.width; 130 | CGFloat heightFactor = size.height / self.size.height; 131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; 132 | scaledSize.width = self.size.width * scaleFactor; 133 | scaledSize.height = self.size.height * scaleFactor; 134 | 135 | if (widthFactor > heightFactor) { 136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; 137 | } 138 | else if (widthFactor < heightFactor) { 139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; 140 | } 141 | 142 | NSMutableArray *scaledImages = [NSMutableArray array]; 143 | 144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); 145 | 146 | for (UIImage *image in self.images) { 147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; 148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 149 | 150 | [scaledImages addObject:newImage]; 151 | } 152 | 153 | UIGraphicsEndImageContext(); 154 | 155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/Masonry/MASCompositeConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASCompositeConstraint.h" 10 | #import "MASConstraint+Private.h" 11 | 12 | @interface MASCompositeConstraint () 13 | 14 | @property (nonatomic, strong) id mas_key; 15 | @property (nonatomic, strong) NSMutableArray *childConstraints; 16 | 17 | @end 18 | 19 | @implementation MASCompositeConstraint 20 | 21 | - (id)initWithChildren:(NSArray *)children { 22 | self = [super init]; 23 | if (!self) return nil; 24 | 25 | _childConstraints = [children mutableCopy]; 26 | for (MASConstraint *constraint in _childConstraints) { 27 | constraint.delegate = self; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - MASConstraintDelegate 34 | 35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { 36 | NSUInteger index = [self.childConstraints indexOfObject:constraint]; 37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); 38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; 39 | } 40 | 41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 42 | id strongDelegate = self.delegate; 43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 44 | newConstraint.delegate = self; 45 | [self.childConstraints addObject:newConstraint]; 46 | return newConstraint; 47 | } 48 | 49 | #pragma mark - NSLayoutConstraint multiplier proxies 50 | 51 | - (MASConstraint * (^)(CGFloat))multipliedBy { 52 | return ^id(CGFloat multiplier) { 53 | for (MASConstraint *constraint in self.childConstraints) { 54 | constraint.multipliedBy(multiplier); 55 | } 56 | return self; 57 | }; 58 | } 59 | 60 | - (MASConstraint * (^)(CGFloat))dividedBy { 61 | return ^id(CGFloat divider) { 62 | for (MASConstraint *constraint in self.childConstraints) { 63 | constraint.dividedBy(divider); 64 | } 65 | return self; 66 | }; 67 | } 68 | 69 | #pragma mark - MASLayoutPriority proxy 70 | 71 | - (MASConstraint * (^)(MASLayoutPriority))priority { 72 | return ^id(MASLayoutPriority priority) { 73 | for (MASConstraint *constraint in self.childConstraints) { 74 | constraint.priority(priority); 75 | } 76 | return self; 77 | }; 78 | } 79 | 80 | #pragma mark - NSLayoutRelation proxy 81 | 82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { 83 | return ^id(id attr, NSLayoutRelation relation) { 84 | for (MASConstraint *constraint in self.childConstraints.copy) { 85 | constraint.equalToWithRelation(attr, relation); 86 | } 87 | return self; 88 | }; 89 | } 90 | 91 | #pragma mark - attribute chaining 92 | 93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 95 | return self; 96 | } 97 | 98 | #pragma mark - Animator proxy 99 | 100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 101 | 102 | - (MASConstraint *)animator { 103 | for (MASConstraint *constraint in self.childConstraints) { 104 | [constraint animator]; 105 | } 106 | return self; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark - debug helpers 112 | 113 | - (MASConstraint * (^)(id))key { 114 | return ^id(id key) { 115 | self.mas_key = key; 116 | int i = 0; 117 | for (MASConstraint *constraint in self.childConstraints) { 118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); 119 | } 120 | return self; 121 | }; 122 | } 123 | 124 | #pragma mark - NSLayoutConstraint constant setters 125 | 126 | - (void)setInsets:(MASEdgeInsets)insets { 127 | for (MASConstraint *constraint in self.childConstraints) { 128 | constraint.insets = insets; 129 | } 130 | } 131 | 132 | - (void)setInset:(CGFloat)inset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.inset = inset; 135 | } 136 | } 137 | 138 | - (void)setOffset:(CGFloat)offset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.offset = offset; 141 | } 142 | } 143 | 144 | - (void)setSizeOffset:(CGSize)sizeOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.sizeOffset = sizeOffset; 147 | } 148 | } 149 | 150 | - (void)setCenterOffset:(CGPoint)centerOffset { 151 | for (MASConstraint *constraint in self.childConstraints) { 152 | constraint.centerOffset = centerOffset; 153 | } 154 | } 155 | 156 | #pragma mark - MASConstraint 157 | 158 | - (void)activate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint activate]; 161 | } 162 | } 163 | 164 | - (void)deactivate { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | [constraint deactivate]; 167 | } 168 | } 169 | 170 | - (void)install { 171 | for (MASConstraint *constraint in self.childConstraints) { 172 | constraint.updateExisting = self.updateExisting; 173 | [constraint install]; 174 | } 175 | } 176 | 177 | - (void)uninstall { 178 | for (MASConstraint *constraint in self.childConstraints) { 179 | [constraint uninstall]; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /JZLPhotoBrowser/JZLPhotoBrowser/Third/SDWebImage/SDWebImagePrefetcher.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 "SDWebImagePrefetcher.h" 10 | 11 | #if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE) 12 | #define NSLog(...) 13 | #endif 14 | 15 | @interface SDWebImagePrefetcher () 16 | 17 | @property (strong, nonatomic) SDWebImageManager *manager; 18 | @property (strong, nonatomic) NSArray *prefetchURLs; 19 | @property (assign, nonatomic) NSUInteger requestedCount; 20 | @property (assign, nonatomic) NSUInteger skippedCount; 21 | @property (assign, nonatomic) NSUInteger finishedCount; 22 | @property (assign, nonatomic) NSTimeInterval startedTime; 23 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock; 24 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock; 25 | 26 | @end 27 | 28 | @implementation SDWebImagePrefetcher 29 | 30 | + (SDWebImagePrefetcher *)sharedImagePrefetcher { 31 | static dispatch_once_t once; 32 | static id instance; 33 | dispatch_once(&once, ^{ 34 | instance = [self new]; 35 | }); 36 | return instance; 37 | } 38 | 39 | - (id)init { 40 | if ((self = [super init])) { 41 | _manager = [SDWebImageManager new]; 42 | _options = SDWebImageLowPriority; 43 | _prefetcherQueue = dispatch_get_main_queue(); 44 | self.maxConcurrentDownloads = 3; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { 50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; 51 | } 52 | 53 | - (NSUInteger)maxConcurrentDownloads { 54 | return self.manager.imageDownloader.maxConcurrentDownloads; 55 | } 56 | 57 | - (void)startPrefetchingAtIndex:(NSUInteger)index { 58 | if (index >= self.prefetchURLs.count) return; 59 | self.requestedCount++; 60 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 61 | if (!finished) return; 62 | self.finishedCount++; 63 | 64 | if (image) { 65 | if (self.progressBlock) { 66 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 67 | } 68 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count)); 69 | } 70 | else { 71 | if (self.progressBlock) { 72 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 73 | } 74 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count)); 75 | 76 | // Add last failed 77 | self.skippedCount++; 78 | } 79 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { 80 | [self.delegate imagePrefetcher:self 81 | didPrefetchURL:self.prefetchURLs[index] 82 | finishedCount:self.finishedCount 83 | totalCount:self.prefetchURLs.count 84 | ]; 85 | } 86 | if (self.prefetchURLs.count > self.requestedCount) { 87 | dispatch_async(self.prefetcherQueue, ^{ 88 | [self startPrefetchingAtIndex:self.requestedCount]; 89 | }); 90 | } 91 | else if (self.finishedCount == self.requestedCount) { 92 | [self reportStatus]; 93 | if (self.completionBlock) { 94 | self.completionBlock(self.finishedCount, self.skippedCount); 95 | self.completionBlock = nil; 96 | } 97 | self.progressBlock = nil; 98 | } 99 | }]; 100 | } 101 | 102 | - (void)reportStatus { 103 | NSUInteger total = [self.prefetchURLs count]; 104 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime); 105 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { 106 | [self.delegate imagePrefetcher:self 107 | didFinishWithTotalCount:(total - self.skippedCount) 108 | skippedCount:self.skippedCount 109 | ]; 110 | } 111 | } 112 | 113 | - (void)prefetchURLs:(NSArray *)urls { 114 | [self prefetchURLs:urls progress:nil completed:nil]; 115 | } 116 | 117 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { 118 | [self cancelPrefetching]; // Prevent duplicate prefetch request 119 | self.startedTime = CFAbsoluteTimeGetCurrent(); 120 | self.prefetchURLs = urls; 121 | self.completionBlock = completionBlock; 122 | self.progressBlock = progressBlock; 123 | 124 | if(urls.count == 0){ 125 | if(completionBlock){ 126 | completionBlock(0,0); 127 | } 128 | }else{ 129 | // Starts prefetching from the very first image on the list with the max allowed concurrency 130 | NSUInteger listCount = self.prefetchURLs.count; 131 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { 132 | [self startPrefetchingAtIndex:i]; 133 | } 134 | } 135 | } 136 | 137 | - (void)cancelPrefetching { 138 | self.prefetchURLs = nil; 139 | self.skippedCount = 0; 140 | self.requestedCount = 0; 141 | self.finishedCount = 0; 142 | [self.manager cancelAll]; 143 | } 144 | 145 | @end 146 | --------------------------------------------------------------------------------