├── .gitignore ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFCompatibilityMacros.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFAutoPurgingImageCache.m │ │ ├── AFImageDownloader.h │ │ ├── AFImageDownloader.m │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFCompatibilityMacros.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ ├── YYCache │ │ │ ├── YYCache.h │ │ │ ├── YYDiskCache.h │ │ │ ├── YYKVStorage.h │ │ │ └── YYMemoryCache.h │ │ ├── YYImage │ │ │ ├── YYAnimatedImageView.h │ │ │ ├── YYFrameImage.h │ │ │ ├── YYImage.h │ │ │ ├── YYImageCoder.h │ │ │ └── YYSpriteSheetImage.h │ │ ├── YYModel │ │ │ ├── NSObject+YYModel.h │ │ │ ├── YYClassInfo.h │ │ │ └── YYModel.h │ │ └── YYWebImage │ │ │ ├── CALayer+YYWebImage.h │ │ │ ├── MKAnnotationView+YYWebImage.h │ │ │ ├── UIButton+YYWebImage.h │ │ │ ├── UIImage+YYWebImage.h │ │ │ ├── UIImageView+YYWebImage.h │ │ │ ├── YYImageCache.h │ │ │ ├── YYWebImage.h │ │ │ ├── YYWebImageManager.h │ │ │ ├── YYWebImageOperation.h │ │ │ └── _YYWebImageSetter.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFCompatibilityMacros.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFImageDownloader.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ ├── YYCache │ │ ├── YYCache.h │ │ ├── YYDiskCache.h │ │ ├── YYKVStorage.h │ │ └── YYMemoryCache.h │ │ ├── YYImage │ │ ├── YYAnimatedImageView.h │ │ ├── YYFrameImage.h │ │ ├── YYImage.h │ │ ├── YYImageCoder.h │ │ └── YYSpriteSheetImage.h │ │ ├── YYModel │ │ ├── NSObject+YYModel.h │ │ ├── YYClassInfo.h │ │ └── YYModel.h │ │ └── YYWebImage │ │ ├── CALayer+YYWebImage.h │ │ ├── MKAnnotationView+YYWebImage.h │ │ ├── UIButton+YYWebImage.h │ │ ├── UIImage+YYWebImage.h │ │ ├── UIImageView+YYWebImage.h │ │ ├── YYImageCache.h │ │ ├── YYWebImage.h │ │ ├── YYWebImageManager.h │ │ └── YYWebImageOperation.h ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── Target Support Files │ ├── AFNetworking │ │ ├── AFNetworking-dummy.m │ │ ├── AFNetworking-prefix.pch │ │ └── AFNetworking.xcconfig │ ├── Pods-TableViewCellOptimization │ │ ├── Pods-TableViewCellOptimization-acknowledgements.markdown │ │ ├── Pods-TableViewCellOptimization-acknowledgements.plist │ │ ├── Pods-TableViewCellOptimization-dummy.m │ │ ├── Pods-TableViewCellOptimization-frameworks.sh │ │ ├── Pods-TableViewCellOptimization-resources.sh │ │ ├── Pods-TableViewCellOptimization.debug.xcconfig │ │ └── Pods-TableViewCellOptimization.release.xcconfig │ ├── YYCache │ │ ├── YYCache-dummy.m │ │ ├── YYCache-prefix.pch │ │ └── YYCache.xcconfig │ ├── YYImage │ │ ├── YYImage-dummy.m │ │ ├── YYImage-prefix.pch │ │ └── YYImage.xcconfig │ ├── YYModel │ │ ├── YYModel-dummy.m │ │ ├── YYModel-prefix.pch │ │ └── YYModel.xcconfig │ └── YYWebImage │ │ ├── YYWebImage-dummy.m │ │ ├── YYWebImage-prefix.pch │ │ └── YYWebImage.xcconfig ├── YYCache │ ├── LICENSE │ ├── README.md │ └── YYCache │ │ ├── YYCache.h │ │ ├── YYCache.m │ │ ├── YYDiskCache.h │ │ ├── YYDiskCache.m │ │ ├── YYKVStorage.h │ │ ├── YYKVStorage.m │ │ ├── YYMemoryCache.h │ │ └── YYMemoryCache.m ├── YYImage │ ├── LICENSE │ ├── README.md │ └── YYImage │ │ ├── YYAnimatedImageView.h │ │ ├── YYAnimatedImageView.m │ │ ├── YYFrameImage.h │ │ ├── YYFrameImage.m │ │ ├── YYImage.h │ │ ├── YYImage.m │ │ ├── YYImageCoder.h │ │ ├── YYImageCoder.m │ │ ├── YYSpriteSheetImage.h │ │ └── YYSpriteSheetImage.m ├── YYModel │ ├── LICENSE │ ├── README.md │ └── YYModel │ │ ├── NSObject+YYModel.h │ │ ├── NSObject+YYModel.m │ │ ├── YYClassInfo.h │ │ ├── YYClassInfo.m │ │ └── YYModel.h └── YYWebImage │ ├── LICENSE │ ├── README.md │ └── YYWebImage │ ├── Categories │ ├── CALayer+YYWebImage.h │ ├── CALayer+YYWebImage.m │ ├── MKAnnotationView+YYWebImage.h │ ├── MKAnnotationView+YYWebImage.m │ ├── UIButton+YYWebImage.h │ ├── UIButton+YYWebImage.m │ ├── UIImage+YYWebImage.h │ ├── UIImage+YYWebImage.m │ ├── UIImageView+YYWebImage.h │ ├── UIImageView+YYWebImage.m │ ├── _YYWebImageSetter.h │ └── _YYWebImageSetter.m │ ├── YYImageCache.h │ ├── YYImageCache.m │ ├── YYWebImage.h │ ├── YYWebImageManager.h │ ├── YYWebImageManager.m │ ├── YYWebImageOperation.h │ └── YYWebImageOperation.m ├── README.md ├── TableViewCellOptimization.xcodeproj └── project.pbxproj ├── TableViewCellOptimization.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist └── TableViewCellOptimization ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── placeholder.imageset │ ├── Contents.json │ └── placeholder.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Demo ├── Controller │ ├── NextViewController.h │ ├── NextViewController.m │ ├── ViewController.h │ └── ViewController.m ├── Model │ ├── DemoModel.h │ └── DemoModel.m └── Service │ ├── DemoService.h │ ├── DemoService.m │ ├── ImageDownload.h │ └── ImageDownload.m ├── Info.plist └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'TableViewCellOptimization' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | pod 'YYModel' 8 | pod 'AFNetworking' 9 | pod 'YYWebImage' 10 | 11 | # Pods for TableViewCellOptimization 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.1): 3 | - AFNetworking/NSURLSession (= 3.2.1) 4 | - AFNetworking/Reachability (= 3.2.1) 5 | - AFNetworking/Security (= 3.2.1) 6 | - AFNetworking/Serialization (= 3.2.1) 7 | - AFNetworking/UIKit (= 3.2.1) 8 | - AFNetworking/NSURLSession (3.2.1): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.1) 13 | - AFNetworking/Security (3.2.1) 14 | - AFNetworking/Serialization (3.2.1) 15 | - AFNetworking/UIKit (3.2.1): 16 | - AFNetworking/NSURLSession 17 | - YYCache (1.0.4) 18 | - YYImage (1.0.4): 19 | - YYImage/Core (= 1.0.4) 20 | - YYImage/Core (1.0.4) 21 | - YYModel (1.0.4) 22 | - YYWebImage (1.0.5): 23 | - YYCache 24 | - YYImage 25 | 26 | DEPENDENCIES: 27 | - AFNetworking 28 | - YYModel 29 | - YYWebImage 30 | 31 | SPEC REPOS: 32 | https://github.com/cocoapods/specs.git: 33 | - AFNetworking 34 | - YYCache 35 | - YYImage 36 | - YYModel 37 | - YYWebImage 38 | 39 | SPEC CHECKSUMS: 40 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 41 | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 42 | YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 43 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 44 | YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 45 | 46 | PODFILE CHECKSUM: 70670a742e6a0a78a7c2b388bf9034fc924671ea 47 | 48 | COCOAPODS: 1.5.3 49 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFCompatibilityMacros.h: -------------------------------------------------------------------------------- 1 | // AFCompatibilityMacros.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #ifndef AFCompatibilityMacros_h 23 | #define AFCompatibilityMacros_h 24 | 25 | #ifdef API_UNAVAILABLE 26 | #define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x) 27 | #else 28 | #define AF_API_UNAVAILABLE(x) 29 | #endif // API_UNAVAILABLE 30 | 31 | #if __has_warning("-Wunguarded-availability-new") 32 | #define AF_CAN_USE_AT_AVAILABLE 1 33 | #else 34 | #define AF_CAN_USE_AT_AVAILABLE 0 35 | #endif 36 | 37 | #endif /* AFCompatibilityMacros_h */ 38 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | The certificates used to evaluate server trust according to the SSL pinning mode. 48 | 49 | By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. 50 | 51 | Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 52 | */ 53 | @property (nonatomic, strong, nullable) NSSet *pinnedCertificates; 54 | 55 | /** 56 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 57 | */ 58 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 59 | 60 | /** 61 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 62 | */ 63 | @property (nonatomic, assign) BOOL validatesDomainName; 64 | 65 | ///----------------------------------------- 66 | /// @name Getting Certificates from the Bundle 67 | ///----------------------------------------- 68 | 69 | /** 70 | Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. 71 | 72 | @return The certificates included in the given bundle. 73 | */ 74 | + (NSSet *)certificatesInBundle:(NSBundle *)bundle; 75 | 76 | ///----------------------------------------- 77 | /// @name Getting Specific Security Policies 78 | ///----------------------------------------- 79 | 80 | /** 81 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. 82 | 83 | @return The default security policy. 84 | */ 85 | + (instancetype)defaultPolicy; 86 | 87 | ///--------------------- 88 | /// @name Initialization 89 | ///--------------------- 90 | 91 | /** 92 | Creates and returns a security policy with the specified pinning mode. 93 | 94 | @param pinningMode The SSL pinning mode. 95 | 96 | @return A new security policy. 97 | */ 98 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 99 | 100 | /** 101 | Creates and returns a security policy with the specified pinning mode. 102 | 103 | @param pinningMode The SSL pinning mode. 104 | @param pinnedCertificates The certificates to pin against. 105 | 106 | @return A new security policy. 107 | */ 108 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; 109 | 110 | ///------------------------------ 111 | /// @name Evaluating Server Trust 112 | ///------------------------------ 113 | 114 | /** 115 | Whether or not the specified server trust should be accepted, based on the security policy. 116 | 117 | This method should be used when responding to an authentication challenge from a server. 118 | 119 | @param serverTrust The X.509 certificate trust of the server. 120 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 121 | 122 | @return Whether or not to trust the server. 123 | */ 124 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 125 | forDomain:(nullable NSString *)domain; 126 | 127 | @end 128 | 129 | NS_ASSUME_NONNULL_END 130 | 131 | ///---------------- 132 | /// @name Constants 133 | ///---------------- 134 | 135 | /** 136 | ## SSL Pinning Modes 137 | 138 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 139 | 140 | enum { 141 | AFSSLPinningModeNone, 142 | AFSSLPinningModePublicKey, 143 | AFSSLPinningModeCertificate, 144 | } 145 | 146 | `AFSSLPinningModeNone` 147 | Do not used pinned certificates to validate servers. 148 | 149 | `AFSSLPinningModePublicKey` 150 | Validate host certificates against public keys of pinned certificates. 151 | 152 | `AFSSLPinningModeCertificate` 153 | Validate host certificates against pinned certificates. 154 | */ 155 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | // AFAutoPurgingImageCache.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | #import 27 | 28 | NS_ASSUME_NONNULL_BEGIN 29 | 30 | /** 31 | The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. 32 | */ 33 | @protocol AFImageCache 34 | 35 | /** 36 | Adds the image to the cache with the given identifier. 37 | 38 | @param image The image to cache. 39 | @param identifier The unique identifier for the image in the cache. 40 | */ 41 | - (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; 42 | 43 | /** 44 | Removes the image from the cache matching the given identifier. 45 | 46 | @param identifier The unique identifier for the image in the cache. 47 | 48 | @return A BOOL indicating whether or not the image was removed from the cache. 49 | */ 50 | - (BOOL)removeImageWithIdentifier:(NSString *)identifier; 51 | 52 | /** 53 | Removes all images from the cache. 54 | 55 | @return A BOOL indicating whether or not all images were removed from the cache. 56 | */ 57 | - (BOOL)removeAllImages; 58 | 59 | /** 60 | Returns the image in the cache associated with the given identifier. 61 | 62 | @param identifier The unique identifier for the image in the cache. 63 | 64 | @return An image for the matching identifier, or nil. 65 | */ 66 | - (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; 67 | @end 68 | 69 | 70 | /** 71 | The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. 72 | */ 73 | @protocol AFImageRequestCache 74 | 75 | /** 76 | Asks if the image should be cached using an identifier created from the request and additional identifier. 77 | 78 | @param image The image to be cached. 79 | @param request The unique URL request identifing the image asset. 80 | @param identifier The additional identifier to apply to the URL request to identify the image. 81 | 82 | @return A BOOL indicating whether or not the image should be added to the cache. YES will cache, NO will prevent caching. 83 | */ 84 | - (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 85 | 86 | /** 87 | Adds the image to the cache using an identifier created from the request and additional identifier. 88 | 89 | @param image The image to cache. 90 | @param request The unique URL request identifing the image asset. 91 | @param identifier The additional identifier to apply to the URL request to identify the image. 92 | */ 93 | - (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 94 | 95 | /** 96 | Removes the image from the cache using an identifier created from the request and additional identifier. 97 | 98 | @param request The unique URL request identifing the image asset. 99 | @param identifier The additional identifier to apply to the URL request to identify the image. 100 | 101 | @return A BOOL indicating whether or not all images were removed from the cache. 102 | */ 103 | - (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 104 | 105 | /** 106 | Returns the image from the cache associated with an identifier created from the request and additional identifier. 107 | 108 | @param request The unique URL request identifing the image asset. 109 | @param identifier The additional identifier to apply to the URL request to identify the image. 110 | 111 | @return An image for the matching request and identifier, or nil. 112 | */ 113 | - (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 114 | 115 | @end 116 | 117 | /** 118 | The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. 119 | */ 120 | @interface AFAutoPurgingImageCache : NSObject 121 | 122 | /** 123 | The total memory capacity of the cache in bytes. 124 | */ 125 | @property (nonatomic, assign) UInt64 memoryCapacity; 126 | 127 | /** 128 | The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. 129 | */ 130 | @property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; 131 | 132 | /** 133 | The current total memory usage in bytes of all images stored within the cache. 134 | */ 135 | @property (nonatomic, assign, readonly) UInt64 memoryUsage; 136 | 137 | /** 138 | Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. 139 | 140 | @return The new `AutoPurgingImageCache` instance. 141 | */ 142 | - (instancetype)init; 143 | 144 | /** 145 | Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage 146 | after purge limit. 147 | 148 | @param memoryCapacity The total memory capacity of the cache in bytes. 149 | @param preferredMemoryCapacity The preferred memory usage after purge in bytes. 150 | 151 | @return The new `AutoPurgingImageCache` instance. 152 | */ 153 | - (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; 154 | 155 | @end 156 | 157 | NS_ASSUME_NONNULL_END 158 | 159 | #endif 160 | 161 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator manager is currently active. 56 | */ 57 | @property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 58 | 59 | /** 60 | A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. 61 | 62 | Apple's HIG describes the following: 63 | 64 | > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. 65 | 66 | */ 67 | @property (nonatomic, assign) NSTimeInterval activationDelay; 68 | 69 | /** 70 | A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. 71 | */ 72 | 73 | @property (nonatomic, assign) NSTimeInterval completionDelay; 74 | 75 | /** 76 | Returns the shared network activity indicator manager object for the system. 77 | 78 | @return The systemwide network activity indicator manager. 79 | */ 80 | + (instancetype)sharedManager; 81 | 82 | /** 83 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 84 | */ 85 | - (void)incrementActivityCount; 86 | 87 | /** 88 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 89 | */ 90 | - (void)decrementActivityCount; 91 | 92 | /** 93 | Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. 94 | 95 | @param block A block to be executed when the network activity indicator status changes. 96 | */ 97 | - (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; 98 | 99 | @end 100 | 101 | NS_ASSUME_NONNULL_END 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIActivityIndicatorView+AFNetworking.h" 23 | #import 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import "AFURLSessionManager.h" 28 | 29 | @interface AFActivityIndicatorViewNotificationObserver : NSObject 30 | @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; 31 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; 32 | 33 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 34 | 35 | @end 36 | 37 | @implementation UIActivityIndicatorView (AFNetworking) 38 | 39 | - (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { 40 | AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 41 | if (notificationObserver == nil) { 42 | notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; 43 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | return notificationObserver; 46 | } 47 | 48 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 49 | [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; 50 | } 51 | 52 | @end 53 | 54 | @implementation AFActivityIndicatorViewNotificationObserver 55 | 56 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView 57 | { 58 | self = [super init]; 59 | if (self) { 60 | _activityIndicatorView = activityIndicatorView; 61 | } 62 | return self; 63 | } 64 | 65 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 66 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 67 | 68 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 71 | 72 | if (task) { 73 | if (task.state != NSURLSessionTaskStateCompleted) { 74 | UIActivityIndicatorView *activityIndicatorView = self.activityIndicatorView; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [activityIndicatorView startAnimating]; 77 | } else { 78 | [activityIndicatorView stopAnimating]; 79 | } 80 | 81 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 82 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; 83 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; 84 | } 85 | } 86 | } 87 | 88 | #pragma mark - 89 | 90 | - (void)af_startAnimating { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self.activityIndicatorView startAnimating]; 93 | }); 94 | } 95 | 96 | - (void)af_stopAnimating { 97 | dispatch_async(dispatch_get_main_queue(), ^{ 98 | [self.activityIndicatorView stopAnimating]; 99 | }); 100 | } 101 | 102 | #pragma mark - 103 | 104 | - (void)dealloc { 105 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 106 | 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 109 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 110 | } 111 | 112 | @end 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFImageDownloader; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. 36 | */ 37 | @interface UIImageView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Accessing the Image Downloader 41 | ///------------------------------------ 42 | 43 | /** 44 | Set the shared image downloader used to download images. 45 | 46 | @param imageDownloader The shared image downloader used to download images. 47 | */ 48 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; 49 | 50 | /** 51 | The shared image downloader used to download images. 52 | */ 53 | + (AFImageDownloader *)sharedImageDownloader; 54 | 55 | ///-------------------- 56 | /// @name Setting Image 57 | ///-------------------- 58 | 59 | /** 60 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 61 | 62 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 63 | 64 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 65 | 66 | @param url The URL used for the image request. 67 | */ 68 | - (void)setImageWithURL:(NSURL *)url; 69 | 70 | /** 71 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 72 | 73 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 74 | 75 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 76 | 77 | @param url The URL used for the image request. 78 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 79 | */ 80 | - (void)setImageWithURL:(NSURL *)url 81 | placeholderImage:(nullable UIImage *)placeholderImage; 82 | 83 | /** 84 | Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 85 | 86 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 87 | 88 | If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. 89 | 90 | @param urlRequest The URL request used for the image request. 91 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 92 | @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. 93 | @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. 94 | */ 95 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 96 | placeholderImage:(nullable UIImage *)placeholderImage 97 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 98 | failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 99 | 100 | /** 101 | Cancels any executing image operation for the receiver, if one exists. 102 | */ 103 | - (void)cancelImageDownloadTask; 104 | 105 | @end 106 | 107 | NS_ASSUME_NONNULL_END 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIImageView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFImageDownloader.h" 29 | 30 | @interface UIImageView (_AFNetworking) 31 | @property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; 32 | @end 33 | 34 | @implementation UIImageView (_AFNetworking) 35 | 36 | - (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { 37 | return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); 38 | } 39 | 40 | - (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { 41 | objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 | } 43 | 44 | @end 45 | 46 | #pragma mark - 47 | 48 | @implementation UIImageView (AFNetworking) 49 | 50 | + (AFImageDownloader *)sharedImageDownloader { 51 | return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; 52 | } 53 | 54 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { 55 | objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 56 | } 57 | 58 | #pragma mark - 59 | 60 | - (void)setImageWithURL:(NSURL *)url { 61 | [self setImageWithURL:url placeholderImage:nil]; 62 | } 63 | 64 | - (void)setImageWithURL:(NSURL *)url 65 | placeholderImage:(UIImage *)placeholderImage 66 | { 67 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 68 | [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; 69 | 70 | [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; 71 | } 72 | 73 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 74 | placeholderImage:(UIImage *)placeholderImage 75 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 76 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 77 | { 78 | 79 | if ([urlRequest URL] == nil) { 80 | self.image = placeholderImage; 81 | if (failure) { 82 | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil]; 83 | failure(urlRequest, nil, error); 84 | } 85 | return; 86 | } 87 | 88 | if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ 89 | return; 90 | } 91 | 92 | [self cancelImageDownloadTask]; 93 | 94 | AFImageDownloader *downloader = [[self class] sharedImageDownloader]; 95 | id imageCache = downloader.imageCache; 96 | 97 | //Use the image from the image cache if it exists 98 | UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 99 | if (cachedImage) { 100 | if (success) { 101 | success(urlRequest, nil, cachedImage); 102 | } else { 103 | self.image = cachedImage; 104 | } 105 | [self clearActiveDownloadInformation]; 106 | } else { 107 | if (placeholderImage) { 108 | self.image = placeholderImage; 109 | } 110 | 111 | __weak __typeof(self)weakSelf = self; 112 | NSUUID *downloadID = [NSUUID UUID]; 113 | AFImageDownloadReceipt *receipt; 114 | receipt = [downloader 115 | downloadImageForURLRequest:urlRequest 116 | withReceiptID:downloadID 117 | success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { 118 | __strong __typeof(weakSelf)strongSelf = weakSelf; 119 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 120 | if (success) { 121 | success(request, response, responseObject); 122 | } else if(responseObject) { 123 | strongSelf.image = responseObject; 124 | } 125 | [strongSelf clearActiveDownloadInformation]; 126 | } 127 | 128 | } 129 | failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { 130 | __strong __typeof(weakSelf)strongSelf = weakSelf; 131 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 132 | if (failure) { 133 | failure(request, response, error); 134 | } 135 | [strongSelf clearActiveDownloadInformation]; 136 | } 137 | }]; 138 | 139 | self.af_activeImageDownloadReceipt = receipt; 140 | } 141 | } 142 | 143 | - (void)cancelImageDownloadTask { 144 | if (self.af_activeImageDownloadReceipt != nil) { 145 | [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; 146 | [self clearActiveDownloadInformation]; 147 | } 148 | } 149 | 150 | - (void)clearActiveDownloadInformation { 151 | self.af_activeImageDownloadReceipt = nil; 152 | } 153 | 154 | - (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { 155 | return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 156 | } 157 | 158 | @end 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIProgressView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; 31 | static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; 32 | 33 | #pragma mark - 34 | 35 | @implementation UIProgressView (AFNetworking) 36 | 37 | - (BOOL)af_uploadProgressAnimated { 38 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; 39 | } 40 | 41 | - (void)af_setUploadProgressAnimated:(BOOL)animated { 42 | objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 43 | } 44 | 45 | - (BOOL)af_downloadProgressAnimated { 46 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; 47 | } 48 | 49 | - (void)af_setDownloadProgressAnimated:(BOOL)animated { 50 | objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 51 | } 52 | 53 | #pragma mark - 54 | 55 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 56 | animated:(BOOL)animated 57 | { 58 | if (task.state == NSURLSessionTaskStateCompleted) { 59 | return; 60 | } 61 | 62 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 63 | [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 64 | 65 | [self af_setUploadProgressAnimated:animated]; 66 | } 67 | 68 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 69 | animated:(BOOL)animated 70 | { 71 | if (task.state == NSURLSessionTaskStateCompleted) { 72 | return; 73 | } 74 | 75 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 76 | [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 77 | 78 | [self af_setDownloadProgressAnimated:animated]; 79 | } 80 | 81 | #pragma mark - NSKeyValueObserving 82 | 83 | - (void)observeValueForKeyPath:(NSString *)keyPath 84 | ofObject:(id)object 85 | change:(__unused NSDictionary *)change 86 | context:(void *)context 87 | { 88 | if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { 89 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { 90 | if ([object countOfBytesExpectedToSend] > 0) { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; 93 | }); 94 | } 95 | } 96 | 97 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { 98 | if ([object countOfBytesExpectedToReceive] > 0) { 99 | dispatch_async(dispatch_get_main_queue(), ^{ 100 | [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; 101 | }); 102 | } 103 | } 104 | 105 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { 106 | if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { 107 | @try { 108 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; 109 | 110 | if (context == AFTaskCountOfBytesSentContext) { 111 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; 112 | } 113 | 114 | if (context == AFTaskCountOfBytesReceivedContext) { 115 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; 116 | } 117 | } 118 | @catch (NSException * __unused exception) {} 119 | } 120 | } 121 | } 122 | } 123 | 124 | @end 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import "UIRefreshControl+AFNetworking.h" 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | @interface AFRefreshControlNotificationObserver : NSObject 31 | @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; 32 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; 33 | 34 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 35 | 36 | @end 37 | 38 | @implementation UIRefreshControl (AFNetworking) 39 | 40 | - (AFRefreshControlNotificationObserver *)af_notificationObserver { 41 | AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 42 | if (notificationObserver == nil) { 43 | notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; 44 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | } 46 | return notificationObserver; 47 | } 48 | 49 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 50 | [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; 51 | } 52 | 53 | @end 54 | 55 | @implementation AFRefreshControlNotificationObserver 56 | 57 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl 58 | { 59 | self = [super init]; 60 | if (self) { 61 | _refreshControl = refreshControl; 62 | } 63 | return self; 64 | } 65 | 66 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 67 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 68 | 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 71 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 72 | 73 | if (task) { 74 | UIRefreshControl *refreshControl = self.refreshControl; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [refreshControl beginRefreshing]; 77 | 78 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 79 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 80 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 81 | } else { 82 | [refreshControl endRefreshing]; 83 | } 84 | } 85 | } 86 | 87 | #pragma mark - 88 | 89 | - (void)af_beginRefreshing { 90 | dispatch_async(dispatch_get_main_queue(), ^{ 91 | [self.refreshControl beginRefreshing]; 92 | }); 93 | } 94 | 95 | - (void)af_endRefreshing { 96 | dispatch_async(dispatch_get_main_queue(), ^{ 97 | [self.refreshControl endRefreshing]; 98 | }); 99 | } 100 | 101 | #pragma mark - 102 | 103 | - (void)dealloc { 104 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 105 | 106 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 109 | } 110 | 111 | @end 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPSessionManager; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 36 | 37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 38 | */ 39 | @interface UIWebView (AFNetworking) 40 | 41 | /** 42 | The session manager used to download all requests. 43 | */ 44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 45 | 46 | /** 47 | Asynchronously loads the specified request. 48 | 49 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 50 | @param progress A progress object monitoring the current download progress. 51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 53 | */ 54 | - (void)loadRequest:(NSURLRequest *)request 55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 57 | failure:(nullable void (^)(NSError *error))failure; 58 | 59 | /** 60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 61 | 62 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 65 | @param progress A progress object monitoring the current download progress. 66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 68 | */ 69 | - (void)loadRequest:(NSURLRequest *)request 70 | MIMEType:(nullable NSString *)MIMEType 71 | textEncodingName:(nullable NSString *)textEncodingName 72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 74 | failure:(nullable void (^)(NSError *error))failure; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIWebView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import "AFHTTPSessionManager.h" 29 | #import "AFURLResponseSerialization.h" 30 | #import "AFURLRequestSerialization.h" 31 | 32 | @interface UIWebView (_AFNetworking) 33 | @property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; 34 | @end 35 | 36 | @implementation UIWebView (_AFNetworking) 37 | 38 | - (NSURLSessionDataTask *)af_URLSessionTask { 39 | return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); 40 | } 41 | 42 | - (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask { 43 | objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | @end 47 | 48 | #pragma mark - 49 | 50 | @implementation UIWebView (AFNetworking) 51 | 52 | - (AFHTTPSessionManager *)sessionManager { 53 | static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; 54 | static dispatch_once_t onceToken; 55 | dispatch_once(&onceToken, ^{ 56 | _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; 57 | _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer]; 58 | _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; 59 | }); 60 | 61 | return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; 62 | } 63 | 64 | - (void)setSessionManager:(AFHTTPSessionManager *)sessionManager { 65 | objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 66 | } 67 | 68 | - (AFHTTPResponseSerializer *)responseSerializer { 69 | static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; 70 | static dispatch_once_t onceToken; 71 | dispatch_once(&onceToken, ^{ 72 | _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; 73 | }); 74 | 75 | return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; 76 | } 77 | 78 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { 79 | objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 80 | } 81 | 82 | #pragma mark - 83 | 84 | - (void)loadRequest:(NSURLRequest *)request 85 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 86 | success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 87 | failure:(void (^)(NSError *error))failure 88 | { 89 | [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { 90 | NSStringEncoding stringEncoding = NSUTF8StringEncoding; 91 | if (response.textEncodingName) { 92 | CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); 93 | if (encoding != kCFStringEncodingInvalidId) { 94 | stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); 95 | } 96 | } 97 | 98 | NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; 99 | if (success) { 100 | string = success(response, string); 101 | } 102 | 103 | return [string dataUsingEncoding:stringEncoding]; 104 | } failure:failure]; 105 | } 106 | 107 | - (void)loadRequest:(NSURLRequest *)request 108 | MIMEType:(NSString *)MIMEType 109 | textEncodingName:(NSString *)textEncodingName 110 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 111 | success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 112 | failure:(void (^)(NSError *error))failure 113 | { 114 | NSParameterAssert(request); 115 | 116 | if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) { 117 | [self.af_URLSessionTask cancel]; 118 | } 119 | self.af_URLSessionTask = nil; 120 | 121 | __weak __typeof(self)weakSelf = self; 122 | __block NSURLSessionDataTask *dataTask; 123 | dataTask = [self.sessionManager 124 | dataTaskWithRequest:request 125 | uploadProgress:nil 126 | downloadProgress:nil 127 | completionHandler:^(NSURLResponse * _Nonnull response, id _Nonnull responseObject, NSError * _Nullable error) { 128 | __strong __typeof(weakSelf) strongSelf = weakSelf; 129 | if (error) { 130 | if (failure) { 131 | failure(error); 132 | } 133 | } else { 134 | if (success) { 135 | success((NSHTTPURLResponse *)response, responseObject); 136 | } 137 | [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]]; 138 | 139 | if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { 140 | [strongSelf.delegate webViewDidFinishLoad:strongSelf]; 141 | } 142 | } 143 | }]; 144 | self.af_URLSessionTask = dataTask; 145 | if (progress != nil) { 146 | *progress = [self.sessionManager downloadProgressForTask:dataTask]; 147 | } 148 | [self.af_URLSessionTask resume]; 149 | 150 | if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { 151 | [self.delegate webViewDidStartLoad:self]; 152 | } 153 | } 154 | 155 | @end 156 | 157 | #endif 158 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFCompatibilityMacros.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFCompatibilityMacros.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYCache/YYCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYCache/YYDiskCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYDiskCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYCache/YYKVStorage.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYKVStorage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYCache/YYMemoryCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYMemoryCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYImage/YYAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYAnimatedImageView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYImage/YYFrameImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYFrameImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYImage/YYImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYImage/YYImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYImage/YYSpriteSheetImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYSpriteSheetImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYModel/NSObject+YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/NSObject+YYModel.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYModel/YYClassInfo.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYClassInfo.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYModel.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/CALayer+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/CALayer+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/MKAnnotationView+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/MKAnnotationView+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/UIButton+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIButton+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/UIImage+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIImage+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/UIImageView+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIImageView+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/YYImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/YYWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/YYWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/YYWebImage/_YYWebImageSetter.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/_YYWebImageSetter.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFCompatibilityMacros.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFCompatibilityMacros.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYCache/YYCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYCache/YYDiskCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYDiskCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYCache/YYKVStorage.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYKVStorage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYCache/YYMemoryCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYCache/YYCache/YYMemoryCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYImage/YYAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYAnimatedImageView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYImage/YYFrameImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYFrameImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYImage/YYImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYImage/YYImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYImage/YYSpriteSheetImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYImage/YYImage/YYSpriteSheetImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYModel/NSObject+YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/NSObject+YYModel.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYModel/YYClassInfo.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYClassInfo.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | ../../../YYModel/YYModel/YYModel.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/CALayer+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/CALayer+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/MKAnnotationView+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/MKAnnotationView+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/UIButton+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIButton+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/UIImage+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIImage+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/UIImageView+YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/Categories/UIImageView+YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/YYImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/YYWebImage.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImage.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/YYWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/YYWebImage/YYWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../YYWebImage/YYWebImage/YYWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.1): 3 | - AFNetworking/NSURLSession (= 3.2.1) 4 | - AFNetworking/Reachability (= 3.2.1) 5 | - AFNetworking/Security (= 3.2.1) 6 | - AFNetworking/Serialization (= 3.2.1) 7 | - AFNetworking/UIKit (= 3.2.1) 8 | - AFNetworking/NSURLSession (3.2.1): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.1) 13 | - AFNetworking/Security (3.2.1) 14 | - AFNetworking/Serialization (3.2.1) 15 | - AFNetworking/UIKit (3.2.1): 16 | - AFNetworking/NSURLSession 17 | - YYCache (1.0.4) 18 | - YYImage (1.0.4): 19 | - YYImage/Core (= 1.0.4) 20 | - YYImage/Core (1.0.4) 21 | - YYModel (1.0.4) 22 | - YYWebImage (1.0.5): 23 | - YYCache 24 | - YYImage 25 | 26 | DEPENDENCIES: 27 | - AFNetworking 28 | - YYModel 29 | - YYWebImage 30 | 31 | SPEC REPOS: 32 | https://github.com/cocoapods/specs.git: 33 | - AFNetworking 34 | - YYCache 35 | - YYImage 36 | - YYModel 37 | - YYWebImage 38 | 39 | SPEC CHECKSUMS: 40 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 41 | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 42 | YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 43 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 44 | YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 45 | 46 | PODFILE CHECKSUM: 70670a742e6a0a78a7c2b388bf9034fc924671ea 47 | 48 | COCOAPODS: 1.5.3 49 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TableViewCellOptimization/Pods-TableViewCellOptimization-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## YYCache 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2015 ibireme 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | 52 | 53 | ## YYImage 54 | 55 | The MIT License (MIT) 56 | 57 | Copyright (c) 2015 ibireme 58 | 59 | Permission is hereby granted, free of charge, to any person obtaining a copy 60 | of this software and associated documentation files (the "Software"), to deal 61 | in the Software without restriction, including without limitation the rights 62 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 63 | copies of the Software, and to permit persons to whom the Software is 64 | furnished to do so, subject to the following conditions: 65 | 66 | The above copyright notice and this permission notice shall be included in all 67 | copies or substantial portions of the Software. 68 | 69 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 70 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 71 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 72 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 73 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 74 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 75 | SOFTWARE. 76 | 77 | 78 | 79 | ## YYModel 80 | 81 | The MIT License (MIT) 82 | 83 | Copyright (c) 2015 ibireme 84 | 85 | Permission is hereby granted, free of charge, to any person obtaining a copy 86 | of this software and associated documentation files (the "Software"), to deal 87 | in the Software without restriction, including without limitation the rights 88 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 89 | copies of the Software, and to permit persons to whom the Software is 90 | furnished to do so, subject to the following conditions: 91 | 92 | The above copyright notice and this permission notice shall be included in all 93 | copies or substantial portions of the Software. 94 | 95 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 96 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 97 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 98 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 99 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 100 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 101 | SOFTWARE. 102 | 103 | 104 | 105 | ## YYWebImage 106 | 107 | The MIT License (MIT) 108 | 109 | Copyright (c) 2015 ibireme 110 | 111 | Permission is hereby granted, free of charge, to any person obtaining a copy 112 | of this software and associated documentation files (the "Software"), to deal 113 | in the Software without restriction, including without limitation the rights 114 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 115 | copies of the Software, and to permit persons to whom the Software is 116 | furnished to do so, subject to the following conditions: 117 | 118 | The above copyright notice and this permission notice shall be included in all 119 | copies or substantial portions of the Software. 120 | 121 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 122 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 123 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 124 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 125 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 126 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 127 | SOFTWARE. 128 | 129 | 130 | Generated by CocoaPods - https://cocoapods.org 131 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TableViewCellOptimization/Pods-TableViewCellOptimization-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TableViewCellOptimization : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TableViewCellOptimization 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TableViewCellOptimization/Pods-TableViewCellOptimization-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TableViewCellOptimization/Pods-TableViewCellOptimization.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/YYCache" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYModel" "${PODS_ROOT}/Headers/Public/YYWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/YYCache" -isystem "${PODS_ROOT}/Headers/Public/YYImage" -isystem "${PODS_ROOT}/Headers/Public/YYModel" -isystem "${PODS_ROOT}/Headers/Public/YYWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"YYCache" -l"YYImage" -l"YYModel" -l"YYWebImage" -l"sqlite3" -l"z" -framework "Accelerate" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "CoreGraphics" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-TableViewCellOptimization/Pods-TableViewCellOptimization.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/YYCache" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYModel" "${PODS_ROOT}/Headers/Public/YYWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" "${PODS_CONFIGURATION_BUILD_DIR}/YYModel" "${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/YYCache" -isystem "${PODS_ROOT}/Headers/Public/YYImage" -isystem "${PODS_ROOT}/Headers/Public/YYModel" -isystem "${PODS_ROOT}/Headers/Public/YYWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"YYCache" -l"YYImage" -l"YYModel" -l"YYWebImage" -l"sqlite3" -l"z" -framework "Accelerate" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "CoreGraphics" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYCache/YYCache-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYCache : NSObject 3 | @end 4 | @implementation PodsDummy_YYCache 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYCache/YYCache-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYCache/YYCache.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYCache 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYCache" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YYCache" 4 | OTHER_LDFLAGS = -l"sqlite3" -framework "CoreFoundation" -framework "QuartzCore" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYCache 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYImage/YYImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYImage : NSObject 3 | @end 4 | @implementation PodsDummy_YYImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYImage/YYImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYImage/YYImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YYImage" 4 | OTHER_LDFLAGS = -l"z" -framework "Accelerate" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYModel : NSObject 3 | @end 4 | @implementation PodsDummy_YYModel 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYModel 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYModel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YYModel" 4 | OTHER_LDFLAGS = -framework "CoreFoundation" -framework "Foundation" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYModel 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYWebImage/YYWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_YYWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYWebImage/YYWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYWebImage/YYWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/YYWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/YYCache" "${PODS_ROOT}/Headers/Public/YYImage" "${PODS_ROOT}/Headers/Public/YYWebImage" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/YYCache" "${PODS_CONFIGURATION_BUILD_DIR}/YYImage" 5 | OTHER_LDFLAGS = -framework "Accelerate" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "QuartzCore" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYWebImage 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Pods/YYCache/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/YYCache/README.md: -------------------------------------------------------------------------------- 1 | YYCache 2 | ============== 3 | 4 | [![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/ibireme/YYCache/master/LICENSE)  5 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)  6 | [![CocoaPods](http://img.shields.io/cocoapods/v/YYCache.svg?style=flat)](http://cocoapods.org/?q= YYCache)  7 | [![CocoaPods](http://img.shields.io/cocoapods/p/YYCache.svg?style=flat)](http://cocoapods.org/?q= YYCache)  8 | [![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)  9 | [![Build Status](https://travis-ci.org/ibireme/YYCache.svg?branch=master)](https://travis-ci.org/ibireme/YYCache) 10 | 11 | High performance cache framework for iOS.
12 | (It's a component of [YYKit](https://github.com/ibireme/YYKit)) 13 | 14 | Performance 15 | ============== 16 | 17 | ![Memory cache benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_memory.png 18 | ) 19 | 20 | ![Disk benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_disk.png 21 | ) 22 | 23 | You may [download](http://www.sqlite.org/download.html) and compile the latest version of sqlite and ignore the libsqlite3.dylib in iOS system to get higher performance. 24 | 25 | See `Benchmark/CacheBenchmark.xcodeproj` for more benchmark case. 26 | 27 | 28 | Features 29 | ============== 30 | - **LRU**: Objects can be evicted with least-recently-used algorithm. 31 | - **Limitation**: Cache limitation can be controlled with count, cost, age and free space. 32 | - **Compatibility**: The API is similar to `NSCache`, all methods are thread-safe. 33 | - **Memory Cache** 34 | - **Release Control**: Objects can be released synchronously/asynchronously on main thread or background thread. 35 | - **Automatically Clear**: It can be configured to automatically evict objects when receive memory warning or app enter background. 36 | - **Disk Cache** 37 | - **Customization**: It supports custom archive and unarchive method to store object which does not adopt NSCoding. 38 | - **Storage Type Control**: It can automatically decide the storage type (sqlite / file) for each object to get 39 | better performance. 40 | 41 | 42 | Installation 43 | ============== 44 | 45 | ### CocoaPods 46 | 47 | 1. Add `pod 'YYCache'` to your Podfile. 48 | 2. Run `pod install` or `pod update`. 49 | 3. Import \. 50 | 51 | 52 | ### Carthage 53 | 54 | 1. Add `github "ibireme/YYCache"` to your Cartfile. 55 | 2. Run `carthage update --platform ios` and add the framework to your project. 56 | 3. Import \. 57 | 58 | 59 | ### Manually 60 | 61 | 1. Download all the files in the YYCache subdirectory. 62 | 2. Add the source files to your Xcode project. 63 | 3. Link with required frameworks: 64 | * UIKit 65 | * CoreFoundation 66 | * QuartzCore 67 | * sqlite3 68 | 4. Import `YYCache.h`. 69 | 70 | 71 | Documentation 72 | ============== 73 | Full API documentation is available on [CocoaDocs](http://cocoadocs.org/docsets/YYCache/).
74 | You can also install documentation locally using [appledoc](https://github.com/tomaz/appledoc). 75 | 76 | 77 | Requirements 78 | ============== 79 | This library requires `iOS 6.0+` and `Xcode 7.0+`. 80 | 81 | 82 | License 83 | ============== 84 | YYCache is provided under the MIT license. See LICENSE file for details. 85 | 86 | 87 |

88 | --- 89 | 中文介绍 90 | ============== 91 | 高性能 iOS 缓存框架。
92 | (该项目是 [YYKit](https://github.com/ibireme/YYKit) 组件之一) 93 | 94 | 性能 95 | ============== 96 | 97 | iPhone 6 上,内存缓存每秒响应次数 (越高越好): 98 | ![Memory cache benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_memory.png 99 | ) 100 | 101 | iPhone 6 上,磁盘缓存每秒响应次数 (越高越好): 102 | ![Disk benchmark result](https://raw.github.com/ibireme/YYCache/master/Benchmark/Result_disk.png 103 | ) 104 | 105 | 推荐到 SQLite 官网[下载](http://www.sqlite.org/download.html)和编译最新的 SQLite,以替换 iOS 自带的 libsqlite3.dylib,以获得最高 1.5~3 倍的性能提升。 106 | 107 | 更多测试代码和用例见 `Benchmark/CacheBenchmark.xcodeproj`。 108 | 109 | 110 | 特性 111 | ============== 112 | - **LRU**: 缓存支持 LRU (least-recently-used) 淘汰算法。 113 | - **缓存控制**: 支持多种缓存控制方法:总数量、总大小、存活时间、空闲空间。 114 | - **兼容性**: API 基本和 `NSCache` 保持一致, 所有方法都是线程安全的。 115 | - **内存缓存** 116 | - **对象释放控制**: 对象的释放(release) 可以配置为同步或异步进行,可以配置在主线程或后台线程进行。 117 | - **自动清空**: 当收到内存警告或 App 进入后台时,缓存可以配置为自动清空。 118 | - **磁盘缓存** 119 | - **可定制性**: 磁盘缓存支持自定义的归档解档方法,以支持那些没有实现 NSCoding 协议的对象。 120 | - **存储类型控制**: 磁盘缓存支持对每个对象的存储类型 (SQLite/文件) 进行自动或手动控制,以获得更高的存取性能。 121 | 122 | 123 | 安装 124 | ============== 125 | 126 | ### CocoaPods 127 | 128 | 1. 在 Podfile 中添加 `pod 'YYCache'`。 129 | 2. 执行 `pod install` 或 `pod update`。 130 | 3. 导入 \。 131 | 132 | 133 | ### Carthage 134 | 135 | 1. 在 Cartfile 中添加 `github "ibireme/YYCache"`。 136 | 2. 执行 `carthage update --platform ios` 并将生成的 framework 添加到你的工程。 137 | 3. 导入 \。 138 | 139 | 140 | ### 手动安装 141 | 142 | 1. 下载 YYCache 文件夹内的所有内容。 143 | 2. 将 YYCache 内的源文件添加(拖放)到你的工程。 144 | 3. 链接以下的 frameworks: 145 | * UIKit 146 | * CoreFoundation 147 | * QuartzCore 148 | * sqlite3 149 | 4. 导入 `YYCache.h`。 150 | 151 | 152 | 文档 153 | ============== 154 | 你可以在 [CocoaDocs](http://cocoadocs.org/docsets/YYCache/) 查看在线 API 文档,也可以用 [appledoc](https://github.com/tomaz/appledoc) 本地生成文档。 155 | 156 | 157 | 系统要求 158 | ============== 159 | 该项目最低支持 `iOS 6.0` 和 `Xcode 7.0`。 160 | 161 | 162 | 许可证 163 | ============== 164 | YYCache 使用 MIT 许可证,详情见 LICENSE 文件。 165 | 166 | 167 | 相关链接 168 | ============== 169 | [YYCache 设计思路与技术细节](http://blog.ibireme.com/2015/10/26/yycache/) 170 | 171 | 172 | -------------------------------------------------------------------------------- /Pods/YYCache/YYCache/YYCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYCache.m 3 | // YYCache 4 | // 5 | // Created by ibireme on 15/2/13. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "YYCache.h" 13 | #import "YYMemoryCache.h" 14 | #import "YYDiskCache.h" 15 | 16 | @implementation YYCache 17 | 18 | - (instancetype) init { 19 | NSLog(@"Use \"initWithName\" or \"initWithPath\" to create YYCache instance."); 20 | return [self initWithPath:@""]; 21 | } 22 | 23 | - (instancetype)initWithName:(NSString *)name { 24 | if (name.length == 0) return nil; 25 | NSString *cacheFolder = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; 26 | NSString *path = [cacheFolder stringByAppendingPathComponent:name]; 27 | return [self initWithPath:path]; 28 | } 29 | 30 | - (instancetype)initWithPath:(NSString *)path { 31 | if (path.length == 0) return nil; 32 | YYDiskCache *diskCache = [[YYDiskCache alloc] initWithPath:path]; 33 | if (!diskCache) return nil; 34 | NSString *name = [path lastPathComponent]; 35 | YYMemoryCache *memoryCache = [YYMemoryCache new]; 36 | memoryCache.name = name; 37 | 38 | self = [super init]; 39 | _name = name; 40 | _diskCache = diskCache; 41 | _memoryCache = memoryCache; 42 | return self; 43 | } 44 | 45 | + (instancetype)cacheWithName:(NSString *)name { 46 | return [[self alloc] initWithName:name]; 47 | } 48 | 49 | + (instancetype)cacheWithPath:(NSString *)path { 50 | return [[self alloc] initWithPath:path]; 51 | } 52 | 53 | - (BOOL)containsObjectForKey:(NSString *)key { 54 | return [_memoryCache containsObjectForKey:key] || [_diskCache containsObjectForKey:key]; 55 | } 56 | 57 | - (void)containsObjectForKey:(NSString *)key withBlock:(void (^)(NSString *key, BOOL contains))block { 58 | if (!block) return; 59 | 60 | if ([_memoryCache containsObjectForKey:key]) { 61 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 62 | block(key, YES); 63 | }); 64 | } else { 65 | [_diskCache containsObjectForKey:key withBlock:block]; 66 | } 67 | } 68 | 69 | - (id)objectForKey:(NSString *)key { 70 | id object = [_memoryCache objectForKey:key]; 71 | if (!object) { 72 | object = [_diskCache objectForKey:key]; 73 | if (object) { 74 | [_memoryCache setObject:object forKey:key]; 75 | } 76 | } 77 | return object; 78 | } 79 | 80 | - (void)objectForKey:(NSString *)key withBlock:(void (^)(NSString *key, id object))block { 81 | if (!block) return; 82 | id object = [_memoryCache objectForKey:key]; 83 | if (object) { 84 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 85 | block(key, object); 86 | }); 87 | } else { 88 | [_diskCache objectForKey:key withBlock:^(NSString *key, id object) { 89 | if (object && ![_memoryCache objectForKey:key]) { 90 | [_memoryCache setObject:object forKey:key]; 91 | } 92 | block(key, object); 93 | }]; 94 | } 95 | } 96 | 97 | - (void)setObject:(id)object forKey:(NSString *)key { 98 | [_memoryCache setObject:object forKey:key]; 99 | [_diskCache setObject:object forKey:key]; 100 | } 101 | 102 | - (void)setObject:(id)object forKey:(NSString *)key withBlock:(void (^)(void))block { 103 | [_memoryCache setObject:object forKey:key]; 104 | [_diskCache setObject:object forKey:key withBlock:block]; 105 | } 106 | 107 | - (void)removeObjectForKey:(NSString *)key { 108 | [_memoryCache removeObjectForKey:key]; 109 | [_diskCache removeObjectForKey:key]; 110 | } 111 | 112 | - (void)removeObjectForKey:(NSString *)key withBlock:(void (^)(NSString *key))block { 113 | [_memoryCache removeObjectForKey:key]; 114 | [_diskCache removeObjectForKey:key withBlock:block]; 115 | } 116 | 117 | - (void)removeAllObjects { 118 | [_memoryCache removeAllObjects]; 119 | [_diskCache removeAllObjects]; 120 | } 121 | 122 | - (void)removeAllObjectsWithBlock:(void(^)(void))block { 123 | [_memoryCache removeAllObjects]; 124 | [_diskCache removeAllObjectsWithBlock:block]; 125 | } 126 | 127 | - (void)removeAllObjectsWithProgressBlock:(void(^)(int removedCount, int totalCount))progress 128 | endBlock:(void(^)(BOOL error))end { 129 | [_memoryCache removeAllObjects]; 130 | [_diskCache removeAllObjectsWithProgressBlock:progress endBlock:end]; 131 | 132 | } 133 | 134 | - (NSString *)description { 135 | if (_name) return [NSString stringWithFormat:@"<%@: %p> (%@)", self.class, self, _name]; 136 | else return [NSString stringWithFormat:@"<%@: %p>", self.class, self]; 137 | } 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /Pods/YYImage/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYAnimatedImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYAnimatedImageView.h 3 | // YYImage 4 | // 5 | // Created by ibireme on 14/10/19. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | /** 17 | An image view for displaying animated image. 18 | 19 | @discussion It is a fully compatible `UIImageView` subclass. 20 | If the `image` or `highlightedImage` property adopt to the `YYAnimatedImage` protocol, 21 | then it can be used to play the multi-frame animation. The animation can also be 22 | controlled with the UIImageView methods `-startAnimating`, `-stopAnimating` and `-isAnimating`. 23 | 24 | This view request the frame data just in time. When the device has enough free memory, 25 | this view may cache some or all future frames in an inner buffer for lower CPU cost. 26 | Buffer size is dynamically adjusted based on the current state of the device memory. 27 | 28 | Sample Code: 29 | 30 | // ani@3x.gif 31 | YYImage *image = [YYImage imageNamed:@"ani"]; 32 | YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; 33 | [view addSubView:imageView]; 34 | */ 35 | @interface YYAnimatedImageView : UIImageView 36 | 37 | /** 38 | If the image has more than one frame, set this value to `YES` will automatically 39 | play/stop the animation when the view become visible/invisible. 40 | 41 | The default value is `YES`. 42 | */ 43 | @property (nonatomic) BOOL autoPlayAnimatedImage; 44 | 45 | /** 46 | Index of the currently displayed frame (index from 0). 47 | 48 | Set a new value to this property will cause to display the new frame immediately. 49 | If the new value is invalid, this method has no effect. 50 | 51 | You can add an observer to this property to observe the playing status. 52 | */ 53 | @property (nonatomic) NSUInteger currentAnimatedImageIndex; 54 | 55 | /** 56 | Whether the image view is playing animation currently. 57 | 58 | You can add an observer to this property to observe the playing status. 59 | */ 60 | @property (nonatomic, readonly) BOOL currentIsPlayingAnimation; 61 | 62 | /** 63 | The animation timer's runloop mode, default is `NSRunLoopCommonModes`. 64 | 65 | Set this property to `NSDefaultRunLoopMode` will make the animation pause during 66 | UIScrollView scrolling. 67 | */ 68 | @property (nonatomic, copy) NSString *runloopMode; 69 | 70 | /** 71 | The max size (in bytes) for inner frame buffer size, default is 0 (dynamically). 72 | 73 | When the device has enough free memory, this view will request and decode some or 74 | all future frame image into an inner buffer. If this property's value is 0, then 75 | the max buffer size will be dynamically adjusted based on the current state of 76 | the device free memory. Otherwise, the buffer size will be limited by this value. 77 | 78 | When receive memory warning or app enter background, the buffer will be released 79 | immediately, and may grow back at the right time. 80 | */ 81 | @property (nonatomic) NSUInteger maxBufferSize; 82 | 83 | @end 84 | 85 | 86 | 87 | /** 88 | The YYAnimatedImage protocol declares the required methods for animated image 89 | display with YYAnimatedImageView. 90 | 91 | Subclass a UIImage and implement this protocol, so that instances of that class 92 | can be set to YYAnimatedImageView.image or YYAnimatedImageView.highlightedImage 93 | to display animation. 94 | 95 | See `YYImage` and `YYFrameImage` for example. 96 | */ 97 | @protocol YYAnimatedImage 98 | @required 99 | /// Total animated frame count. 100 | /// It the frame count is less than 1, then the methods below will be ignored. 101 | - (NSUInteger)animatedImageFrameCount; 102 | 103 | /// Animation loop count, 0 means infinite looping. 104 | - (NSUInteger)animatedImageLoopCount; 105 | 106 | /// Bytes per frame (in memory). It may used to optimize memory buffer size. 107 | - (NSUInteger)animatedImageBytesPerFrame; 108 | 109 | /// Returns the frame image from a specified index. 110 | /// This method may be called on background thread. 111 | /// @param index Frame index (zero based). 112 | - (nullable UIImage *)animatedImageFrameAtIndex:(NSUInteger)index; 113 | 114 | /// Returns the frames's duration from a specified index. 115 | /// @param index Frame index (zero based). 116 | - (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index; 117 | 118 | @optional 119 | /// A rectangle in image coordinates defining the subrectangle of the image that 120 | /// will be displayed. The rectangle should not outside the image's bounds. 121 | /// It may used to display sprite animation with a single image (sprite sheet). 122 | - (CGRect)animatedImageContentsRectAtIndex:(NSUInteger)index; 123 | @end 124 | 125 | NS_ASSUME_NONNULL_END 126 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYFrameImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYFrameImage.h 3 | // YYImage 4 | // 5 | // Created by ibireme on 14/12/9. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | #import 16 | #elif __has_include() 17 | #import 18 | #else 19 | #import "YYAnimatedImageView.h" 20 | #endif 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | /** 25 | An image to display frame-based animation. 26 | 27 | @discussion It is a fully compatible `UIImage` subclass. 28 | It only support system image format such as png and jpeg. 29 | The animation can be played by YYAnimatedImageView. 30 | 31 | Sample Code: 32 | 33 | NSArray *paths = @[@"/ani/frame1.png", @"/ani/frame2.png", @"/ani/frame3.png"]; 34 | NSArray *times = @[@0.1, @0.2, @0.1]; 35 | YYFrameImage *image = [YYFrameImage alloc] initWithImagePaths:paths frameDurations:times repeats:YES]; 36 | YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; 37 | [view addSubView:imageView]; 38 | */ 39 | @interface YYFrameImage : UIImage 40 | 41 | /** 42 | Create a frame animated image from files. 43 | 44 | @param paths An array of NSString objects, contains the full or 45 | partial path to each image file. 46 | e.g. @[@"/ani/1.png",@"/ani/2.png",@"/ani/3.png"] 47 | 48 | @param oneFrameDuration The duration (in seconds) per frame. 49 | 50 | @param loopCount The animation loop count, 0 means infinite. 51 | 52 | @return An initialized YYFrameImage object, or nil when an error occurs. 53 | */ 54 | - (nullable instancetype)initWithImagePaths:(NSArray *)paths 55 | oneFrameDuration:(NSTimeInterval)oneFrameDuration 56 | loopCount:(NSUInteger)loopCount; 57 | 58 | /** 59 | Create a frame animated image from files. 60 | 61 | @param paths An array of NSString objects, contains the full or 62 | partial path to each image file. 63 | e.g. @[@"/ani/frame1.png",@"/ani/frame2.png",@"/ani/frame3.png"] 64 | 65 | @param frameDurations An array of NSNumber objects, contains the duration (in seconds) per frame. 66 | e.g. @[@0.1, @0.2, @0.3]; 67 | 68 | @param loopCount The animation loop count, 0 means infinite. 69 | 70 | @return An initialized YYFrameImage object, or nil when an error occurs. 71 | */ 72 | - (nullable instancetype)initWithImagePaths:(NSArray *)paths 73 | frameDurations:(NSArray *)frameDurations 74 | loopCount:(NSUInteger)loopCount; 75 | 76 | /** 77 | Create a frame animated image from an array of data. 78 | 79 | @param dataArray An array of NSData objects. 80 | 81 | @param oneFrameDuration The duration (in seconds) per frame. 82 | 83 | @param loopCount The animation loop count, 0 means infinite. 84 | 85 | @return An initialized YYFrameImage object, or nil when an error occurs. 86 | */ 87 | - (nullable instancetype)initWithImageDataArray:(NSArray *)dataArray 88 | oneFrameDuration:(NSTimeInterval)oneFrameDuration 89 | loopCount:(NSUInteger)loopCount; 90 | 91 | /** 92 | Create a frame animated image from an array of data. 93 | 94 | @param dataArray An array of NSData objects. 95 | 96 | @param frameDurations An array of NSNumber objects, contains the duration (in seconds) per frame. 97 | e.g. @[@0.1, @0.2, @0.3]; 98 | 99 | @param loopCount The animation loop count, 0 means infinite. 100 | 101 | @return An initialized YYFrameImage object, or nil when an error occurs. 102 | */ 103 | - (nullable instancetype)initWithImageDataArray:(NSArray *)dataArray 104 | frameDurations:(NSArray *)frameDurations 105 | loopCount:(NSUInteger)loopCount; 106 | 107 | @end 108 | 109 | NS_ASSUME_NONNULL_END 110 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYFrameImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYFrameImage.m 3 | // YYImage 4 | // 5 | // Created by ibireme on 14/12/9. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "YYFrameImage.h" 13 | #import "YYImageCoder.h" 14 | 15 | 16 | /** 17 | Return the path scale. 18 | 19 | e.g. 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Path Scale
"icon.png" 1
"icon@2x.png" 2
"icon@2.5x.png" 2.5
"icon@2x" 1
"icon@2x..png" 1
"icon@2x.png/" 1
29 | */ 30 | static CGFloat _NSStringPathScale(NSString *string) { 31 | if (string.length == 0 || [string hasSuffix:@"/"]) return 1; 32 | NSString *name = string.stringByDeletingPathExtension; 33 | __block CGFloat scale = 1; 34 | 35 | NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines error:nil]; 36 | [pattern enumerateMatchesInString:name options:kNilOptions range:NSMakeRange(0, name.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { 37 | if (result.range.location >= 3) { 38 | scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue; 39 | } 40 | }]; 41 | 42 | return scale; 43 | } 44 | 45 | 46 | 47 | @implementation YYFrameImage { 48 | NSUInteger _loopCount; 49 | NSUInteger _oneFrameBytes; 50 | NSArray *_imagePaths; 51 | NSArray *_imageDatas; 52 | NSArray *_frameDurations; 53 | } 54 | 55 | - (instancetype)initWithImagePaths:(NSArray *)paths oneFrameDuration:(NSTimeInterval)oneFrameDuration loopCount:(NSUInteger)loopCount { 56 | NSMutableArray *durations = [NSMutableArray new]; 57 | for (int i = 0, max = (int)paths.count; i < max; i++) { 58 | [durations addObject:@(oneFrameDuration)]; 59 | } 60 | return [self initWithImagePaths:paths frameDurations:durations loopCount:loopCount]; 61 | } 62 | 63 | - (instancetype)initWithImagePaths:(NSArray *)paths frameDurations:(NSArray *)frameDurations loopCount:(NSUInteger)loopCount { 64 | if (paths.count == 0) return nil; 65 | if (paths.count != frameDurations.count) return nil; 66 | 67 | NSString *firstPath = paths[0]; 68 | NSData *firstData = [NSData dataWithContentsOfFile:firstPath]; 69 | CGFloat scale = _NSStringPathScale(firstPath); 70 | UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; 71 | self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; 72 | if (!self) return nil; 73 | long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); 74 | _oneFrameBytes = (NSUInteger)frameByte; 75 | _imagePaths = paths.copy; 76 | _frameDurations = frameDurations.copy; 77 | _loopCount = loopCount; 78 | 79 | return self; 80 | } 81 | 82 | - (instancetype)initWithImageDataArray:(NSArray *)dataArray oneFrameDuration:(NSTimeInterval)oneFrameDuration loopCount:(NSUInteger)loopCount { 83 | NSMutableArray *durations = [NSMutableArray new]; 84 | for (int i = 0, max = (int)dataArray.count; i < max; i++) { 85 | [durations addObject:@(oneFrameDuration)]; 86 | } 87 | return [self initWithImageDataArray:dataArray frameDurations:durations loopCount:loopCount]; 88 | } 89 | 90 | - (instancetype)initWithImageDataArray:(NSArray *)dataArray frameDurations:(NSArray *)frameDurations loopCount:(NSUInteger)loopCount { 91 | if (dataArray.count == 0) return nil; 92 | if (dataArray.count != frameDurations.count) return nil; 93 | 94 | NSData *firstData = dataArray[0]; 95 | CGFloat scale = [UIScreen mainScreen].scale; 96 | UIImage *firstCG = [[[UIImage alloc] initWithData:firstData] yy_imageByDecoded]; 97 | self = [self initWithCGImage:firstCG.CGImage scale:scale orientation:UIImageOrientationUp]; 98 | if (!self) return nil; 99 | long frameByte = CGImageGetBytesPerRow(firstCG.CGImage) * CGImageGetHeight(firstCG.CGImage); 100 | _oneFrameBytes = (NSUInteger)frameByte; 101 | _imageDatas = dataArray.copy; 102 | _frameDurations = frameDurations.copy; 103 | _loopCount = loopCount; 104 | 105 | return self; 106 | } 107 | 108 | #pragma mark - YYAnimtedImage 109 | 110 | - (NSUInteger)animatedImageFrameCount { 111 | if (_imagePaths) { 112 | return _imagePaths.count; 113 | } else if (_imageDatas) { 114 | return _imageDatas.count; 115 | } else { 116 | return 1; 117 | } 118 | } 119 | 120 | - (NSUInteger)animatedImageLoopCount { 121 | return _loopCount; 122 | } 123 | 124 | - (NSUInteger)animatedImageBytesPerFrame { 125 | return _oneFrameBytes; 126 | } 127 | 128 | - (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { 129 | if (_imagePaths) { 130 | if (index >= _imagePaths.count) return nil; 131 | NSString *path = _imagePaths[index]; 132 | CGFloat scale = _NSStringPathScale(path); 133 | NSData *data = [NSData dataWithContentsOfFile:path]; 134 | return [[UIImage imageWithData:data scale:scale] yy_imageByDecoded]; 135 | } else if (_imageDatas) { 136 | if (index >= _imageDatas.count) return nil; 137 | NSData *data = _imageDatas[index]; 138 | return [[UIImage imageWithData:data scale:[UIScreen mainScreen].scale] yy_imageByDecoded]; 139 | } else { 140 | return index == 0 ? self : nil; 141 | } 142 | } 143 | 144 | - (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index { 145 | if (index >= _frameDurations.count) return 0; 146 | NSNumber *num = _frameDurations[index]; 147 | return [num doubleValue]; 148 | } 149 | 150 | @end 151 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYImage.h 3 | // YYImage 4 | // 5 | // Created by ibireme on 14/10/20. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYImageVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYImageVersionString[]; 17 | #import 18 | #import 19 | #import 20 | #import 21 | #elif __has_include() 22 | #import 23 | #import 24 | #import 25 | #import 26 | #else 27 | #import "YYFrameImage.h" 28 | #import "YYSpriteSheetImage.h" 29 | #import "YYImageCoder.h" 30 | #import "YYAnimatedImageView.h" 31 | #endif 32 | 33 | NS_ASSUME_NONNULL_BEGIN 34 | 35 | 36 | /** 37 | A YYImage object is a high-level way to display animated image data. 38 | 39 | @discussion It is a fully compatible `UIImage` subclass. It extends the UIImage 40 | to support animated WebP, APNG and GIF format image data decoding. It also 41 | support NSCoding protocol to archive and unarchive multi-frame image data. 42 | 43 | If the image is created from multi-frame image data, and you want to play the 44 | animation, try replace UIImageView with `YYAnimatedImageView`. 45 | 46 | Sample Code: 47 | 48 | // animation@3x.webp 49 | YYImage *image = [YYImage imageNamed:@"animation.webp"]; 50 | YYAnimatedImageView *imageView = [YYAnimatedImageView alloc] initWithImage:image]; 51 | [view addSubView:imageView]; 52 | 53 | */ 54 | @interface YYImage : UIImage 55 | 56 | + (nullable YYImage *)imageNamed:(NSString *)name; // no cache! 57 | + (nullable YYImage *)imageWithContentsOfFile:(NSString *)path; 58 | + (nullable YYImage *)imageWithData:(NSData *)data; 59 | + (nullable YYImage *)imageWithData:(NSData *)data scale:(CGFloat)scale; 60 | 61 | /** 62 | If the image is created from data or file, then the value indicates the data type. 63 | */ 64 | @property (nonatomic, readonly) YYImageType animatedImageType; 65 | 66 | /** 67 | If the image is created from animated image data (multi-frame GIF/APNG/WebP), 68 | this property stores the original image data. 69 | */ 70 | @property (nullable, nonatomic, readonly) NSData *animatedImageData; 71 | 72 | /** 73 | The total memory usage (in bytes) if all frame images was loaded into memory. 74 | The value is 0 if the image is not created from a multi-frame image data. 75 | */ 76 | @property (nonatomic, readonly) NSUInteger animatedImageMemorySize; 77 | 78 | /** 79 | Preload all frame image to memory. 80 | 81 | @discussion Set this property to `YES` will block the calling thread to decode 82 | all animation frame image to memory, set to `NO` will release the preloaded frames. 83 | If the image is shared by lots of image views (such as emoticon), preload all 84 | frames will reduce the CPU cost. 85 | 86 | See `animatedImageMemorySize` for memory cost. 87 | */ 88 | @property (nonatomic) BOOL preloadAllAnimatedImageFrames; 89 | 90 | @end 91 | 92 | NS_ASSUME_NONNULL_END 93 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYSpriteSheetImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYSpriteImage.h 3 | // YYImage 4 | // 5 | // Created by ibireme on 15/4/21. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | #import 16 | #elif __has_include() 17 | #import 18 | #else 19 | #import "YYAnimatedImageView.h" 20 | #endif 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | /** 25 | An image to display sprite sheet animation. 26 | 27 | @discussion It is a fully compatible `UIImage` subclass. 28 | The animation can be played by YYAnimatedImageView. 29 | 30 | Sample Code: 31 | 32 | // 8 * 12 sprites in a single sheet image 33 | UIImage *spriteSheet = [UIImage imageNamed:@"sprite-sheet"]; 34 | NSMutableArray *contentRects = [NSMutableArray new]; 35 | NSMutableArray *durations = [NSMutableArray new]; 36 | for (int j = 0; j < 12; j++) { 37 | for (int i = 0; i < 8; i++) { 38 | CGRect rect; 39 | rect.size = CGSizeMake(img.size.width / 8, img.size.height / 12); 40 | rect.origin.x = img.size.width / 8 * i; 41 | rect.origin.y = img.size.height / 12 * j; 42 | [contentRects addObject:[NSValue valueWithCGRect:rect]]; 43 | [durations addObject:@(1 / 60.0)]; 44 | } 45 | } 46 | YYSpriteSheetImage *sprite; 47 | sprite = [[YYSpriteSheetImage alloc] initWithSpriteSheetImage:img 48 | contentRects:contentRects 49 | frameDurations:durations 50 | loopCount:0]; 51 | YYAnimatedImageView *imgView = [YYAnimatedImageView new]; 52 | imgView.size = CGSizeMake(img.size.width / 8, img.size.height / 12); 53 | imgView.image = sprite; 54 | 55 | 56 | 57 | @discussion It can also be used to display single frame in sprite sheet image. 58 | Sample Code: 59 | 60 | YYSpriteSheetImage *sheet = ...; 61 | UIImageView *imageView = ...; 62 | imageView.image = sheet; 63 | imageView.layer.contentsRect = [sheet contentsRectForCALayerAtIndex:6]; 64 | 65 | */ 66 | @interface YYSpriteSheetImage : UIImage 67 | 68 | /** 69 | Creates and returns an image object. 70 | 71 | @param image The sprite sheet image (contains all frames). 72 | 73 | @param contentRects The sprite sheet image frame rects in the image coordinates. 74 | The rectangle should not outside the image's bounds. The objects in this array 75 | should be created with [NSValue valueWithCGRect:]. 76 | 77 | @param frameDurations The sprite sheet image frame's durations in seconds. 78 | The objects in this array should be NSNumber. 79 | 80 | @param loopCount Animation loop count, 0 means infinite looping. 81 | 82 | @return An image object, or nil if an error occurs. 83 | */ 84 | - (nullable instancetype)initWithSpriteSheetImage:(UIImage *)image 85 | contentRects:(NSArray *)contentRects 86 | frameDurations:(NSArray *)frameDurations 87 | loopCount:(NSUInteger)loopCount; 88 | 89 | @property (nonatomic, readonly) NSArray *contentRects; 90 | @property (nonatomic, readonly) NSArray *frameDurations; 91 | @property (nonatomic, readonly) NSUInteger loopCount; 92 | 93 | /** 94 | Get the contents rect for CALayer. 95 | See "contentsRect" property in CALayer for more information. 96 | 97 | @param index Index of frame. 98 | @return Contents Rect. 99 | */ 100 | - (CGRect)contentsRectForCALayerAtIndex:(NSUInteger)index; 101 | 102 | @end 103 | 104 | NS_ASSUME_NONNULL_END 105 | -------------------------------------------------------------------------------- /Pods/YYImage/YYImage/YYSpriteSheetImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // YYSpriteImage.m 3 | // YYImage 4 | // 5 | // Created by ibireme on 15/4/21. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "YYSpriteSheetImage.h" 13 | 14 | @implementation YYSpriteSheetImage 15 | 16 | - (instancetype)initWithSpriteSheetImage:(UIImage *)image 17 | contentRects:(NSArray *)contentRects 18 | frameDurations:(NSArray *)frameDurations 19 | loopCount:(NSUInteger)loopCount { 20 | if (!image.CGImage) return nil; 21 | if (contentRects.count < 1 || frameDurations.count < 1) return nil; 22 | if (contentRects.count != frameDurations.count) return nil; 23 | 24 | self = [super initWithCGImage:image.CGImage scale:image.scale orientation:image.imageOrientation]; 25 | if (!self) return nil; 26 | 27 | _contentRects = contentRects.copy; 28 | _frameDurations = frameDurations.copy; 29 | _loopCount = loopCount; 30 | return self; 31 | } 32 | 33 | - (CGRect)contentsRectForCALayerAtIndex:(NSUInteger)index { 34 | CGRect layerRect = CGRectMake(0, 0, 1, 1); 35 | if (index >= _contentRects.count) return layerRect; 36 | 37 | CGSize imageSize = self.size; 38 | CGRect rect = [self animatedImageContentsRectAtIndex:index]; 39 | if (imageSize.width > 0.01 && imageSize.height > 0.01) { 40 | layerRect.origin.x = rect.origin.x / imageSize.width; 41 | layerRect.origin.y = rect.origin.y / imageSize.height; 42 | layerRect.size.width = rect.size.width / imageSize.width; 43 | layerRect.size.height = rect.size.height / imageSize.height; 44 | layerRect = CGRectIntersection(layerRect, CGRectMake(0, 0, 1, 1)); 45 | if (CGRectIsNull(layerRect) || CGRectIsEmpty(layerRect)) { 46 | layerRect = CGRectMake(0, 0, 1, 1); 47 | } 48 | } 49 | return layerRect; 50 | } 51 | 52 | #pragma mark @protocol YYAnimatedImage 53 | 54 | - (NSUInteger)animatedImageFrameCount { 55 | return _contentRects.count; 56 | } 57 | 58 | - (NSUInteger)animatedImageLoopCount { 59 | return _loopCount; 60 | } 61 | 62 | - (NSUInteger)animatedImageBytesPerFrame { 63 | return 0; 64 | } 65 | 66 | - (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { 67 | return self; 68 | } 69 | 70 | - (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index { 71 | if (index >= _frameDurations.count) return 0; 72 | return ((NSNumber *)_frameDurations[index]).doubleValue; 73 | } 74 | 75 | - (CGRect)animatedImageContentsRectAtIndex:(NSUInteger)index { 76 | if (index >= _contentRects.count) return CGRectZero; 77 | return ((NSValue *)_contentRects[index]).CGRectValue; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Pods/YYModel/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/YYModel/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYModel.h 3 | // YYModel 4 | // 5 | // Created by ibireme on 15/5/10. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYModelVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[]; 17 | #import 18 | #import 19 | #else 20 | #import "NSObject+YYModel.h" 21 | #import "YYClassInfo.h" 22 | #endif 23 | -------------------------------------------------------------------------------- /Pods/YYWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/Categories/CALayer+YYWebImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+YYWebImage.h 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/2/23. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | #import 14 | 15 | #if __has_include() 16 | #import 17 | #else 18 | #import "YYWebImageManager.h" 19 | #endif 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | /** 24 | Web image methods for CALayer. 25 | It will set image to layer.contents. 26 | */ 27 | @interface CALayer (YYWebImage) 28 | 29 | #pragma mark - image 30 | 31 | /** 32 | Current image URL. 33 | 34 | @discussion Set a new value to this property will cancel the previous request 35 | operation and create a new request operation to fetch image. Set nil to clear 36 | the image and image URL. 37 | */ 38 | @property (nullable, nonatomic, strong) NSURL *yy_imageURL; 39 | 40 | /** 41 | Set the view's `image` with a specified URL. 42 | 43 | @param imageURL The image url (remote or local file path). 44 | @param placeholder The image to be set initially, until the image request finishes. 45 | */ 46 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL placeholder:(nullable UIImage *)placeholder; 47 | 48 | /** 49 | Set the view's `image` with a specified URL. 50 | 51 | @param imageURL The image url (remote or local file path). 52 | @param options The options to use when request the image. 53 | */ 54 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL options:(YYWebImageOptions)options; 55 | 56 | /** 57 | Set the view's `image` with a specified URL. 58 | 59 | @param imageURL The image url (remote or local file path). 60 | @param placeholder The image to be set initially, until the image request finishes. 61 | @param options The options to use when request the image. 62 | @param completion The block invoked (on main thread) when image request completed. 63 | */ 64 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 65 | placeholder:(nullable UIImage *)placeholder 66 | options:(YYWebImageOptions)options 67 | completion:(nullable YYWebImageCompletionBlock)completion; 68 | 69 | /** 70 | Set the view's `image` with a specified URL. 71 | 72 | @param imageURL The image url (remote or local file path). 73 | @param placeholder The image to be set initially, until the image request finishes. 74 | @param options The options to use when request the image. 75 | @param progress The block invoked (on main thread) during image request. 76 | @param transform The block invoked (on background thread) to do additional image process. 77 | @param completion The block invoked (on main thread) when image request completed. 78 | */ 79 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 80 | placeholder:(nullable UIImage *)placeholder 81 | options:(YYWebImageOptions)options 82 | progress:(nullable YYWebImageProgressBlock)progress 83 | transform:(nullable YYWebImageTransformBlock)transform 84 | completion:(nullable YYWebImageCompletionBlock)completion; 85 | 86 | /** 87 | Set the view's `image` with a specified URL. 88 | 89 | @param imageURL The image url (remote or local file path). 90 | @param placeholder he image to be set initially, until the image request finishes. 91 | @param options The options to use when request the image. 92 | @param manager The manager to create image request operation. 93 | @param progress The block invoked (on main thread) during image request. 94 | @param transform The block invoked (on background thread) to do additional image process. 95 | @param completion The block invoked (on main thread) when image request completed. 96 | */ 97 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 98 | placeholder:(nullable UIImage *)placeholder 99 | options:(YYWebImageOptions)options 100 | manager:(nullable YYWebImageManager *)manager 101 | progress:(nullable YYWebImageProgressBlock)progress 102 | transform:(nullable YYWebImageTransformBlock)transform 103 | completion:(nullable YYWebImageCompletionBlock)completion; 104 | 105 | /** 106 | Cancel the current image request. 107 | */ 108 | - (void)yy_cancelCurrentImageRequest; 109 | 110 | @end 111 | 112 | NS_ASSUME_NONNULL_END 113 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/Categories/MKAnnotationView+YYWebImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+YYWebImage.h 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/2/23. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | #import 14 | 15 | #if __has_include() 16 | #import 17 | #else 18 | #import "YYWebImageManager.h" 19 | #endif 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | /** 24 | Web image methods for MKAnnotationView. 25 | */ 26 | @interface MKAnnotationView (YYWebImage) 27 | 28 | /** 29 | Current image URL. 30 | 31 | @discussion Set a new value to this property will cancel the previous request 32 | operation and create a new request operation to fetch image. Set nil to clear 33 | the image and image URL. 34 | */ 35 | @property (nullable, nonatomic, strong) NSURL *yy_imageURL; 36 | 37 | /** 38 | Set the view's `image` with a specified URL. 39 | 40 | @param imageURL The image url (remote or local file path). 41 | @param placeholder The image to be set initially, until the image request finishes. 42 | */ 43 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL placeholder:(nullable UIImage *)placeholder; 44 | 45 | /** 46 | Set the view's `image` with a specified URL. 47 | 48 | @param imageURL The image url (remote or local file path). 49 | @param options The options to use when request the image. 50 | */ 51 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL options:(YYWebImageOptions)options; 52 | 53 | /** 54 | Set the view's `image` with a specified URL. 55 | 56 | @param imageURL The image url (remote or local file path). 57 | @param placeholder The image to be set initially, until the image request finishes. 58 | @param options The options to use when request the image. 59 | @param completion The block invoked (on main thread) when image request completed. 60 | */ 61 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 62 | placeholder:(nullable UIImage *)placeholder 63 | options:(YYWebImageOptions)options 64 | completion:(nullable YYWebImageCompletionBlock)completion; 65 | 66 | /** 67 | Set the view's `image` with a specified URL. 68 | 69 | @param imageURL The image url (remote or local file path). 70 | @param placeholder The image to be set initially, until the image request finishes. 71 | @param options The options to use when request the image. 72 | @param progress The block invoked (on main thread) during image request. 73 | @param transform The block invoked (on background thread) to do additional image process. 74 | @param completion The block invoked (on main thread) when image request completed. 75 | */ 76 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 77 | placeholder:(nullable UIImage *)placeholder 78 | options:(YYWebImageOptions)options 79 | progress:(nullable YYWebImageProgressBlock)progress 80 | transform:(nullable YYWebImageTransformBlock)transform 81 | completion:(nullable YYWebImageCompletionBlock)completion; 82 | 83 | /** 84 | Set the view's `image` with a specified URL. 85 | 86 | @param imageURL The image url (remote or local file path). 87 | @param placeholder he image to be set initially, until the image request finishes. 88 | @param options The options to use when request the image. 89 | @param manager The manager to create image request operation. 90 | @param progress The block invoked (on main thread) during image request. 91 | @param transform The block invoked (on background thread) to do additional image process. 92 | @param completion The block invoked (on main thread) when image request completed. 93 | */ 94 | - (void)yy_setImageWithURL:(nullable NSURL *)imageURL 95 | placeholder:(nullable UIImage *)placeholder 96 | options:(YYWebImageOptions)options 97 | manager:(nullable YYWebImageManager *)manager 98 | progress:(nullable YYWebImageProgressBlock)progress 99 | transform:(nullable YYWebImageTransformBlock)transform 100 | completion:(nullable YYWebImageCompletionBlock)completion; 101 | 102 | /** 103 | Cancel the current image request. 104 | */ 105 | - (void)yy_cancelCurrentImageRequest; 106 | 107 | @end 108 | 109 | NS_ASSUME_NONNULL_END 110 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/Categories/_YYWebImageSetter.h: -------------------------------------------------------------------------------- 1 | // 2 | // _YYWebImageSetter.h 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/7/15. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | #import 12 | #import 13 | 14 | #if __has_include() 15 | #import 16 | #else 17 | #import "YYWebImageManager.h" 18 | #endif 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | /** 23 | Submits a block for execution on a main queue and waits until the block completes. 24 | */ 25 | static inline void _yy_dispatch_sync_on_main_queue(void (^block)()) { 26 | if (pthread_main_np()) { 27 | block(); 28 | } else { 29 | dispatch_sync(dispatch_get_main_queue(), block); 30 | } 31 | } 32 | 33 | extern NSString *const _YYWebImageFadeAnimationKey; 34 | extern const NSTimeInterval _YYWebImageFadeTime; 35 | extern const NSTimeInterval _YYWebImageProgressiveFadeTime; 36 | 37 | /** 38 | Private class used by web image categories. 39 | Typically, you should not use this class directly. 40 | */ 41 | @interface _YYWebImageSetter : NSObject 42 | /// Current image url. 43 | @property (nullable, nonatomic, readonly) NSURL *imageURL; 44 | /// Current sentinel. 45 | @property (nonatomic, readonly) int32_t sentinel; 46 | 47 | /// Create new operation for web image and return a sentinel value. 48 | - (int32_t)setOperationWithSentinel:(int32_t)sentinel 49 | url:(nullable NSURL *)imageURL 50 | options:(YYWebImageOptions)options 51 | manager:(YYWebImageManager *)manager 52 | progress:(nullable YYWebImageProgressBlock)progress 53 | transform:(nullable YYWebImageTransformBlock)transform 54 | completion:(nullable YYWebImageCompletionBlock)completion; 55 | 56 | /// Cancel and return a sentinel value. The imageURL will be set to nil. 57 | - (int32_t)cancel; 58 | 59 | /// Cancel and return a sentinel value. The imageURL will be set to new value. 60 | - (int32_t)cancelWithNewURL:(nullable NSURL *)imageURL; 61 | 62 | /// A queue to set operation. 63 | + (dispatch_queue_t)setterQueue; 64 | 65 | @end 66 | 67 | NS_ASSUME_NONNULL_END 68 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/Categories/_YYWebImageSetter.m: -------------------------------------------------------------------------------- 1 | // 2 | // _YYWebImageSetter.m 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/7/15. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import "_YYWebImageSetter.h" 13 | #import "YYWebImageOperation.h" 14 | #import 15 | 16 | NSString *const _YYWebImageFadeAnimationKey = @"YYWebImageFade"; 17 | const NSTimeInterval _YYWebImageFadeTime = 0.2; 18 | const NSTimeInterval _YYWebImageProgressiveFadeTime = 0.4; 19 | 20 | 21 | @implementation _YYWebImageSetter { 22 | dispatch_semaphore_t _lock; 23 | NSURL *_imageURL; 24 | NSOperation *_operation; 25 | int32_t _sentinel; 26 | } 27 | 28 | - (instancetype)init { 29 | self = [super init]; 30 | _lock = dispatch_semaphore_create(1); 31 | return self; 32 | } 33 | 34 | - (NSURL *)imageURL { 35 | dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); 36 | NSURL *imageURL = _imageURL; 37 | dispatch_semaphore_signal(_lock); 38 | return imageURL; 39 | } 40 | 41 | - (void)dealloc { 42 | OSAtomicIncrement32(&_sentinel); 43 | [_operation cancel]; 44 | } 45 | 46 | - (int32_t)setOperationWithSentinel:(int32_t)sentinel 47 | url:(NSURL *)imageURL 48 | options:(YYWebImageOptions)options 49 | manager:(YYWebImageManager *)manager 50 | progress:(YYWebImageProgressBlock)progress 51 | transform:(YYWebImageTransformBlock)transform 52 | completion:(YYWebImageCompletionBlock)completion { 53 | if (sentinel != _sentinel) { 54 | if (completion) completion(nil, imageURL, YYWebImageFromNone, YYWebImageStageCancelled, nil); 55 | return _sentinel; 56 | } 57 | 58 | NSOperation *operation = [manager requestImageWithURL:imageURL options:options progress:progress transform:transform completion:completion]; 59 | if (!operation && completion) { 60 | NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : @"YYWebImageOperation create failed." }; 61 | completion(nil, imageURL, YYWebImageFromNone, YYWebImageStageFinished, [NSError errorWithDomain:@"com.ibireme.webimage" code:-1 userInfo:userInfo]); 62 | } 63 | 64 | dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); 65 | if (sentinel == _sentinel) { 66 | if (_operation) [_operation cancel]; 67 | _operation = operation; 68 | sentinel = OSAtomicIncrement32(&_sentinel); 69 | } else { 70 | [operation cancel]; 71 | } 72 | dispatch_semaphore_signal(_lock); 73 | return sentinel; 74 | } 75 | 76 | - (int32_t)cancel { 77 | return [self cancelWithNewURL:nil]; 78 | } 79 | 80 | - (int32_t)cancelWithNewURL:(NSURL *)imageURL { 81 | int32_t sentinel; 82 | dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); 83 | if (_operation) { 84 | [_operation cancel]; 85 | _operation = nil; 86 | } 87 | _imageURL = imageURL; 88 | sentinel = OSAtomicIncrement32(&_sentinel); 89 | dispatch_semaphore_signal(_lock); 90 | return sentinel; 91 | } 92 | 93 | + (dispatch_queue_t)setterQueue { 94 | static dispatch_queue_t queue; 95 | static dispatch_once_t onceToken; 96 | dispatch_once(&onceToken, ^{ 97 | queue = dispatch_queue_create("com.ibireme.webimage.setter", DISPATCH_QUEUE_SERIAL); 98 | dispatch_set_target_queue(queue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); 99 | }); 100 | return queue; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/YYWebImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYWebImage.h 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/2/23. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYWebImageVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYWebImageVersionString[]; 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #else 26 | #import "YYImageCache.h" 27 | #import "YYWebImageOperation.h" 28 | #import "YYWebImageManager.h" 29 | #import "UIImage+YYWebImage.h" 30 | #import "UIImageView+YYWebImage.h" 31 | #import "UIButton+YYWebImage.h" 32 | #import "CALayer+YYWebImage.h" 33 | #import "MKAnnotationView+YYWebImage.h" 34 | #endif 35 | 36 | #if __has_include() 37 | #import 38 | #elif __has_include() 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #else 45 | #import "YYImage.h" 46 | #import "YYFrameImage.h" 47 | #import "YYSpriteSheetImage.h" 48 | #import "YYImageCoder.h" 49 | #import "YYAnimatedImageView.h" 50 | #endif 51 | 52 | #if __has_include() 53 | #import 54 | #elif __has_include() 55 | #import 56 | #import 57 | #import 58 | #import 59 | #else 60 | #import "YYCache.h" 61 | #import "YYMemoryCache.h" 62 | #import "YYDiskCache.h" 63 | #import "YYKVStorage.h" 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /Pods/YYWebImage/YYWebImage/YYWebImageOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYWebImageOperation.h 3 | // YYWebImage 4 | // 5 | // Created by ibireme on 15/2/15. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | #import 16 | #import 17 | #else 18 | #import "YYImageCache.h" 19 | #import "YYWebImageManager.h" 20 | #endif 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | /** 25 | The YYWebImageOperation class is an NSOperation subclass used to fetch image 26 | from URL request. 27 | 28 | @discussion It's an asynchronous operation. You typically execute it by adding 29 | it to an operation queue, or calls 'start' to execute it manually. When the 30 | operation is started, it will: 31 | 32 | 1. Get the image from the cache, if exist, return it with `completion` block. 33 | 2. Start an URL connection to fetch image from the request, invoke the `progress` 34 | to notify request progress (and invoke `completion` block to return the 35 | progressive image if enabled by progressive option). 36 | 3. Process the image by invoke the `transform` block. 37 | 4. Put the image to cache and return it with `completion` block. 38 | 39 | */ 40 | @interface YYWebImageOperation : NSOperation 41 | 42 | @property (nonatomic, strong, readonly) NSURLRequest *request; ///< The image URL request. 43 | @property (nullable, nonatomic, strong, readonly) NSURLResponse *response; ///< The response for request. 44 | @property (nullable, nonatomic, strong, readonly) YYImageCache *cache; ///< The image cache. 45 | @property (nonatomic, strong, readonly) NSString *cacheKey; ///< The image cache key. 46 | @property (nonatomic, readonly) YYWebImageOptions options; ///< The operation's option. 47 | 48 | /** 49 | Whether the URL connection should consult the credential storage for authenticating 50 | the connection. Default is YES. 51 | 52 | @discussion This is the value that is returned in the `NSURLConnectionDelegate` 53 | method `-connectionShouldUseCredentialStorage:`. 54 | */ 55 | @property (nonatomic) BOOL shouldUseCredentialStorage; 56 | 57 | /** 58 | The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 59 | 60 | @discussion This will be overridden by any shared credentials that exist for the 61 | username or password of the request URL, if present. 62 | */ 63 | @property (nullable, nonatomic, strong) NSURLCredential *credential; 64 | 65 | /** 66 | Creates and returns a new operation. 67 | 68 | You should call `start` to execute this operation, or you can add the operation 69 | to an operation queue. 70 | 71 | @param request The Image request. This value should not be nil. 72 | @param options A mask to specify options to use for this operation. 73 | @param cache An image cache. Pass nil to avoid image cache. 74 | @param cacheKey An image cache key. Pass nil to avoid image cache. 75 | @param progress A block invoked in image fetch progress. 76 | The block will be invoked in background thread. Pass nil to avoid it. 77 | @param transform A block invoked before image fetch finished to do additional image process. 78 | The block will be invoked in background thread. Pass nil to avoid it. 79 | @param completion A block invoked when image fetch finished or cancelled. 80 | The block will be invoked in background thread. Pass nil to avoid it. 81 | 82 | @return The image request opeartion, or nil if an error occurs. 83 | */ 84 | - (instancetype)initWithRequest:(NSURLRequest *)request 85 | options:(YYWebImageOptions)options 86 | cache:(nullable YYImageCache *)cache 87 | cacheKey:(nullable NSString *)cacheKey 88 | progress:(nullable YYWebImageProgressBlock)progress 89 | transform:(nullable YYWebImageTransformBlock)transform 90 | completion:(nullable YYWebImageCompletionBlock)completion NS_DESIGNATED_INITIALIZER; 91 | 92 | - (instancetype)init UNAVAILABLE_ATTRIBUTE; 93 | + (instancetype)new UNAVAILABLE_ATTRIBUTE; 94 | 95 | @end 96 | 97 | NS_ASSUME_NONNULL_END 98 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## TableViewCell性能优化之 - 懒加载机制 2 | 3 | #### ScrollView滚动时-代理方法执行流程 4 | 5 | ![ScrollView滚动时-代理方法执行流程](https://github.com/miniLV/github_images_miniLV/blob/master/2018Year/TableViewCellOptimization/%E6%B5%81%E7%A8%8B%E5%9B%BE.png) 6 | 7 | 以最常见的cell加载webImage为例: 8 | 9 | #### 直接加载全部的图片 10 | ``` 11 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 12 | 13 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 14 | if (!cell) { 15 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 16 | } 17 | 18 | DemoModel *model = self.datas[indexPath.row]; 19 | cell.textLabel.text = model.text; 20 | 21 | [cell.imageView setYy_imageURL:[NSURL URLWithString:model.user.avatar_large]]; 22 | 23 | return cell; 24 | } 25 | ``` 26 | 27 | #### 滚动过程中不加载 28 | 29 | ``` 30 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 31 | 32 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 33 | if (!cell) { 34 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 35 | } 36 | 37 | DemoModel *model = self.datas[indexPath.row]; 38 | cell.textLabel.text = model.text; 39 | 40 | //判断该图片是否已下载 41 | if (model.iconImage) { 42 | cell.imageView.image = model.iconImage; 43 | }else{ 44 | cell.imageView.image = [UIImage imageNamed:@"placeholder"]; 45 | 46 | //拖动的时候不显示 47 | if (!tableView.dragging && !tableView.decelerating) { 48 | 49 | //下载图片数据 - 并缓存 50 | [self p_loadImgeWithIndexPath:indexPath]; 51 | } 52 | } 53 | return cell; 54 | } 55 | ``` 56 | 57 | #### 滚动结束后加载cell图片 58 | ``` 59 | //手一直在拖拽控件 60 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 61 | 62 | NSLog(@"scrollView - DidEndDecelerating"); 63 | [self p_loadImage]; 64 | } 65 | 66 | //手放开了-使用惯性-产生的动画效果 67 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 68 | 69 | if(!decelerate){ 70 | NSLog(@"scrollView - EndDragging - 无decelerate"); 71 | //直接停止-无动画 72 | [self p_loadImage]; 73 | } 74 | } 75 | ``` 76 | 77 | #### 获取滚动结束后,界面内的所有cell 78 | ``` 79 | - (void)p_loadImage{ 80 | 81 | //拿到界面内-所有的cell的indexpath 82 | NSArray *visableCellIndexPaths = self.tableView.indexPathsForVisibleRows; 83 | 84 | for (NSIndexPath *indexPath in visableCellIndexPaths) { 85 | 86 | DemoModel *model = self.datas[indexPath.row]; 87 | 88 | if (model.iconImage) { 89 | continue; 90 | } 91 | 92 | [self p_loadImgeWithIndexPath:indexPath]; 93 | } 94 | } 95 | ``` 96 | 97 |
98 | 99 | #### 最终实现的懒加载效果 100 | 101 | ![懒加载效果](https://github.com/miniLV/github_images_miniLV/blob/master/2018Year/TableViewCellOptimization/demo.gif) 102 | 103 | [详情介绍](https://juejin.im/post/5c15f6cde51d4571a15779a9) 104 | -------------------------------------------------------------------------------- /TableViewCellOptimization.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TableViewCellOptimization.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TableViewCellOptimization/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. 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 | -------------------------------------------------------------------------------- /TableViewCellOptimization/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /TableViewCellOptimization/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TableViewCellOptimization/Assets.xcassets/placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "placeholder.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /TableViewCellOptimization/Assets.xcassets/placeholder.imageset/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniLV/TableViewCellOptimization/e8d5607f10d647938493526f05c3a1bab4dc358a/TableViewCellOptimization/Assets.xcassets/placeholder.imageset/placeholder.png -------------------------------------------------------------------------------- /TableViewCellOptimization/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 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Controller/NextViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NextViewController.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/15. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NextViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Controller/NextViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NextViewController.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/15. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "NextViewController.h" 10 | 11 | @interface NextViewController () 12 | 13 | @end 14 | 15 | @implementation NextViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.title = @"nextVC"; 21 | self.view.backgroundColor = [UIColor orangeColor]; 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | /* 30 | #pragma mark - Navigation 31 | 32 | // In a storyboard-based application, you will often want to do a little preparation before navigation 33 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 34 | // Get the new view controller using [segue destinationViewController]. 35 | // Pass the selected object to the new view controller. 36 | } 37 | */ 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Controller/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Controller/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DemoService.h" 11 | #import "ImageDownload.h" 12 | #import "DemoModel.h" 13 | #import 14 | #import 15 | #import "NextViewController.h" 16 | 17 | @interface ViewController () 18 | 19 | @property (nonatomic, copy)NSArray *datas; 20 | 21 | @property (nonatomic, strong)UITableView *tableView; 22 | 23 | @property (nonatomic, strong)NSMutableDictionary *imageLoadDic; 24 | 25 | @end 26 | 27 | @implementation ViewController 28 | 29 | #define ScreenH [[UIScreen mainScreen] bounds].size.height 30 | #define ScreenW [[UIScreen mainScreen] bounds].size.width 31 | 32 | - (NSMutableDictionary *)imageLoadDic{ 33 | if (!_imageLoadDic) { 34 | _imageLoadDic = @{}.mutableCopy; 35 | } 36 | return _imageLoadDic; 37 | } 38 | 39 | #pragma mark - life cycle 40 | - (void)viewDidLoad { 41 | [super viewDidLoad]; 42 | 43 | self.datas = @[]; 44 | 45 | [self baseSetting]; 46 | 47 | [self setupUI]; 48 | 49 | [self loadDatas]; 50 | } 51 | 52 | - (void)viewWillDisappear:(BOOL)animated{ 53 | [super viewWillDisappear:animated]; 54 | 55 | NSArray *loadImageManagers = [self.imageLoadDic allValues]; 56 | //当前图片下载操作全部取消 57 | [loadImageManagers makeObjectsPerformSelector:@selector(cancelLoadImage)]; 58 | } 59 | 60 | - (void)baseSetting{ 61 | 62 | self.title = @"DemoTitle"; 63 | } 64 | 65 | #pragma mark - setupUI 66 | - (void)setupUI{ 67 | 68 | CGFloat topMargin = 64; 69 | 70 | UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, topMargin, ScreenW, ScreenH - topMargin)]; 71 | 72 | tableView.backgroundColor = [UIColor whiteColor]; 73 | tableView.delegate = self; 74 | tableView.dataSource = self; 75 | tableView.estimatedRowHeight = 0; 76 | tableView.estimatedSectionFooterHeight = 0; 77 | tableView.estimatedSectionHeaderHeight = 0; 78 | [self.view addSubview:tableView]; 79 | 80 | self.tableView = tableView; 81 | } 82 | 83 | #pragma mark - loadDatas 84 | - (void)loadDatas{ 85 | 86 | [DemoService fetchDataSuccess:^(NSArray *array) { 87 | 88 | self.datas = array; 89 | [self.tableView reloadData]; 90 | }]; 91 | } 92 | 93 | #pragma mark - 94 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 95 | 96 | return self.datas.count; 97 | } 98 | 99 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 100 | 101 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 102 | if (!cell) { 103 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 104 | } 105 | 106 | DemoModel *model = self.datas[indexPath.row]; 107 | cell.textLabel.text = model.text; 108 | 109 | 110 | if (model.iconImage) { 111 | cell.imageView.image = model.iconImage; 112 | }else{ 113 | cell.imageView.image = [UIImage imageNamed:@"placeholder"]; 114 | 115 | /** 116 | runloop - 滚动时候 - trackingMode, 117 | - 默认情况 - defaultRunLoopMode 118 | ==> 滚动的时候,进入`trackingMode`,defaultMode下的任务会暂停 119 | 停止滚动的时候 - 进入`defaultMode` - 继续执行`trackingMode`下的任务 - 例如这里的loadImage 120 | */ 121 | // [self performSelector:@selector(p_loadImgeWithIndexPath:) 122 | // withObject:indexPath afterDelay:0.0 123 | // inModes:@[NSDefaultRunLoopMode]]; 124 | 125 | //拖动的时候不显示 126 | if (!tableView.dragging && !tableView.decelerating) { 127 | //下载图片数据 - 并缓存 128 | 129 | [self p_loadImgeWithIndexPath:indexPath]; 130 | } 131 | } 132 | return cell; 133 | } 134 | 135 | 136 | - (void)p_loadImgeWithIndexPath:(NSIndexPath *)indexPath{ 137 | 138 | DemoModel *model = self.datas[indexPath.row]; 139 | 140 | 141 | //保存当前正在下载的操作 142 | ImageDownload *manager = self.imageLoadDic[indexPath]; 143 | if (!manager) { 144 | 145 | manager = [ImageDownload new]; 146 | //开始加载-保存到当前下载操作字典中 147 | [self.imageLoadDic setObject:manager forKey:indexPath]; 148 | } 149 | 150 | [manager loadImageWithModel:model success:^{ 151 | //主线程刷新UI 152 | dispatch_async(dispatch_get_main_queue(), ^{ 153 | UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; 154 | cell.imageView.image = model.iconImage; 155 | }); 156 | 157 | //加载成功-从保存的当前下载操作字典中移除 158 | [self.imageLoadDic removeObjectForKey:indexPath]; 159 | }]; 160 | } 161 | 162 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 163 | 164 | [self.navigationController pushViewController:[NextViewController new] animated:YES]; 165 | } 166 | 167 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 168 | return 100; 169 | } 170 | 171 | #pragma mark - 172 | 173 | - (void)p_loadImage{ 174 | 175 | //拿到界面内-所有的cell的indexpath 176 | NSArray *visableCellIndexPaths = self.tableView.indexPathsForVisibleRows; 177 | 178 | for (NSIndexPath *indexPath in visableCellIndexPaths) { 179 | 180 | DemoModel *model = self.datas[indexPath.row]; 181 | 182 | if (model.iconImage) { 183 | continue; 184 | } 185 | 186 | [self p_loadImgeWithIndexPath:indexPath]; 187 | } 188 | } 189 | 190 | //手放开了 - 停止拖动 191 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 192 | 193 | if(!decelerate){ 194 | //直接停止-无动画 195 | [self p_loadImage]; 196 | }else{ 197 | //有动画效果的(惯性) - 会走`scrollViewDidEndDecelerating`方法,这里不用设置 198 | } 199 | } 200 | 201 | //是否有动画效果 202 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 203 | 204 | [self p_loadImage]; 205 | } 206 | 207 | @end 208 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Model/DemoModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoModel.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class User; 13 | @interface DemoModel : NSObject 14 | 15 | @property (nonatomic, strong)UIImage *iconImage; 16 | 17 | @property (nonatomic, copy) NSString *text; 18 | 19 | @property (nonatomic, strong) User *user; 20 | 21 | 22 | @end 23 | 24 | 25 | @interface User : NSObject 26 | 27 | @property (nonatomic, copy) NSString *avatar_large; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Model/DemoModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoModel.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "DemoModel.h" 10 | 11 | @implementation DemoModel 12 | 13 | @end 14 | 15 | @implementation User 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Service/DemoService.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoService.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^successBlock)(NSArray *array); 12 | 13 | @interface DemoService : NSObject 14 | 15 | + (void)fetchDataSuccess:(successBlock)completion; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Service/DemoService.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoService.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "DemoService.h" 10 | #import 11 | #import "DemoModel.h" 12 | #import 13 | @implementation DemoService 14 | 15 | + (void)fetchDataSuccess:(successBlock)completion{ 16 | 17 | //新浪微博API 18 | NSString *urlStr = @"https://api.weibo.com/2/statuses/public_timeline.json?access_token=2.00xo2AIClMprWC3c9e06af90JEgXHE"; 19 | 20 | [[AFHTTPSessionManager manager] GET:urlStr parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { 21 | 22 | NSArray *tempDatas = responseObject[@"statuses"]; 23 | NSMutableArray *json = @[].mutableCopy; 24 | [json addObjectsFromArray:tempDatas]; 25 | [json addObjectsFromArray:tempDatas]; 26 | [json addObjectsFromArray:tempDatas]; 27 | [json addObjectsFromArray:tempDatas]; 28 | [json addObjectsFromArray:tempDatas]; 29 | 30 | NSArray *datas = [NSArray yy_modelArrayWithClass:[DemoModel class] json:json]; 31 | completion(datas); 32 | 33 | } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 34 | NSLog(@"error"); 35 | }]; 36 | 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Service/ImageDownload.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageDownload.h 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DemoModel; 12 | 13 | @interface ImageDownload : NSObject 14 | 15 | typedef void(^loadImageSuccess)(void); 16 | 17 | //开始加载图片,下载完成回调 18 | - (void)loadImageWithModel:(DemoModel *)model success:(loadImageSuccess)completion; 19 | 20 | //取消当前的图片下载操作 21 | - (void)cancelLoadImage; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Demo/Service/ImageDownload.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageDownload.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. All rights reserved. 7 | // 8 | 9 | #import "ImageDownload.h" 10 | #import "DemoModel.h" 11 | @implementation ImageDownload{ 12 | NSURLSessionTask *_task; 13 | } 14 | 15 | - (void)loadImageWithModel:(DemoModel *)model success:(loadImageSuccess)completion{ 16 | 17 | NSURLSession *session = [NSURLSession sharedSession]; 18 | _task = [session dataTaskWithURL:[NSURL URLWithString:model.user.avatar_large] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 19 | 20 | if (!error) { 21 | UIImage *image = [UIImage imageWithData:data]; 22 | model.iconImage = image; 23 | completion(); 24 | } 25 | 26 | }]; 27 | 28 | [_task resume]; 29 | } 30 | 31 | - (void)cancelLoadImage{ 32 | [_task cancel]; 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /TableViewCellOptimization/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NSAppTransportSecurity 7 | 8 | NSAllowsArbitraryLoads 9 | 10 | 11 | CFBundleDevelopmentRegion 12 | $(DEVELOPMENT_LANGUAGE) 13 | CFBundleExecutable 14 | $(EXECUTABLE_NAME) 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | $(PRODUCT_NAME) 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleVersion 26 | 1 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /TableViewCellOptimization/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TableViewCellOptimization 4 | // 5 | // Created by 梁宇航 on 2018/12/14. 6 | // Copyright © 2018年 梁宇航. 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 | --------------------------------------------------------------------------------