├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── 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 │ │ │ ├── AFHTTPRequestOperation.h │ │ │ ├── AFHTTPRequestOperationManager.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLConnectionOperation.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIAlertView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ └── SDWebImage │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── SDImageCache.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+WebCache.h │ │ │ └── UIView+WebCacheOperation.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ └── SDWebImage │ │ ├── NSData+ImageContentType.h │ │ ├── SDImageCache.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ └── UIView+WebCacheOperation.h ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── xukun.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-AFNetworking.xcscheme │ │ ├── Pods-SDWebImage.xcscheme │ │ ├── Pods.xcscheme │ │ └── xcschememanagement.plist ├── SDWebImage │ ├── LICENSE │ ├── README.md │ └── SDWebImage │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDecoder.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m └── Target Support Files │ ├── Pods-AFNetworking │ ├── Pods-AFNetworking-Private.xcconfig │ ├── Pods-AFNetworking-dummy.m │ ├── Pods-AFNetworking-prefix.pch │ └── Pods-AFNetworking.xcconfig │ ├── Pods-SDWebImage │ ├── Pods-SDWebImage-Private.xcconfig │ ├── Pods-SDWebImage-dummy.m │ ├── Pods-SDWebImage-prefix.pch │ └── Pods-SDWebImage.xcconfig │ └── Pods │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-environment.h │ ├── Pods-resources.sh │ ├── Pods.debug.xcconfig │ └── Pods.release.xcconfig ├── README.md ├── webViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── xukun.xcuserdatad │ └── xcschemes │ ├── webViewDemo.xcscheme │ └── xcschememanagement.plist ├── webViewDemo.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── xukun.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── webViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── MyWebViewController.h ├── MyWebViewController.m ├── ViewController.h ├── ViewController.m ├── WebViewJavascriptBridge.h ├── WebViewJavascriptBridge.js.txt ├── WebViewJavascriptBridge.m ├── imageInfo.h ├── imageInfo.m ├── main.m ├── videoInfo.h ├── videoInfo.m └── webViewHtml.html └── webViewDemoTests ├── Info.plist └── webViewDemoTests.m /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '6.1' 2 | pod 'SDWebImage', '~>3.7' 3 | 4 | platform :ios, '7.0' 5 | pod "AFNetworking", "~> 2.0" 6 | 7 | 8 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.5.4): 3 | - AFNetworking/NSURLConnection (= 2.5.4) 4 | - AFNetworking/NSURLSession (= 2.5.4) 5 | - AFNetworking/Reachability (= 2.5.4) 6 | - AFNetworking/Security (= 2.5.4) 7 | - AFNetworking/Serialization (= 2.5.4) 8 | - AFNetworking/UIKit (= 2.5.4) 9 | - AFNetworking/NSURLConnection (2.5.4): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.5.4): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.5.4) 18 | - AFNetworking/Security (2.5.4) 19 | - AFNetworking/Serialization (2.5.4) 20 | - AFNetworking/UIKit (2.5.4): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - SDWebImage (3.7.2): 24 | - SDWebImage/Core (= 3.7.2) 25 | - SDWebImage/Core (3.7.2) 26 | 27 | DEPENDENCIES: 28 | - AFNetworking (~> 2.0) 29 | - SDWebImage (~> 3.7) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e 33 | SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29 34 | 35 | COCOAPODS: 0.37.2 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 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 "AFURLConnectionOperation.h" 24 | 25 | /** 26 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 27 | */ 28 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 29 | 30 | ///------------------------------------------------ 31 | /// @name Getting HTTP URL Connection Information 32 | ///------------------------------------------------ 33 | 34 | /** 35 | The last HTTP response received by the operation's connection. 36 | */ 37 | @property (readonly, nonatomic, strong) NSHTTPURLResponse *response; 38 | 39 | /** 40 | Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 41 | 42 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 43 | */ 44 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 45 | 46 | /** 47 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 48 | */ 49 | @property (readonly, nonatomic, strong) id responseObject; 50 | 51 | ///----------------------------------------------------------- 52 | /// @name Setting Completion Block Success / Failure Callbacks 53 | ///----------------------------------------------------------- 54 | 55 | /** 56 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 57 | 58 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 59 | 60 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 61 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 62 | */ 63 | - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success 64 | failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /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 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #import "AFNetworkReachabilityManager.h" 33 | 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | 38 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 39 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) ) 40 | #import "AFURLSessionManager.h" 41 | #import "AFHTTPSessionManager.h" 42 | #endif 43 | 44 | #endif /* _AFNETWORKING_ */ 45 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2015 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 | @interface AFSecurityPolicy : NSObject 37 | 38 | /** 39 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 40 | */ 41 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 42 | 43 | /** 44 | Whether to evaluate an entire SSL certificate chain, or just the leaf certificate. Defaults to `YES`. 45 | */ 46 | @property (nonatomic, assign) BOOL validatesCertificateChain; 47 | 48 | /** 49 | The certificates used to evaluate server trust according to the SSL pinning mode. By default, this property is set to any (`.cer`) certificates included in the app bundle. 50 | */ 51 | @property (nonatomic, strong) NSArray *pinnedCertificates; 52 | 53 | /** 54 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 55 | */ 56 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 57 | 58 | /** 59 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 60 | */ 61 | @property (nonatomic, assign) BOOL validatesDomainName; 62 | 63 | ///----------------------------------------- 64 | /// @name Getting Specific Security Policies 65 | ///----------------------------------------- 66 | 67 | /** 68 | 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. 69 | 70 | @return The default security policy. 71 | */ 72 | + (instancetype)defaultPolicy; 73 | 74 | ///--------------------- 75 | /// @name Initialization 76 | ///--------------------- 77 | 78 | /** 79 | Creates and returns a security policy with the specified pinning mode. 80 | 81 | @param pinningMode The SSL pinning mode. 82 | 83 | @return A new security policy. 84 | */ 85 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 86 | 87 | ///------------------------------ 88 | /// @name Evaluating Server Trust 89 | ///------------------------------ 90 | 91 | /** 92 | Whether or not the specified server trust should be accepted, based on the security policy. 93 | 94 | This method should be used when responding to an authentication challenge from a server. 95 | 96 | @param serverTrust The X.509 certificate trust of the server. 97 | 98 | @return Whether or not to trust the server. 99 | 100 | @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`. 101 | */ 102 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE; 103 | 104 | /** 105 | Whether or not the specified server trust should be accepted, based on the security policy. 106 | 107 | This method should be used when responding to an authentication challenge from a server. 108 | 109 | @param serverTrust The X.509 certificate trust of the server. 110 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 111 | 112 | @return Whether or not to trust the server. 113 | */ 114 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 115 | forDomain:(NSString *)domain; 116 | 117 | @end 118 | 119 | ///---------------- 120 | /// @name Constants 121 | ///---------------- 122 | 123 | /** 124 | ## SSL Pinning Modes 125 | 126 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 127 | 128 | enum { 129 | AFSSLPinningModeNone, 130 | AFSSLPinningModePublicKey, 131 | AFSSLPinningModeCertificate, 132 | } 133 | 134 | `AFSSLPinningModeNone` 135 | Do not used pinned certificates to validate servers. 136 | 137 | `AFSSLPinningModePublicKey` 138 | Validate host certificates against public keys of pinned certificates. 139 | 140 | `AFSSLPinningModeCertificate` 141 | Validate host certificates against pinned certificates. 142 | */ 143 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 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/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | /** 31 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation 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. 32 | 33 | 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: 34 | 35 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 36 | 37 | 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. 38 | 39 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 40 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 41 | */ 42 | @interface AFNetworkActivityIndicatorManager : NSObject 43 | 44 | /** 45 | A Boolean value indicating whether the manager is enabled. 46 | 47 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 48 | */ 49 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 50 | 51 | /** 52 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 53 | */ 54 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 55 | 56 | /** 57 | Returns the shared network activity indicator manager object for the system. 58 | 59 | @return The systemwide network activity indicator manager. 60 | */ 61 | + (instancetype)sharedManager; 62 | 63 | /** 64 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 65 | */ 66 | - (void)incrementActivityCount; 67 | 68 | /** 69 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 70 | */ 71 | - (void)decrementActivityCount; 72 | 73 | @end 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.m 2 | // Copyright (c) 2011–2015 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 "AFNetworkActivityIndicatorManager.h" 23 | 24 | #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) 25 | 26 | #import "AFHTTPRequestOperation.h" 27 | 28 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 29 | #import "AFURLSessionManager.h" 30 | #endif 31 | 32 | static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17; 33 | 34 | static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { 35 | if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) { 36 | return [(AFURLConnectionOperation *)[notification object] request]; 37 | } 38 | 39 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 40 | if ([[notification object] respondsToSelector:@selector(originalRequest)]) { 41 | return [(NSURLSessionTask *)[notification object] originalRequest]; 42 | } 43 | #endif 44 | 45 | return nil; 46 | } 47 | 48 | @interface AFNetworkActivityIndicatorManager () 49 | @property (readwrite, nonatomic, assign) NSInteger activityCount; 50 | @property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer; 51 | @property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 52 | 53 | - (void)updateNetworkActivityIndicatorVisibility; 54 | - (void)updateNetworkActivityIndicatorVisibilityDelayed; 55 | @end 56 | 57 | @implementation AFNetworkActivityIndicatorManager 58 | @dynamic networkActivityIndicatorVisible; 59 | 60 | + (instancetype)sharedManager { 61 | static AFNetworkActivityIndicatorManager *_sharedManager = nil; 62 | static dispatch_once_t oncePredicate; 63 | dispatch_once(&oncePredicate, ^{ 64 | _sharedManager = [[self alloc] init]; 65 | }); 66 | 67 | return _sharedManager; 68 | } 69 | 70 | + (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { 71 | return [NSSet setWithObject:@"activityCount"]; 72 | } 73 | 74 | - (id)init { 75 | self = [super init]; 76 | if (!self) { 77 | return nil; 78 | } 79 | 80 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil]; 81 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil]; 82 | 83 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 84 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; 85 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; 86 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; 87 | #endif 88 | 89 | return self; 90 | } 91 | 92 | - (void)dealloc { 93 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 94 | 95 | [_activityIndicatorVisibilityTimer invalidate]; 96 | } 97 | 98 | - (void)updateNetworkActivityIndicatorVisibilityDelayed { 99 | if (self.enabled) { 100 | // Delay hiding of activity indicator for a short interval, to avoid flickering 101 | if (![self isNetworkActivityIndicatorVisible]) { 102 | [self.activityIndicatorVisibilityTimer invalidate]; 103 | self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO]; 104 | [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes]; 105 | } else { 106 | [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]]; 107 | } 108 | } 109 | } 110 | 111 | - (BOOL)isNetworkActivityIndicatorVisible { 112 | return self.activityCount > 0; 113 | } 114 | 115 | - (void)updateNetworkActivityIndicatorVisibility { 116 | #if !defined(AF_APP_EXTENSIONS) 117 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]]; 118 | #endif 119 | } 120 | 121 | - (void)setActivityCount:(NSInteger)activityCount { 122 | @synchronized(self) { 123 | _activityCount = activityCount; 124 | } 125 | 126 | dispatch_async(dispatch_get_main_queue(), ^{ 127 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 128 | }); 129 | } 130 | 131 | - (void)incrementActivityCount { 132 | [self willChangeValueForKey:@"activityCount"]; 133 | @synchronized(self) { 134 | _activityCount++; 135 | } 136 | [self didChangeValueForKey:@"activityCount"]; 137 | 138 | dispatch_async(dispatch_get_main_queue(), ^{ 139 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 140 | }); 141 | } 142 | 143 | - (void)decrementActivityCount { 144 | [self willChangeValueForKey:@"activityCount"]; 145 | @synchronized(self) { 146 | #pragma clang diagnostic push 147 | #pragma clang diagnostic ignored "-Wgnu" 148 | _activityCount = MAX(_activityCount - 1, 0); 149 | #pragma clang diagnostic pop 150 | } 151 | [self didChangeValueForKey:@"activityCount"]; 152 | 153 | dispatch_async(dispatch_get_main_queue(), ^{ 154 | [self updateNetworkActivityIndicatorVisibilityDelayed]; 155 | }); 156 | } 157 | 158 | - (void)networkRequestDidStart:(NSNotification *)notification { 159 | if ([AFNetworkRequestFromNotification(notification) URL]) { 160 | [self incrementActivityCount]; 161 | } 162 | } 163 | 164 | - (void)networkRequestDidFinish:(NSNotification *)notification { 165 | if ([AFNetworkRequestFromNotification(notification) URL]) { 166 | [self decrementActivityCount]; 167 | } 168 | } 169 | 170 | @end 171 | 172 | #endif 173 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | 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 request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.m 2 | // Copyright (c) 2011–2015 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 | 24 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 25 | 26 | #import "AFHTTPRequestOperation.h" 27 | 28 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 29 | #import "AFURLSessionManager.h" 30 | #endif 31 | 32 | @implementation UIActivityIndicatorView (AFNetworking) 33 | 34 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 35 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 36 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 37 | 38 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 39 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 40 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 41 | 42 | if (task) { 43 | if (task.state != NSURLSessionTaskStateCompleted) { 44 | if (task.state == NSURLSessionTaskStateRunning) { 45 | [self startAnimating]; 46 | } else { 47 | [self stopAnimating]; 48 | } 49 | 50 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 51 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; 52 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; 53 | } 54 | } 55 | } 56 | #endif 57 | 58 | #pragma mark - 59 | 60 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation { 61 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 62 | 63 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 64 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 65 | 66 | if (operation) { 67 | if (![operation isFinished]) { 68 | if ([operation isExecuting]) { 69 | [self startAnimating]; 70 | } else { 71 | [self stopAnimating]; 72 | } 73 | 74 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation]; 75 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation]; 76 | } 77 | } 78 | } 79 | 80 | #pragma mark - 81 | 82 | - (void)af_startAnimating { 83 | dispatch_async(dispatch_get_main_queue(), ^{ 84 | [self startAnimating]; 85 | }); 86 | } 87 | 88 | - (void)af_stopAnimating { 89 | dispatch_async(dispatch_get_main_queue(), ^{ 90 | [self stopAnimating]; 91 | }); 92 | } 93 | 94 | @end 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIAlertView+AFNetworking.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error. 34 | */ 35 | @interface UIAlertView (AFNetworking) 36 | 37 | ///------------------------------------- 38 | /// @name Showing Alert for Session Task 39 | ///------------------------------------- 40 | 41 | /** 42 | Shows an alert view with the error of the specified session task, if any. 43 | 44 | @param task The session task. 45 | @param delegate The alert view delegate. 46 | */ 47 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 48 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 49 | delegate:(id)delegate; 50 | #endif 51 | 52 | /** 53 | Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles. 54 | 55 | @param task The session task. 56 | @param delegate The alert view delegate. 57 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 58 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 62 | delegate:(id)delegate 63 | cancelButtonTitle:(NSString *)cancelButtonTitle 64 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION; 65 | #endif 66 | 67 | ///------------------------------------------ 68 | /// @name Showing Alert for Request Operation 69 | ///------------------------------------------ 70 | 71 | /** 72 | Shows an alert view with the error of the specified request operation, if any. 73 | 74 | @param operation The request operation. 75 | @param delegate The alert view delegate. 76 | */ 77 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 78 | delegate:(id)delegate; 79 | 80 | /** 81 | Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles. 82 | 83 | @param operation The request operation. 84 | @param delegate The alert view delegate. 85 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 86 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 87 | */ 88 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 89 | delegate:(id)delegate 90 | cancelButtonTitle:(NSString *)cancelButtonTitle 91 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION; 92 | 93 | @end 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIAlertView+AFNetworking.m 2 | // Copyright (c) 2011–2015 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 "UIAlertView+AFNetworking.h" 23 | 24 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && !defined(AF_APP_EXTENSIONS) 25 | 26 | #import "AFURLConnectionOperation.h" 27 | 28 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 29 | #import "AFURLSessionManager.h" 30 | #endif 31 | 32 | static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) { 33 | if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) { 34 | *title = error.localizedDescription; 35 | 36 | if (error.localizedRecoverySuggestion) { 37 | *message = error.localizedRecoverySuggestion; 38 | } else { 39 | *message = error.localizedFailureReason; 40 | } 41 | } else if (error.localizedDescription) { 42 | *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); 43 | *message = error.localizedDescription; 44 | } else { 45 | *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description"); 46 | *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"AFNetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code]; 47 | } 48 | } 49 | 50 | @implementation UIAlertView (AFNetworking) 51 | 52 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 53 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 54 | delegate:(id)delegate 55 | { 56 | [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; 57 | } 58 | 59 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 60 | delegate:(id)delegate 61 | cancelButtonTitle:(NSString *)cancelButtonTitle 62 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION 63 | { 64 | NSMutableArray *mutableOtherTitles = [NSMutableArray array]; 65 | va_list otherButtonTitleList; 66 | va_start(otherButtonTitleList, otherButtonTitles); 67 | { 68 | for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { 69 | [mutableOtherTitles addObject:otherButtonTitle]; 70 | } 71 | } 72 | va_end(otherButtonTitleList); 73 | 74 | __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { 75 | NSError *error = notification.userInfo[AFNetworkingTaskDidCompleteErrorKey]; 76 | if (error) { 77 | NSString *title, *message; 78 | AFGetAlertViewTitleAndMessageFromError(error, &title, &message); 79 | 80 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; 81 | for (NSString *otherButtonTitle in mutableOtherTitles) { 82 | [alertView addButtonWithTitle:otherButtonTitle]; 83 | } 84 | [alertView setTitle:title]; 85 | [alertView setMessage:message]; 86 | [alertView show]; 87 | } 88 | 89 | [[NSNotificationCenter defaultCenter] removeObserver:observer]; 90 | }]; 91 | } 92 | #endif 93 | 94 | #pragma mark - 95 | 96 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 97 | delegate:(id)delegate 98 | { 99 | [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil]; 100 | } 101 | 102 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 103 | delegate:(id)delegate 104 | cancelButtonTitle:(NSString *)cancelButtonTitle 105 | otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION 106 | { 107 | NSMutableArray *mutableOtherTitles = [NSMutableArray array]; 108 | va_list otherButtonTitleList; 109 | va_start(otherButtonTitleList, otherButtonTitles); 110 | { 111 | for (NSString *otherButtonTitle = otherButtonTitles; otherButtonTitle != nil; otherButtonTitle = va_arg(otherButtonTitleList, NSString *)) { 112 | [mutableOtherTitles addObject:otherButtonTitle]; 113 | } 114 | } 115 | va_end(otherButtonTitleList); 116 | 117 | __block __weak id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { 118 | 119 | if (notification.object && [notification.object isKindOfClass:[AFURLConnectionOperation class]]) { 120 | NSError *error = [(AFURLConnectionOperation *)notification.object error]; 121 | if (error) { 122 | NSString *title, *message; 123 | AFGetAlertViewTitleAndMessageFromError(error, &title, &message); 124 | 125 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil, nil]; 126 | for (NSString *otherButtonTitle in mutableOtherTitles) { 127 | [alertView addButtonWithTitle:otherButtonTitle]; 128 | } 129 | [alertView setTitle:title]; 130 | [alertView setMessage:message]; 131 | [alertView show]; 132 | } 133 | } 134 | 135 | [[NSNotificationCenter defaultCenter] removeObserver:observer]; 136 | }]; 137 | } 138 | 139 | @end 140 | 141 | #endif 142 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @protocol AFURLResponseSerialization, AFImageCache; 31 | 32 | /** 33 | 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. 34 | */ 35 | @interface UIImageView (AFNetworking) 36 | 37 | ///---------------------------- 38 | /// @name Accessing Image Cache 39 | ///---------------------------- 40 | 41 | /** 42 | The image cache used to improve image loading performance on scroll views. By default, this is an `NSCache` subclass conforming to the `AFImageCache` protocol, which listens for notification warnings and evicts objects accordingly. 43 | */ 44 | + (id )sharedImageCache; 45 | 46 | /** 47 | Set the cache used for image loading. 48 | 49 | @param imageCache The image cache. 50 | */ 51 | + (void)setSharedImageCache:(id )imageCache; 52 | 53 | ///------------------------------------ 54 | /// @name Accessing Response Serializer 55 | ///------------------------------------ 56 | 57 | /** 58 | The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`. 59 | 60 | @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer 61 | */ 62 | @property (nonatomic, strong) id imageResponseSerializer; 63 | 64 | ///-------------------- 65 | /// @name Setting Image 66 | ///-------------------- 67 | 68 | /** 69 | 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. 70 | 71 | 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. 72 | 73 | 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:` 74 | 75 | @param url The URL used for the image request. 76 | */ 77 | - (void)setImageWithURL:(NSURL *)url; 78 | 79 | /** 80 | 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. 81 | 82 | 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. 83 | 84 | 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:` 85 | 86 | @param url The URL used for the image request. 87 | @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. 88 | */ 89 | - (void)setImageWithURL:(NSURL *)url 90 | placeholderImage:(UIImage *)placeholderImage; 91 | 92 | /** 93 | 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. 94 | 95 | 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. 96 | 97 | 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. 98 | 99 | @param urlRequest The URL request used for the image request. 100 | @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. 101 | @param success A block to be executed when the image request operation 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 request and response parameters will be `nil`. 102 | @param failure A block object to be executed when the image request operation 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. 103 | */ 104 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 105 | placeholderImage:(UIImage *)placeholderImage 106 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success 107 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure; 108 | 109 | /** 110 | Cancels any executing image operation for the receiver, if one exists. 111 | */ 112 | - (void)cancelImageRequestOperation; 113 | 114 | @end 115 | 116 | #pragma mark - 117 | 118 | /** 119 | The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`. 120 | */ 121 | @protocol AFImageCache 122 | 123 | /** 124 | Returns a cached image for the specififed request, if available. 125 | 126 | @param request The image request. 127 | 128 | @return The cached image. 129 | */ 130 | - (UIImage *)cachedImageForRequest:(NSURLRequest *)request; 131 | 132 | /** 133 | Caches a particular image for the specified request. 134 | 135 | @param image The image to cache. 136 | @param request The request to be used as a cache key. 137 | */ 138 | - (void)cacheImage:(UIImage *)image 139 | forRequest:(NSURLRequest *)request; 140 | @end 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+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 | 25 | #ifndef _UIKIT_AFNETWORKING_ 26 | #define _UIKIT_AFNETWORKING_ 27 | 28 | #import "AFNetworkActivityIndicatorManager.h" 29 | 30 | #import "UIActivityIndicatorView+AFNetworking.h" 31 | #import "UIAlertView+AFNetworking.h" 32 | #import "UIButton+AFNetworking.h" 33 | #import "UIImageView+AFNetworking.h" 34 | #import "UIKit+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | 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 or request operation. 34 | */ 35 | @interface UIProgressView (AFNetworking) 36 | 37 | ///------------------------------------ 38 | /// @name Setting Session Task Progress 39 | ///------------------------------------ 40 | 41 | /** 42 | Binds the progress to the upload progress of the specified session task. 43 | 44 | @param task The session task. 45 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 46 | */ 47 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | #endif 51 | 52 | /** 53 | Binds the progress to the download progress of the specified session task. 54 | 55 | @param task The session task. 56 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 57 | */ 58 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 59 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 60 | animated:(BOOL)animated; 61 | #endif 62 | 63 | ///------------------------------------ 64 | /// @name Setting Session Task Progress 65 | ///------------------------------------ 66 | 67 | /** 68 | Binds the progress to the upload progress of the specified request operation. 69 | 70 | @param operation The request operation. 71 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 72 | */ 73 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 74 | animated:(BOOL)animated; 75 | 76 | /** 77 | Binds the progress to the download progress of the specified request operation. 78 | 79 | @param operation The request operation. 80 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 81 | */ 82 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 83 | animated:(BOOL)animated; 84 | 85 | @end 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 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 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | @class AFURLConnectionOperation; 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically begining and ending refreshing depending on the loading state of a request operation or 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 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 48 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 49 | #endif 50 | 51 | ///---------------------------------------- 52 | /// @name Refreshing for Request Operations 53 | ///---------------------------------------- 54 | 55 | /** 56 | Binds the refreshing state to the execution state of the specified operation. 57 | 58 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 59 | */ 60 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 61 | 62 | @end 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 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 "UIRefreshControl+AFNetworking.h" 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import "AFHTTPRequestOperation.h" 28 | 29 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 30 | #import "AFURLSessionManager.h" 31 | #endif 32 | 33 | @implementation UIRefreshControl (AFNetworking) 34 | 35 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 36 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 37 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 38 | 39 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 40 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 41 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 42 | 43 | if (task) { 44 | if (task.state == NSURLSessionTaskStateRunning) { 45 | [self beginRefreshing]; 46 | 47 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 48 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 49 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 50 | } else { 51 | [self endRefreshing]; 52 | } 53 | } 54 | } 55 | #endif 56 | 57 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation { 58 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 59 | 60 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil]; 61 | [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil]; 62 | 63 | if (operation) { 64 | if (![operation isFinished]) { 65 | if ([operation isExecuting]) { 66 | [self beginRefreshing]; 67 | } else { 68 | [self endRefreshing]; 69 | } 70 | 71 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation]; 72 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation]; 73 | } 74 | } 75 | } 76 | 77 | #pragma mark - 78 | 79 | - (void)af_beginRefreshing { 80 | dispatch_async(dispatch_get_main_queue(), ^{ 81 | [self beginRefreshing]; 82 | }); 83 | } 84 | 85 | - (void)af_endRefreshing { 86 | dispatch_async(dispatch_get_main_queue(), ^{ 87 | [self endRefreshing]; 88 | }); 89 | } 90 | 91 | @end 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFHTTPRequestSerializer, AFHTTPResponseSerializer; 31 | @protocol AFURLRequestSerialization, AFURLResponseSerialization; 32 | 33 | /** 34 | 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. 35 | 36 | @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. 37 | */ 38 | @interface UIWebView (AFNetworking) 39 | 40 | /** 41 | The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`. 42 | */ 43 | @property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; 44 | 45 | /** 46 | The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`. 47 | */ 48 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 49 | 50 | /** 51 | Asynchronously loads the specified request. 52 | 53 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 54 | @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. 55 | @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. 56 | @param failure A block object to be executed when the request operation 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. 57 | */ 58 | - (void)loadRequest:(NSURLRequest *)request 59 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 60 | success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 61 | failure:(void (^)(NSError *error))failure; 62 | 63 | /** 64 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 65 | 66 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 67 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 68 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 69 | @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. 70 | @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. 71 | @param failure A block object to be executed when the request operation 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. 72 | */ 73 | - (void)loadRequest:(NSURLRequest *)request 74 | MIMEType:(NSString *)MIMEType 75 | textEncodingName:(NSString *)textEncodingName 76 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 77 | success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 78 | failure:(void (^)(NSError *error))failure; 79 | 80 | @end 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.m 2 | // Copyright (c) 2011–2015 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 defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import "AFHTTPRequestOperation.h" 29 | #import "AFURLResponseSerialization.h" 30 | #import "AFURLRequestSerialization.h" 31 | 32 | @interface UIWebView (_AFNetworking) 33 | @property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation; 34 | @end 35 | 36 | @implementation UIWebView (_AFNetworking) 37 | 38 | - (AFHTTPRequestOperation *)af_HTTPRequestOperation { 39 | return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation)); 40 | } 41 | 42 | - (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation { 43 | objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | @end 47 | 48 | #pragma mark - 49 | 50 | @implementation UIWebView (AFNetworking) 51 | 52 | - (AFHTTPRequestSerializer *)requestSerializer { 53 | static AFHTTPRequestSerializer *_af_defaultRequestSerializer = nil; 54 | static dispatch_once_t onceToken; 55 | dispatch_once(&onceToken, ^{ 56 | _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer]; 57 | }); 58 | 59 | #pragma clang diagnostic push 60 | #pragma clang diagnostic ignored "-Wgnu" 61 | return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer; 62 | #pragma clang diagnostic pop 63 | } 64 | 65 | - (void)setRequestSerializer:(AFHTTPRequestSerializer *)requestSerializer { 66 | objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 67 | } 68 | 69 | - (AFHTTPResponseSerializer *)responseSerializer { 70 | static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil; 71 | static dispatch_once_t onceToken; 72 | dispatch_once(&onceToken, ^{ 73 | _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; 74 | }); 75 | 76 | #pragma clang diagnostic push 77 | #pragma clang diagnostic ignored "-Wgnu" 78 | return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; 79 | #pragma clang diagnostic pop 80 | } 81 | 82 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { 83 | objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 84 | } 85 | 86 | #pragma mark - 87 | 88 | - (void)loadRequest:(NSURLRequest *)request 89 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 90 | success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 91 | failure:(void (^)(NSError *error))failure 92 | { 93 | [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) { 94 | NSStringEncoding stringEncoding = NSUTF8StringEncoding; 95 | if (response.textEncodingName) { 96 | CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); 97 | if (encoding != kCFStringEncodingInvalidId) { 98 | stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); 99 | } 100 | } 101 | 102 | NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; 103 | if (success) { 104 | string = success(response, string); 105 | } 106 | 107 | return [string dataUsingEncoding:stringEncoding]; 108 | } failure:failure]; 109 | } 110 | 111 | - (void)loadRequest:(NSURLRequest *)request 112 | MIMEType:(NSString *)MIMEType 113 | textEncodingName:(NSString *)textEncodingName 114 | progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 115 | success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 116 | failure:(void (^)(NSError *error))failure 117 | { 118 | NSParameterAssert(request); 119 | 120 | if (self.af_HTTPRequestOperation) { 121 | [self.af_HTTPRequestOperation cancel]; 122 | } 123 | 124 | request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil]; 125 | 126 | self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; 127 | self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer; 128 | 129 | __weak __typeof(self)weakSelf = self; 130 | [self.af_HTTPRequestOperation setDownloadProgressBlock:progress]; 131 | [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) { 132 | NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData; 133 | 134 | #pragma clang diagnostic push 135 | #pragma clang diagnostic ignored "-Wgnu" 136 | __strong __typeof(weakSelf) strongSelf = weakSelf; 137 | [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]]; 138 | 139 | if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { 140 | [strongSelf.delegate webViewDidFinishLoad:strongSelf]; 141 | } 142 | 143 | #pragma clang diagnostic pop 144 | } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) { 145 | if (failure) { 146 | failure(error); 147 | } 148 | }]; 149 | 150 | [self.af_HTTPRequestOperation start]; 151 | 152 | if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { 153 | [self.delegate webViewDidStartLoad:self]; 154 | } 155 | } 156 | 157 | @end 158 | 159 | #endif 160 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.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/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.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/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+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/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.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/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.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/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+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/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.5.4): 3 | - AFNetworking/NSURLConnection (= 2.5.4) 4 | - AFNetworking/NSURLSession (= 2.5.4) 5 | - AFNetworking/Reachability (= 2.5.4) 6 | - AFNetworking/Security (= 2.5.4) 7 | - AFNetworking/Serialization (= 2.5.4) 8 | - AFNetworking/UIKit (= 2.5.4) 9 | - AFNetworking/NSURLConnection (2.5.4): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.5.4): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.5.4) 18 | - AFNetworking/Security (2.5.4) 19 | - AFNetworking/Serialization (2.5.4) 20 | - AFNetworking/UIKit (2.5.4): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - SDWebImage (3.7.2): 24 | - SDWebImage/Core (= 3.7.2) 25 | - SDWebImage/Core (3.7.2) 26 | 27 | DEPENDENCIES: 28 | - AFNetworking (~> 2.0) 29 | - SDWebImage (~> 3.7) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e 33 | SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29 34 | 35 | COCOAPODS: 0.37.2 36 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/Pods-AFNetworking.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/Pods-SDWebImage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-AFNetworking.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-SDWebImage.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 28D874025A5D8EC1A06B0681 26 | 27 | primary 28 | 29 | 30 | 2F8DAEFE1C670F03C6FCF7F3 31 | 32 | primary 33 | 34 | 35 | 8F92C9B338E62B7F339B5FD6 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Olivier Poitrey 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | #define dispatch_main_sync_safe(block)\ 59 | if ([NSThread isMainThread]) {\ 60 | block();\ 61 | } else {\ 62 | dispatch_sync(dispatch_get_main_queue(), block);\ 63 | } 64 | 65 | #define dispatch_main_async_safe(block)\ 66 | if ([NSThread isMainThread]) {\ 67 | block();\ 68 | } else {\ 69 | dispatch_async(dispatch_get_main_queue(), block);\ 70 | } 71 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | } 39 | 40 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 41 | image = scaledImage; 42 | } 43 | return image; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { 14 | SDWebImageDownloaderLowPriority = 1 << 0, 15 | SDWebImageDownloaderProgressiveDownload = 1 << 1, 16 | 17 | /** 18 | * By default, request prevent the of NSURLCache. With this flag, NSURLCache 19 | * is used with default policies. 20 | */ 21 | SDWebImageDownloaderUseNSURLCache = 1 << 2, 22 | 23 | /** 24 | * Call completion block with nil image/imageData if the image was read from NSURLCache 25 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`). 26 | */ 27 | 28 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, 29 | /** 30 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for 31 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled. 32 | */ 33 | 34 | SDWebImageDownloaderContinueInBackground = 1 << 4, 35 | 36 | /** 37 | * Handles cookies stored in NSHTTPCookieStore by setting 38 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES; 39 | */ 40 | SDWebImageDownloaderHandleCookies = 1 << 5, 41 | 42 | /** 43 | * Enable to allow untrusted SSL ceriticates. 44 | * Useful for testing purposes. Use with caution in production. 45 | */ 46 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, 47 | 48 | /** 49 | * Put the image in the high priority queue. 50 | */ 51 | SDWebImageDownloaderHighPriority = 1 << 7, 52 | }; 53 | 54 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { 55 | /** 56 | * Default value. All download operations will execute in queue style (first-in-first-out). 57 | */ 58 | SDWebImageDownloaderFIFOExecutionOrder, 59 | 60 | /** 61 | * All download operations will execute in stack style (last-in-first-out). 62 | */ 63 | SDWebImageDownloaderLIFOExecutionOrder 64 | }; 65 | 66 | extern NSString *const SDWebImageDownloadStartNotification; 67 | extern NSString *const SDWebImageDownloadStopNotification; 68 | 69 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); 70 | 71 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished); 72 | 73 | typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers); 74 | 75 | /** 76 | * Asynchronous downloader dedicated and optimized for image loading. 77 | */ 78 | @interface SDWebImageDownloader : NSObject 79 | 80 | /** 81 | * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. 82 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 83 | */ 84 | @property (assign, nonatomic) BOOL shouldDecompressImages; 85 | 86 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads; 87 | 88 | /** 89 | * Shows the current amount of downloads that still need to be downloaded 90 | */ 91 | @property (readonly, nonatomic) NSUInteger currentDownloadCount; 92 | 93 | 94 | /** 95 | * The timeout value (in seconds) for the download operation. Default: 15.0. 96 | */ 97 | @property (assign, nonatomic) NSTimeInterval downloadTimeout; 98 | 99 | 100 | /** 101 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. 102 | */ 103 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; 104 | 105 | /** 106 | * Singleton method, returns the shared instance 107 | * 108 | * @return global shared instance of downloader class 109 | */ 110 | + (SDWebImageDownloader *)sharedDownloader; 111 | 112 | /** 113 | * Set username 114 | */ 115 | @property (strong, nonatomic) NSString *username; 116 | 117 | /** 118 | * Set password 119 | */ 120 | @property (strong, nonatomic) NSString *password; 121 | 122 | /** 123 | * Set filter to pick headers for downloading image HTTP request. 124 | * 125 | * This block will be invoked for each downloading image request, returned 126 | * NSDictionary will be used as headers in corresponding HTTP request. 127 | */ 128 | @property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter; 129 | 130 | /** 131 | * Set a value for a HTTP header to be appended to each download HTTP request. 132 | * 133 | * @param value The value for the header field. Use `nil` value to remove the header. 134 | * @param field The name of the header field to set. 135 | */ 136 | - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field; 137 | 138 | /** 139 | * Returns the value of the specified HTTP header field. 140 | * 141 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field. 142 | */ 143 | - (NSString *)valueForHTTPHeaderField:(NSString *)field; 144 | 145 | /** 146 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default 147 | * `NSOperation` to be used each time SDWebImage constructs a request 148 | * operation to download an image. 149 | * 150 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set 151 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. 152 | */ 153 | - (void)setOperationClass:(Class)operationClass; 154 | 155 | /** 156 | * Creates a SDWebImageDownloader async downloader instance with a given URL 157 | * 158 | * The delegate will be informed when the image is finish downloaded or an error has happen. 159 | * 160 | * @see SDWebImageDownloaderDelegate 161 | * 162 | * @param url The URL to the image to download 163 | * @param options The options to be used for this download 164 | * @param progressBlock A block called repeatedly while the image is downloading 165 | * @param completedBlock A block called once the download is completed. 166 | * If the download succeeded, the image parameter is set, in case of error, 167 | * error parameter is set with the error. The last parameter is always YES 168 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the 169 | * SDWebImageDownloaderProgressiveDownload option, this block is called 170 | * repeatedly with the partial image object and the finished argument set to NO 171 | * before to be called a last time with the full image and finished argument 172 | * set to YES. In case of error, the finished argument is always YES. 173 | * 174 | * @return A cancellable SDWebImageOperation 175 | */ 176 | - (id )downloadImageWithURL:(NSURL *)url 177 | options:(SDWebImageDownloaderOptions)options 178 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 179 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock; 180 | 181 | /** 182 | * Sets the download queue suspension state 183 | */ 184 | - (void)setSuspended:(BOOL)suspended; 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | @interface SDWebImageDownloaderOperation : NSOperation 14 | 15 | /** 16 | * The request used by the operation's connection. 17 | */ 18 | @property (strong, nonatomic, readonly) NSURLRequest *request; 19 | 20 | 21 | @property (assign, nonatomic) BOOL shouldDecompressImages; 22 | 23 | /** 24 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 25 | * 26 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 27 | */ 28 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 29 | 30 | /** 31 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 32 | * 33 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 34 | */ 35 | @property (nonatomic, strong) NSURLCredential *credential; 36 | 37 | /** 38 | * The SDWebImageDownloaderOptions for the receiver. 39 | */ 40 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 41 | 42 | /** 43 | * Initializes a `SDWebImageDownloaderOperation` object 44 | * 45 | * @see SDWebImageDownloaderOperation 46 | * 47 | * @param request the URL request 48 | * @param options downloader options 49 | * @param progressBlock the block executed when a new chunk of data arrives. 50 | * @note the progress block is executed on a background queue 51 | * @param completedBlock the block executed when the download is done. 52 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 53 | * @param cancelBlock the block executed if the download (operation) is cancelled 54 | * 55 | * @return the initialized instance 56 | */ 57 | - (id)initWithRequest:(NSURLRequest *)request 58 | options:(SDWebImageDownloaderOptions)options 59 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 60 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 61 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImagePrefetcher.h" 10 | 11 | #if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE) 12 | #define NSLog(...) 13 | #endif 14 | 15 | @interface SDWebImagePrefetcher () 16 | 17 | @property (strong, nonatomic) SDWebImageManager *manager; 18 | @property (strong, nonatomic) NSArray *prefetchURLs; 19 | @property (assign, nonatomic) NSUInteger requestedCount; 20 | @property (assign, nonatomic) NSUInteger skippedCount; 21 | @property (assign, nonatomic) NSUInteger finishedCount; 22 | @property (assign, nonatomic) NSTimeInterval startedTime; 23 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock; 24 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock; 25 | 26 | @end 27 | 28 | @implementation SDWebImagePrefetcher 29 | 30 | + (SDWebImagePrefetcher *)sharedImagePrefetcher { 31 | static dispatch_once_t once; 32 | static id instance; 33 | dispatch_once(&once, ^{ 34 | instance = [self new]; 35 | }); 36 | return instance; 37 | } 38 | 39 | - (id)init { 40 | if ((self = [super init])) { 41 | _manager = [SDWebImageManager new]; 42 | _options = SDWebImageLowPriority; 43 | _prefetcherQueue = dispatch_get_main_queue(); 44 | self.maxConcurrentDownloads = 3; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { 50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; 51 | } 52 | 53 | - (NSUInteger)maxConcurrentDownloads { 54 | return self.manager.imageDownloader.maxConcurrentDownloads; 55 | } 56 | 57 | - (void)startPrefetchingAtIndex:(NSUInteger)index { 58 | if (index >= self.prefetchURLs.count) return; 59 | self.requestedCount++; 60 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 61 | if (!finished) return; 62 | self.finishedCount++; 63 | 64 | if (image) { 65 | if (self.progressBlock) { 66 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 67 | } 68 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count)); 69 | } 70 | else { 71 | if (self.progressBlock) { 72 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 73 | } 74 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count)); 75 | 76 | // Add last failed 77 | self.skippedCount++; 78 | } 79 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { 80 | [self.delegate imagePrefetcher:self 81 | didPrefetchURL:self.prefetchURLs[index] 82 | finishedCount:self.finishedCount 83 | totalCount:self.prefetchURLs.count 84 | ]; 85 | } 86 | if (self.prefetchURLs.count > self.requestedCount) { 87 | dispatch_async(self.prefetcherQueue, ^{ 88 | [self startPrefetchingAtIndex:self.requestedCount]; 89 | }); 90 | } 91 | else if (self.finishedCount == self.requestedCount) { 92 | [self reportStatus]; 93 | if (self.completionBlock) { 94 | self.completionBlock(self.finishedCount, self.skippedCount); 95 | self.completionBlock = nil; 96 | } 97 | } 98 | }]; 99 | } 100 | 101 | - (void)reportStatus { 102 | NSUInteger total = [self.prefetchURLs count]; 103 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime); 104 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { 105 | [self.delegate imagePrefetcher:self 106 | didFinishWithTotalCount:(total - self.skippedCount) 107 | skippedCount:self.skippedCount 108 | ]; 109 | } 110 | } 111 | 112 | - (void)prefetchURLs:(NSArray *)urls { 113 | [self prefetchURLs:urls progress:nil completed:nil]; 114 | } 115 | 116 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { 117 | [self cancelPrefetching]; // Prevent duplicate prefetch request 118 | self.startedTime = CFAbsoluteTimeGetCurrent(); 119 | self.prefetchURLs = urls; 120 | self.completionBlock = completionBlock; 121 | self.progressBlock = progressBlock; 122 | 123 | if(urls.count == 0){ 124 | if(completionBlock){ 125 | completionBlock(0,0); 126 | } 127 | }else{ 128 | // Starts prefetching from the very first image on the list with the max allowed concurrency 129 | NSUInteger listCount = self.prefetchURLs.count; 130 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { 131 | [self startPrefetchingAtIndex:i]; 132 | } 133 | } 134 | } 135 | 136 | - (void)cancelPrefetching { 137 | self.prefetchURLs = nil; 138 | self.skippedCount = 0; 139 | self.requestedCount = 0; 140 | self.finishedCount = 0; 141 | [self.manager cancelAll]; 142 | } 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.m 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "UIImage+GIF.h" 10 | #import 11 | 12 | @implementation UIImage (GIF) 13 | 14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 15 | if (!data) { 16 | return nil; 17 | } 18 | 19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 20 | 21 | size_t count = CGImageSourceGetCount(source); 22 | 23 | UIImage *animatedImage; 24 | 25 | if (count <= 1) { 26 | animatedImage = [[UIImage alloc] initWithData:data]; 27 | } 28 | else { 29 | NSMutableArray *images = [NSMutableArray array]; 30 | 31 | NSTimeInterval duration = 0.0f; 32 | 33 | for (size_t i = 0; i < count; i++) { 34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); 35 | 36 | duration += [self sd_frameDurationAtIndex:i source:source]; 37 | 38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; 39 | 40 | CGImageRelease(image); 41 | } 42 | 43 | if (!duration) { 44 | duration = (1.0f / 10.0f) * count; 45 | } 46 | 47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration]; 48 | } 49 | 50 | CFRelease(source); 51 | 52 | return animatedImage; 53 | } 54 | 55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { 56 | float frameDuration = 0.1f; 57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); 58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; 59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; 60 | 61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; 62 | if (delayTimeUnclampedProp) { 63 | frameDuration = [delayTimeUnclampedProp floatValue]; 64 | } 65 | else { 66 | 67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; 68 | if (delayTimeProp) { 69 | frameDuration = [delayTimeProp floatValue]; 70 | } 71 | } 72 | 73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 75 | // a duration of <= 10 ms. See and 76 | // for more information. 77 | 78 | if (frameDuration < 0.011f) { 79 | frameDuration = 0.100f; 80 | } 81 | 82 | CFRelease(cfFrameProperties); 83 | return frameDuration; 84 | } 85 | 86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name { 87 | CGFloat scale = [UIScreen mainScreen].scale; 88 | 89 | if (scale > 1.0f) { 90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; 91 | 92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath]; 93 | 94 | if (data) { 95 | return [UIImage sd_animatedGIFWithData:data]; 96 | } 97 | 98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 99 | 100 | data = [NSData dataWithContentsOfFile:path]; 101 | 102 | if (data) { 103 | return [UIImage sd_animatedGIFWithData:data]; 104 | } 105 | 106 | return [UIImage imageNamed:name]; 107 | } 108 | else { 109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 110 | 111 | NSData *data = [NSData dataWithContentsOfFile:path]; 112 | 113 | if (data) { 114 | return [UIImage sd_animatedGIFWithData:data]; 115 | } 116 | 117 | return [UIImage imageNamed:name]; 118 | } 119 | } 120 | 121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { 122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { 123 | return self; 124 | } 125 | 126 | CGSize scaledSize = size; 127 | CGPoint thumbnailPoint = CGPointZero; 128 | 129 | CGFloat widthFactor = size.width / self.size.width; 130 | CGFloat heightFactor = size.height / self.size.height; 131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; 132 | scaledSize.width = self.size.width * scaleFactor; 133 | scaledSize.height = self.size.height * scaleFactor; 134 | 135 | if (widthFactor > heightFactor) { 136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; 137 | } 138 | else if (widthFactor < heightFactor) { 139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; 140 | } 141 | 142 | NSMutableArray *scaledImages = [NSMutableArray array]; 143 | 144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); 145 | 146 | for (UIImage *image in self.images) { 147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; 148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 149 | 150 | [scaledImages addObject:newImage]; 151 | } 152 | 153 | UIGraphicsEndImageContext(); 154 | 155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage sd_imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageManager.h" 12 | 13 | /** 14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 15 | */ 16 | @interface UIImageView (HighlightedWebCache) 17 | 18 | /** 19 | * Set the imageView `highlightedImage` with an `url`. 20 | * 21 | * The download is asynchronous and cached. 22 | * 23 | * @param url The url for the image. 24 | */ 25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url; 26 | 27 | /** 28 | * Set the imageView `highlightedImage` with an `url` and custom options. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 34 | */ 35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; 36 | 37 | /** 38 | * Set the imageView `highlightedImage` with an `url`. 39 | * 40 | * The download is asynchronous and cached. 41 | * 42 | * @param url The url for the image. 43 | * @param completedBlock A block called when operation has been completed. This block has no return value 44 | * and takes the requested UIImage as first parameter. In case of error the image parameter 45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 46 | * indicating if the image was retrived from the local cache or from the network. 47 | * The fourth parameter is the original image url. 48 | */ 49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 50 | 51 | /** 52 | * Set the imageView `highlightedImage` with an `url` and custom options. 53 | * 54 | * The download is asynchronous and cached. 55 | * 56 | * @param url The url for the image. 57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrived from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 65 | 66 | /** 67 | * Set the imageView `highlightedImage` with an `url` and custom options. 68 | * 69 | * The download is asynchronous and cached. 70 | * 71 | * @param url The url for the image. 72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 73 | * @param progressBlock A block called while image is downloading 74 | * @param completedBlock A block called when operation has been completed. This block has no return value 75 | * and takes the requested UIImage as first parameter. In case of error the image parameter 76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 77 | * indicating if the image was retrived from the local cache or from the network. 78 | * The fourth parameter is the original image url. 79 | */ 80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; 81 | 82 | /** 83 | * Cancel the current download 84 | */ 85 | - (void)sd_cancelCurrentHighlightedImageLoad; 86 | 87 | @end 88 | 89 | 90 | @interface UIImageView (HighlightedWebCacheDeprecated) 91 | 92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); 93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); 94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); 96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); 97 | 98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak UIImageView *wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:@"SDWebImageErrorDomain" code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AFNetworking/Pods-AFNetworking-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-AFNetworking.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = ${PODS_AFNETWORKING_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AFNetworking/Pods-AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AFNetworking/Pods-AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AFNetworking/Pods-AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_AFNETWORKING_OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SDWebImage/Pods-SDWebImage-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-SDWebImage.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = ${PODS_SDWEBIMAGE_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SDWebImage/Pods-SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SDWebImage/Pods-SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SDWebImage/Pods-SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_SDWEBIMAGE_OTHER_LDFLAGS = -framework "ImageIO" -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 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 | ## SDWebImage 28 | 29 | Copyright (c) 2009 Olivier Poitrey 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is furnished 36 | to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in all 39 | copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | 50 | Generated by CocoaPods - http://cocoapods.org 51 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | AFNetworking 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Copyright (c) 2009 Olivier Poitrey <rs@dailymotion.com> 45 | 46 | Permission is hereby granted, free of charge, to any person obtaining a copy 47 | of this software and associated documentation files (the "Software"), to deal 48 | in the Software without restriction, including without limitation the rights 49 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 50 | copies of the Software, and to permit persons to whom the Software is furnished 51 | to do so, subject to the following conditions: 52 | 53 | The above copyright notice and this permission notice shall be included in all 54 | copies or substantial portions of the Software. 55 | 56 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 57 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 58 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 59 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 60 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 61 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 62 | THE SOFTWARE. 63 | 64 | 65 | Title 66 | SDWebImage 67 | Type 68 | PSGroupSpecifier 69 | 70 | 71 | FooterText 72 | Generated by CocoaPods - http://cocoapods.org 73 | Title 74 | 75 | Type 76 | PSGroupSpecifier 77 | 78 | 79 | StringsTable 80 | Acknowledgements 81 | Title 82 | Acknowledgements 83 | 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // AFNetworking 10 | #define COCOAPODS_POD_AVAILABLE_AFNetworking 11 | #define COCOAPODS_VERSION_MAJOR_AFNetworking 2 12 | #define COCOAPODS_VERSION_MINOR_AFNetworking 5 13 | #define COCOAPODS_VERSION_PATCH_AFNetworking 4 14 | 15 | // AFNetworking/NSURLConnection 16 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLConnection 17 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLConnection 2 18 | #define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLConnection 5 19 | #define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLConnection 4 20 | 21 | // AFNetworking/NSURLSession 22 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLSession 23 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLSession 2 24 | #define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLSession 5 25 | #define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLSession 4 26 | 27 | // AFNetworking/Reachability 28 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_Reachability 29 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_Reachability 2 30 | #define COCOAPODS_VERSION_MINOR_AFNetworking_Reachability 5 31 | #define COCOAPODS_VERSION_PATCH_AFNetworking_Reachability 4 32 | 33 | // AFNetworking/Security 34 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_Security 35 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_Security 2 36 | #define COCOAPODS_VERSION_MINOR_AFNetworking_Security 5 37 | #define COCOAPODS_VERSION_PATCH_AFNetworking_Security 4 38 | 39 | // AFNetworking/Serialization 40 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_Serialization 41 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_Serialization 2 42 | #define COCOAPODS_VERSION_MINOR_AFNetworking_Serialization 5 43 | #define COCOAPODS_VERSION_PATCH_AFNetworking_Serialization 4 44 | 45 | // AFNetworking/UIKit 46 | #define COCOAPODS_POD_AVAILABLE_AFNetworking_UIKit 47 | #define COCOAPODS_VERSION_MAJOR_AFNetworking_UIKit 2 48 | #define COCOAPODS_VERSION_MINOR_AFNetworking_UIKit 5 49 | #define COCOAPODS_VERSION_PATCH_AFNetworking_UIKit 4 50 | 51 | // SDWebImage 52 | #define COCOAPODS_POD_AVAILABLE_SDWebImage 53 | #define COCOAPODS_VERSION_MAJOR_SDWebImage 3 54 | #define COCOAPODS_VERSION_MINOR_SDWebImage 7 55 | #define COCOAPODS_VERSION_PATCH_SDWebImage 2 56 | 57 | // SDWebImage/Core 58 | #define COCOAPODS_POD_AVAILABLE_SDWebImage_Core 59 | #define COCOAPODS_VERSION_MAJOR_SDWebImage_Core 3 60 | #define COCOAPODS_VERSION_MINOR_SDWebImage_Core 7 61 | #define COCOAPODS_VERSION_PATCH_SDWebImage_Core 2 62 | 63 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 93 | fi 94 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.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/SDWebImage" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-AFNetworking" -l"Pods-SDWebImage" -framework "CoreGraphics" -framework "ImageIO" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.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/SDWebImage" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-AFNetworking" -l"Pods-SDWebImage" -framework "CoreGraphics" -framework "ImageIO" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # webViewDemo 2 | 网易新闻中新闻详情页UIWebView的实现 3 | 在UIWebview中,自己控制图片的下载缓存。而不使用webview自带的下载缓存。 4 | -------------------------------------------------------------------------------- /webViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /webViewDemo.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/webViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /webViewDemo.xcodeproj/xcuserdata/xukun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | webViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6712F92C1B1D549B0092AF39 16 | 17 | primary 18 | 19 | 20 | 6712F9451B1D549B0092AF39 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /webViewDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /webViewDemo.xcworkspace/xcuserdata/xukun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /webViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. 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 | -------------------------------------------------------------------------------- /webViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /webViewDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /webViewDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /webViewDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /webViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | xukun.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /webViewDemo/MyWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyWebViewController.h 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AFNetworking.h" 11 | #import "WebViewJavascriptBridge.h" 12 | #import "SDWebImageManager.h" 13 | #import "imageInfo.h" 14 | #import "videoInfo.h" 15 | #import "SDImageCache.h" 16 | 17 | @interface MyWebViewController : UIViewController 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /webViewDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /webViewDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.title = @"Home"; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /webViewDemo/WebViewJavascriptBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewJavascriptBridge.h 3 | // ExampleApp-iOS 4 | // 5 | // Created by Marcus Westin on 6/14/13. 6 | // Copyright (c) 2013 Marcus Westin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define kCustomProtocolScheme @"wvjbscheme" 12 | #define kQueueHasMessage @"__WVJB_QUEUE_MESSAGE__" 13 | 14 | #if defined __MAC_OS_X_VERSION_MAX_ALLOWED 15 | #import 16 | #define WVJB_PLATFORM_OSX 17 | #define WVJB_WEBVIEW_TYPE WebView 18 | #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject 19 | #elif defined __IPHONE_OS_VERSION_MAX_ALLOWED 20 | #import 21 | #define WVJB_PLATFORM_IOS 22 | #define WVJB_WEBVIEW_TYPE UIWebView 23 | #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject 24 | #endif 25 | 26 | typedef void (^WVJBResponseCallback)(id responseData); 27 | typedef void (^WVJBHandler)(id data, WVJBResponseCallback responseCallback); 28 | 29 | @interface WebViewJavascriptBridge : WVJB_WEBVIEW_DELEGATE_TYPE 30 | 31 | + (instancetype)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView handler:(WVJBHandler)handler; 32 | + (instancetype)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate handler:(WVJBHandler)handler; 33 | + (instancetype)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate handler:(WVJBHandler)handler resourceBundle:(NSBundle*)bundle; 34 | + (void)enableLogging; 35 | 36 | - (void)send:(id)message; 37 | - (void)send:(id)message responseCallback:(WVJBResponseCallback)responseCallback; 38 | - (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler; 39 | - (void)callHandler:(NSString*)handlerName; 40 | - (void)callHandler:(NSString*)handlerName data:(id)data; 41 | - (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /webViewDemo/WebViewJavascriptBridge.js.txt: -------------------------------------------------------------------------------- 1 | ;(function() { 2 | if (window.WebViewJavascriptBridge) { return } 3 | var messagingIframe 4 | var sendMessageQueue = [] 5 | var receiveMessageQueue = [] 6 | var messageHandlers = {} 7 | 8 | var CUSTOM_PROTOCOL_SCHEME = 'wvjbscheme' 9 | var QUEUE_HAS_MESSAGE = '__WVJB_QUEUE_MESSAGE__' 10 | 11 | var responseCallbacks = {} 12 | var uniqueId = 1 13 | 14 | function _createQueueReadyIframe(doc) { 15 | messagingIframe = doc.createElement('iframe') 16 | messagingIframe.style.display = 'none' 17 | messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE 18 | doc.documentElement.appendChild(messagingIframe) 19 | } 20 | 21 | function init(messageHandler) { 22 | if (WebViewJavascriptBridge._messageHandler) { throw new Error('WebViewJavascriptBridge.init called twice') } 23 | WebViewJavascriptBridge._messageHandler = messageHandler 24 | var receivedMessages = receiveMessageQueue 25 | receiveMessageQueue = null 26 | for (var i=0; i 10 | 11 | @interface imageInfo : NSObject 12 | 13 | @property(nonatomic,copy)NSString *alt; 14 | @property(nonatomic,copy)NSString *pixel; 15 | @property(nonatomic,copy)NSString *ref; 16 | @property(nonatomic,copy)NSString *src; 17 | 18 | - (id)initWithInfo:(NSDictionary *)dic; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /webViewDemo/imageInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // imageInfo.m 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import "ImageInfo.h" 10 | 11 | @implementation imageInfo 12 | 13 | - (id)initWithInfo:(NSDictionary *)dic 14 | { 15 | if (self) { 16 | [self setValuesForKeysWithDictionary:dic];//kvc 17 | } 18 | return self; 19 | } 20 | 21 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 22 | { 23 | 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /webViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. 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 | -------------------------------------------------------------------------------- /webViewDemo/videoInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // videoInfo.h 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface videoInfo : NSObject 12 | 13 | - (id)initWithInfo:(NSDictionary *)dic; 14 | 15 | @property (nonatomic,retain)NSString *url_mp4; 16 | 17 | @property(nonatomic,retain)NSString *ref; 18 | @end 19 | -------------------------------------------------------------------------------- /webViewDemo/videoInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // videoInfo.m 3 | // webViewDemo 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import "Videoinfo.h" 10 | 11 | @implementation videoInfo 12 | 13 | - (id)initWithInfo:(NSDictionary *)dic 14 | { 15 | if (self) { 16 | [self setValuesForKeysWithDictionary:dic];//kvc 17 | } 18 | return self; 19 | } 20 | 21 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 22 | { 23 | 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /webViewDemo/webViewHtml.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 74 |

mainnews

75 | 76 | 77 | -------------------------------------------------------------------------------- /webViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | xukun.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /webViewDemoTests/webViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // webViewDemoTests.m 3 | // webViewDemoTests 4 | // 5 | // Created by 徐坤 on 15/6/2. 6 | // Copyright (c) 2015年 xukun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface webViewDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation webViewDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------