├── .DS_Store ├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── .DS_Store ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFAutoPurgingImageCache.m │ │ ├── AFImageDownloader.h │ │ ├── AFImageDownloader.m │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ └── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFImageDownloader.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ └── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h ├── Manifest.lock ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── .DS_Store │ ├── AFNetworking │ ├── AFNetworking-dummy.m │ ├── AFNetworking-prefix.pch │ └── AFNetworking.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ └── Pods-YWLogisticsQueryDemo │ ├── Pods-YWLogisticsQueryDemo-acknowledgements.markdown │ ├── Pods-YWLogisticsQueryDemo-acknowledgements.plist │ ├── Pods-YWLogisticsQueryDemo-dummy.m │ ├── Pods-YWLogisticsQueryDemo-frameworks.sh │ ├── Pods-YWLogisticsQueryDemo-resources.sh │ ├── Pods-YWLogisticsQueryDemo.debug.xcconfig │ └── Pods-YWLogisticsQueryDemo.release.xcconfig ├── README.md ├── YWLogisticsQuery.podspec ├── YWLogisticsQuery ├── Resources │ └── icon_placeholder_image.png ├── YWConfigFile.h ├── YWImageCache.h ├── YWImageCache.m ├── YWLogisticCell.h ├── YWLogisticCell.m ├── YWLogisticCellModel.h ├── YWLogisticCellModel.m ├── YWLogisticModel.h ├── YWLogisticModel.m ├── YWLogisticsView.h ├── YWLogisticsView.m ├── YWTableCellContentView.h ├── YWTableCellContentView.m ├── YWTableHeaderView.h └── YWTableHeaderView.m ├── YWLogisticsQueryDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── YWLogisticsQueryDemo.xcworkspace └── contents.xcworkspacedata ├── YWLogisticsQueryDemo ├── .DS_Store ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── .DS_Store │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── LogisticsQueryViewController.h ├── LogisticsQueryViewController.m ├── ViewController.h ├── ViewController.m ├── ZXPUnicode.h ├── ZXPUnicode.m └── main.m └── 效果图.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 阿唯不知道 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | 4 | target 'YWLogisticsQueryDemo' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | # Pods for YWLogisticsQueryDemo 9 | 10 | pod 'Masonry', '~> 1.1.0' 11 | pod 'AFNetworking', '~> 3.2.0' 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.0): 3 | - AFNetworking/NSURLSession (= 3.2.0) 4 | - AFNetworking/Reachability (= 3.2.0) 5 | - AFNetworking/Security (= 3.2.0) 6 | - AFNetworking/Serialization (= 3.2.0) 7 | - AFNetworking/UIKit (= 3.2.0) 8 | - AFNetworking/NSURLSession (3.2.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.0) 13 | - AFNetworking/Security (3.2.0) 14 | - AFNetworking/Serialization (3.2.0) 15 | - AFNetworking/UIKit (3.2.0): 16 | - AFNetworking/NSURLSession 17 | - Masonry (1.1.0) 18 | 19 | DEPENDENCIES: 20 | - AFNetworking (~> 3.2.0) 21 | - Masonry (~> 1.1.0) 22 | 23 | SPEC CHECKSUMS: 24 | AFNetworking: 8ac6017b94ea105479f7776e5288e48ae9c59bb4 25 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 26 | 27 | PODFILE CHECKSUM: a355a5d7563d1d7c1c2a1353a084422d250ea0aa 28 | 29 | COCOAPODS: 1.4.0 30 | -------------------------------------------------------------------------------- /Pods/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/Pods/.DS_Store -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | The certificates used to evaluate server trust according to the SSL pinning mode. 48 | 49 | By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. 50 | 51 | Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 52 | */ 53 | @property (nonatomic, strong, nullable) NSSet *pinnedCertificates; 54 | 55 | /** 56 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 57 | */ 58 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 59 | 60 | /** 61 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 62 | */ 63 | @property (nonatomic, assign) BOOL validatesDomainName; 64 | 65 | ///----------------------------------------- 66 | /// @name Getting Certificates from the Bundle 67 | ///----------------------------------------- 68 | 69 | /** 70 | Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. 71 | 72 | @return The certificates included in the given bundle. 73 | */ 74 | + (NSSet *)certificatesInBundle:(NSBundle *)bundle; 75 | 76 | ///----------------------------------------- 77 | /// @name Getting Specific Security Policies 78 | ///----------------------------------------- 79 | 80 | /** 81 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. 82 | 83 | @return The default security policy. 84 | */ 85 | + (instancetype)defaultPolicy; 86 | 87 | ///--------------------- 88 | /// @name Initialization 89 | ///--------------------- 90 | 91 | /** 92 | Creates and returns a security policy with the specified pinning mode. 93 | 94 | @param pinningMode The SSL pinning mode. 95 | 96 | @return A new security policy. 97 | */ 98 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 99 | 100 | /** 101 | Creates and returns a security policy with the specified pinning mode. 102 | 103 | @param pinningMode The SSL pinning mode. 104 | @param pinnedCertificates The certificates to pin against. 105 | 106 | @return A new security policy. 107 | */ 108 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; 109 | 110 | ///------------------------------ 111 | /// @name Evaluating Server Trust 112 | ///------------------------------ 113 | 114 | /** 115 | Whether or not the specified server trust should be accepted, based on the security policy. 116 | 117 | This method should be used when responding to an authentication challenge from a server. 118 | 119 | @param serverTrust The X.509 certificate trust of the server. 120 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 121 | 122 | @return Whether or not to trust the server. 123 | */ 124 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 125 | forDomain:(nullable NSString *)domain; 126 | 127 | @end 128 | 129 | NS_ASSUME_NONNULL_END 130 | 131 | ///---------------- 132 | /// @name Constants 133 | ///---------------- 134 | 135 | /** 136 | ## SSL Pinning Modes 137 | 138 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 139 | 140 | enum { 141 | AFSSLPinningModeNone, 142 | AFSSLPinningModePublicKey, 143 | AFSSLPinningModeCertificate, 144 | } 145 | 146 | `AFSSLPinningModeNone` 147 | Do not used pinned certificates to validate servers. 148 | 149 | `AFSSLPinningModePublicKey` 150 | Validate host certificates against public keys of pinned certificates. 151 | 152 | `AFSSLPinningModeCertificate` 153 | Validate host certificates against pinned certificates. 154 | */ 155 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator manager is currently active. 56 | */ 57 | @property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 58 | 59 | /** 60 | A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. 61 | 62 | Apple's HIG describes the following: 63 | 64 | > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. 65 | 66 | */ 67 | @property (nonatomic, assign) NSTimeInterval activationDelay; 68 | 69 | /** 70 | A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. 71 | */ 72 | 73 | @property (nonatomic, assign) NSTimeInterval completionDelay; 74 | 75 | /** 76 | Returns the shared network activity indicator manager object for the system. 77 | 78 | @return The systemwide network activity indicator manager. 79 | */ 80 | + (instancetype)sharedManager; 81 | 82 | /** 83 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 84 | */ 85 | - (void)incrementActivityCount; 86 | 87 | /** 88 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 89 | */ 90 | - (void)decrementActivityCount; 91 | 92 | /** 93 | Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. 94 | 95 | @param block A block to be executed when the network activity indicator status changes. 96 | */ 97 | - (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; 98 | 99 | @end 100 | 101 | NS_ASSUME_NONNULL_END 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIActivityIndicatorView+AFNetworking.h" 23 | #import 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import "AFURLSessionManager.h" 28 | 29 | @interface AFActivityIndicatorViewNotificationObserver : NSObject 30 | @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; 31 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; 32 | 33 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 34 | 35 | @end 36 | 37 | @implementation UIActivityIndicatorView (AFNetworking) 38 | 39 | - (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { 40 | AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 41 | if (notificationObserver == nil) { 42 | notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; 43 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | return notificationObserver; 46 | } 47 | 48 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 49 | [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; 50 | } 51 | 52 | @end 53 | 54 | @implementation AFActivityIndicatorViewNotificationObserver 55 | 56 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView 57 | { 58 | self = [super init]; 59 | if (self) { 60 | _activityIndicatorView = activityIndicatorView; 61 | } 62 | return self; 63 | } 64 | 65 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 66 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 67 | 68 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 71 | 72 | if (task) { 73 | if (task.state != NSURLSessionTaskStateCompleted) { 74 | UIActivityIndicatorView *activityIndicatorView = self.activityIndicatorView; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [activityIndicatorView startAnimating]; 77 | } else { 78 | [activityIndicatorView stopAnimating]; 79 | } 80 | 81 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 82 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; 83 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; 84 | } 85 | } 86 | } 87 | 88 | #pragma mark - 89 | 90 | - (void)af_startAnimating { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self.activityIndicatorView startAnimating]; 93 | }); 94 | } 95 | 96 | - (void)af_stopAnimating { 97 | dispatch_async(dispatch_get_main_queue(), ^{ 98 | [self.activityIndicatorView stopAnimating]; 99 | }); 100 | } 101 | 102 | #pragma mark - 103 | 104 | - (void)dealloc { 105 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 106 | 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 109 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 110 | } 111 | 112 | @end 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFImageDownloader; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. 36 | */ 37 | @interface UIImageView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Accessing the Image Downloader 41 | ///------------------------------------ 42 | 43 | /** 44 | Set the shared image downloader used to download images. 45 | 46 | @param imageDownloader The shared image downloader used to download images. 47 | */ 48 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; 49 | 50 | /** 51 | The shared image downloader used to download images. 52 | */ 53 | + (AFImageDownloader *)sharedImageDownloader; 54 | 55 | ///-------------------- 56 | /// @name Setting Image 57 | ///-------------------- 58 | 59 | /** 60 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 61 | 62 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 63 | 64 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 65 | 66 | @param url The URL used for the image request. 67 | */ 68 | - (void)setImageWithURL:(NSURL *)url; 69 | 70 | /** 71 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 72 | 73 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 74 | 75 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 76 | 77 | @param url The URL used for the image request. 78 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 79 | */ 80 | - (void)setImageWithURL:(NSURL *)url 81 | placeholderImage:(nullable UIImage *)placeholderImage; 82 | 83 | /** 84 | Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 85 | 86 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 87 | 88 | If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. 89 | 90 | @param urlRequest The URL request used for the image request. 91 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 92 | @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. 93 | @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. 94 | */ 95 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 96 | placeholderImage:(nullable UIImage *)placeholderImage 97 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 98 | failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 99 | 100 | /** 101 | Cancels any executing image operation for the receiver, if one exists. 102 | */ 103 | - (void)cancelImageDownloadTask; 104 | 105 | @end 106 | 107 | NS_ASSUME_NONNULL_END 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIImageView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFImageDownloader.h" 29 | 30 | @interface UIImageView (_AFNetworking) 31 | @property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; 32 | @end 33 | 34 | @implementation UIImageView (_AFNetworking) 35 | 36 | - (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { 37 | return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); 38 | } 39 | 40 | - (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { 41 | objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 | } 43 | 44 | @end 45 | 46 | #pragma mark - 47 | 48 | @implementation UIImageView (AFNetworking) 49 | 50 | + (AFImageDownloader *)sharedImageDownloader { 51 | return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; 52 | } 53 | 54 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { 55 | objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 56 | } 57 | 58 | #pragma mark - 59 | 60 | - (void)setImageWithURL:(NSURL *)url { 61 | [self setImageWithURL:url placeholderImage:nil]; 62 | } 63 | 64 | - (void)setImageWithURL:(NSURL *)url 65 | placeholderImage:(UIImage *)placeholderImage 66 | { 67 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 68 | [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; 69 | 70 | [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; 71 | } 72 | 73 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 74 | placeholderImage:(UIImage *)placeholderImage 75 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 76 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 77 | { 78 | 79 | if ([urlRequest URL] == nil) { 80 | [self cancelImageDownloadTask]; 81 | self.image = placeholderImage; 82 | return; 83 | } 84 | 85 | if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ 86 | return; 87 | } 88 | 89 | [self cancelImageDownloadTask]; 90 | 91 | AFImageDownloader *downloader = [[self class] sharedImageDownloader]; 92 | id imageCache = downloader.imageCache; 93 | 94 | //Use the image from the image cache if it exists 95 | UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 96 | if (cachedImage) { 97 | if (success) { 98 | success(urlRequest, nil, cachedImage); 99 | } else { 100 | self.image = cachedImage; 101 | } 102 | [self clearActiveDownloadInformation]; 103 | } else { 104 | if (placeholderImage) { 105 | self.image = placeholderImage; 106 | } 107 | 108 | __weak __typeof(self)weakSelf = self; 109 | NSUUID *downloadID = [NSUUID UUID]; 110 | AFImageDownloadReceipt *receipt; 111 | receipt = [downloader 112 | downloadImageForURLRequest:urlRequest 113 | withReceiptID:downloadID 114 | success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { 115 | __strong __typeof(weakSelf)strongSelf = weakSelf; 116 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 117 | if (success) { 118 | success(request, response, responseObject); 119 | } else if(responseObject) { 120 | strongSelf.image = responseObject; 121 | } 122 | [strongSelf clearActiveDownloadInformation]; 123 | } 124 | 125 | } 126 | failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { 127 | __strong __typeof(weakSelf)strongSelf = weakSelf; 128 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 129 | if (failure) { 130 | failure(request, response, error); 131 | } 132 | [strongSelf clearActiveDownloadInformation]; 133 | } 134 | }]; 135 | 136 | self.af_activeImageDownloadReceipt = receipt; 137 | } 138 | } 139 | 140 | - (void)cancelImageDownloadTask { 141 | if (self.af_activeImageDownloadReceipt != nil) { 142 | [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; 143 | [self clearActiveDownloadInformation]; 144 | } 145 | } 146 | 147 | - (void)clearActiveDownloadInformation { 148 | self.af_activeImageDownloadReceipt = nil; 149 | } 150 | 151 | - (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { 152 | return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 153 | } 154 | 155 | @end 156 | 157 | #endif 158 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.m 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "UIProgressView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; 31 | static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; 32 | 33 | #pragma mark - 34 | 35 | @implementation UIProgressView (AFNetworking) 36 | 37 | - (BOOL)af_uploadProgressAnimated { 38 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; 39 | } 40 | 41 | - (void)af_setUploadProgressAnimated:(BOOL)animated { 42 | objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 43 | } 44 | 45 | - (BOOL)af_downloadProgressAnimated { 46 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; 47 | } 48 | 49 | - (void)af_setDownloadProgressAnimated:(BOOL)animated { 50 | objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 51 | } 52 | 53 | #pragma mark - 54 | 55 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 56 | animated:(BOOL)animated 57 | { 58 | if (task.state == NSURLSessionTaskStateCompleted) { 59 | return; 60 | } 61 | 62 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 63 | [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 64 | 65 | [self af_setUploadProgressAnimated:animated]; 66 | } 67 | 68 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 69 | animated:(BOOL)animated 70 | { 71 | if (task.state == NSURLSessionTaskStateCompleted) { 72 | return; 73 | } 74 | 75 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 76 | [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 77 | 78 | [self af_setDownloadProgressAnimated:animated]; 79 | } 80 | 81 | #pragma mark - NSKeyValueObserving 82 | 83 | - (void)observeValueForKeyPath:(NSString *)keyPath 84 | ofObject:(id)object 85 | change:(__unused NSDictionary *)change 86 | context:(void *)context 87 | { 88 | if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { 89 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { 90 | if ([object countOfBytesExpectedToSend] > 0) { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; 93 | }); 94 | } 95 | } 96 | 97 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { 98 | if ([object countOfBytesExpectedToReceive] > 0) { 99 | dispatch_async(dispatch_get_main_queue(), ^{ 100 | [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; 101 | }); 102 | } 103 | } 104 | 105 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { 106 | if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { 107 | @try { 108 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; 109 | 110 | if (context == AFTaskCountOfBytesSentContext) { 111 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; 112 | } 113 | 114 | if (context == AFTaskCountOfBytesReceivedContext) { 115 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; 116 | } 117 | } 118 | @catch (NSException * __unused exception) {} 119 | } 120 | } 121 | } 122 | } 123 | 124 | @end 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import "UIRefreshControl+AFNetworking.h" 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | @interface AFRefreshControlNotificationObserver : NSObject 31 | @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; 32 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; 33 | 34 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 35 | 36 | @end 37 | 38 | @implementation UIRefreshControl (AFNetworking) 39 | 40 | - (AFRefreshControlNotificationObserver *)af_notificationObserver { 41 | AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 42 | if (notificationObserver == nil) { 43 | notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; 44 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | } 46 | return notificationObserver; 47 | } 48 | 49 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 50 | [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; 51 | } 52 | 53 | @end 54 | 55 | @implementation AFRefreshControlNotificationObserver 56 | 57 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl 58 | { 59 | self = [super init]; 60 | if (self) { 61 | _refreshControl = refreshControl; 62 | } 63 | return self; 64 | } 65 | 66 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 67 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 68 | 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 71 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 72 | 73 | if (task) { 74 | UIRefreshControl *refreshControl = self.refreshControl; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [refreshControl beginRefreshing]; 77 | 78 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 79 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 80 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 81 | } else { 82 | [refreshControl endRefreshing]; 83 | } 84 | } 85 | } 86 | 87 | #pragma mark - 88 | 89 | - (void)af_beginRefreshing { 90 | dispatch_async(dispatch_get_main_queue(), ^{ 91 | [self.refreshControl beginRefreshing]; 92 | }); 93 | } 94 | 95 | - (void)af_endRefreshing { 96 | dispatch_async(dispatch_get_main_queue(), ^{ 97 | [self.refreshControl endRefreshing]; 98 | }); 99 | } 100 | 101 | #pragma mark - 102 | 103 | - (void)dealloc { 104 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 105 | 106 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 109 | } 110 | 111 | @end 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPSessionManager; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 36 | 37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 38 | */ 39 | @interface UIWebView (AFNetworking) 40 | 41 | /** 42 | The session manager used to download all requests. 43 | */ 44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 45 | 46 | /** 47 | Asynchronously loads the specified request. 48 | 49 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 50 | @param progress A progress object monitoring the current download progress. 51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 53 | */ 54 | - (void)loadRequest:(NSURLRequest *)request 55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 57 | failure:(nullable void (^)(NSError *error))failure; 58 | 59 | /** 60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 61 | 62 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 65 | @param progress A progress object monitoring the current download progress. 66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 68 | */ 69 | - (void)loadRequest:(NSURLRequest *)request 70 | MIMEType:(nullable NSString *)MIMEType 71 | textEncodingName:(nullable NSString *)textEncodingName 72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 74 | failure:(nullable void (^)(NSError *error))failure; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.0): 3 | - AFNetworking/NSURLSession (= 3.2.0) 4 | - AFNetworking/Reachability (= 3.2.0) 5 | - AFNetworking/Security (= 3.2.0) 6 | - AFNetworking/Serialization (= 3.2.0) 7 | - AFNetworking/UIKit (= 3.2.0) 8 | - AFNetworking/NSURLSession (3.2.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.0) 13 | - AFNetworking/Security (3.2.0) 14 | - AFNetworking/Serialization (3.2.0) 15 | - AFNetworking/UIKit (3.2.0): 16 | - AFNetworking/NSURLSession 17 | - Masonry (1.1.0) 18 | 19 | DEPENDENCIES: 20 | - AFNetworking (~> 3.2.0) 21 | - Masonry (~> 1.1.0) 22 | 23 | SPEC CHECKSUMS: 24 | AFNetworking: 8ac6017b94ea105479f7776e5288e48ae9c59bb4 25 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 26 | 27 | PODFILE CHECKSUM: a355a5d7563d1d7c1c2a1353a084422d250ea0aa 28 | 29 | COCOAPODS: 1.4.0 30 | -------------------------------------------------------------------------------- /Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 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. -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASCompositeConstraint.h" 10 | #import "MASConstraint+Private.h" 11 | 12 | @interface MASCompositeConstraint () 13 | 14 | @property (nonatomic, strong) id mas_key; 15 | @property (nonatomic, strong) NSMutableArray *childConstraints; 16 | 17 | @end 18 | 19 | @implementation MASCompositeConstraint 20 | 21 | - (id)initWithChildren:(NSArray *)children { 22 | self = [super init]; 23 | if (!self) return nil; 24 | 25 | _childConstraints = [children mutableCopy]; 26 | for (MASConstraint *constraint in _childConstraints) { 27 | constraint.delegate = self; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - MASConstraintDelegate 34 | 35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { 36 | NSUInteger index = [self.childConstraints indexOfObject:constraint]; 37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); 38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; 39 | } 40 | 41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 42 | id strongDelegate = self.delegate; 43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 44 | newConstraint.delegate = self; 45 | [self.childConstraints addObject:newConstraint]; 46 | return newConstraint; 47 | } 48 | 49 | #pragma mark - NSLayoutConstraint multiplier proxies 50 | 51 | - (MASConstraint * (^)(CGFloat))multipliedBy { 52 | return ^id(CGFloat multiplier) { 53 | for (MASConstraint *constraint in self.childConstraints) { 54 | constraint.multipliedBy(multiplier); 55 | } 56 | return self; 57 | }; 58 | } 59 | 60 | - (MASConstraint * (^)(CGFloat))dividedBy { 61 | return ^id(CGFloat divider) { 62 | for (MASConstraint *constraint in self.childConstraints) { 63 | constraint.dividedBy(divider); 64 | } 65 | return self; 66 | }; 67 | } 68 | 69 | #pragma mark - MASLayoutPriority proxy 70 | 71 | - (MASConstraint * (^)(MASLayoutPriority))priority { 72 | return ^id(MASLayoutPriority priority) { 73 | for (MASConstraint *constraint in self.childConstraints) { 74 | constraint.priority(priority); 75 | } 76 | return self; 77 | }; 78 | } 79 | 80 | #pragma mark - NSLayoutRelation proxy 81 | 82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { 83 | return ^id(id attr, NSLayoutRelation relation) { 84 | for (MASConstraint *constraint in self.childConstraints.copy) { 85 | constraint.equalToWithRelation(attr, relation); 86 | } 87 | return self; 88 | }; 89 | } 90 | 91 | #pragma mark - attribute chaining 92 | 93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 95 | return self; 96 | } 97 | 98 | #pragma mark - Animator proxy 99 | 100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 101 | 102 | - (MASConstraint *)animator { 103 | for (MASConstraint *constraint in self.childConstraints) { 104 | [constraint animator]; 105 | } 106 | return self; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark - debug helpers 112 | 113 | - (MASConstraint * (^)(id))key { 114 | return ^id(id key) { 115 | self.mas_key = key; 116 | int i = 0; 117 | for (MASConstraint *constraint in self.childConstraints) { 118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); 119 | } 120 | return self; 121 | }; 122 | } 123 | 124 | #pragma mark - NSLayoutConstraint constant setters 125 | 126 | - (void)setInsets:(MASEdgeInsets)insets { 127 | for (MASConstraint *constraint in self.childConstraints) { 128 | constraint.insets = insets; 129 | } 130 | } 131 | 132 | - (void)setInset:(CGFloat)inset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.inset = inset; 135 | } 136 | } 137 | 138 | - (void)setOffset:(CGFloat)offset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.offset = offset; 141 | } 142 | } 143 | 144 | - (void)setSizeOffset:(CGSize)sizeOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.sizeOffset = sizeOffset; 147 | } 148 | } 149 | 150 | - (void)setCenterOffset:(CGPoint)centerOffset { 151 | for (MASConstraint *constraint in self.childConstraints) { 152 | constraint.centerOffset = centerOffset; 153 | } 154 | } 155 | 156 | #pragma mark - MASConstraint 157 | 158 | - (void)activate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint activate]; 161 | } 162 | } 163 | 164 | - (void)deactivate { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | [constraint deactivate]; 167 | } 168 | } 169 | 170 | - (void)install { 171 | for (MASConstraint *constraint in self.childConstraints) { 172 | constraint.updateExisting = self.updateExisting; 173 | [constraint install]; 174 | } 175 | } 176 | 177 | - (void)uninstall { 178 | for (MASConstraint *constraint in self.childConstraints) { 179 | [constraint uninstall]; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraintMaker.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | typedef NS_OPTIONS(NSInteger, MASAttribute) { 13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft, 14 | MASAttributeRight = 1 << NSLayoutAttributeRight, 15 | MASAttributeTop = 1 << NSLayoutAttributeTop, 16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom, 17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading, 18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, 19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth, 20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight, 21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, 22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, 23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, 24 | 25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 26 | 27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, 28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, 29 | 30 | #endif 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 33 | 34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, 35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, 36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, 37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, 38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, 39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, 40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, 41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, 42 | 43 | #endif 44 | 45 | }; 46 | 47 | /** 48 | * Provides factory methods for creating MASConstraints. 49 | * Constraints are collected until they are ready to be installed 50 | * 51 | */ 52 | @interface MASConstraintMaker : NSObject 53 | 54 | /** 55 | * The following properties return a new MASViewConstraint 56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute 57 | */ 58 | @property (nonatomic, strong, readonly) MASConstraint *left; 59 | @property (nonatomic, strong, readonly) MASConstraint *top; 60 | @property (nonatomic, strong, readonly) MASConstraint *right; 61 | @property (nonatomic, strong, readonly) MASConstraint *bottom; 62 | @property (nonatomic, strong, readonly) MASConstraint *leading; 63 | @property (nonatomic, strong, readonly) MASConstraint *trailing; 64 | @property (nonatomic, strong, readonly) MASConstraint *width; 65 | @property (nonatomic, strong, readonly) MASConstraint *height; 66 | @property (nonatomic, strong, readonly) MASConstraint *centerX; 67 | @property (nonatomic, strong, readonly) MASConstraint *centerY; 68 | @property (nonatomic, strong, readonly) MASConstraint *baseline; 69 | 70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 71 | 72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline; 73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline; 74 | 75 | #endif 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 78 | 79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin; 80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin; 81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin; 82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin; 83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin; 84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin; 85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; 86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; 87 | 88 | #endif 89 | 90 | /** 91 | * Returns a block which creates a new MASCompositeConstraint with the first item set 92 | * to the makers associated view and children corresponding to the set bits in the 93 | * MASAttribute parameter. Combine multiple attributes via binary-or. 94 | */ 95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); 96 | 97 | /** 98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges 99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right) 100 | * with the first item set to the makers associated view 101 | */ 102 | @property (nonatomic, strong, readonly) MASConstraint *edges; 103 | 104 | /** 105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize 106 | * which generates the appropriate MASViewConstraint children (width, height) 107 | * with the first item set to the makers associated view 108 | */ 109 | @property (nonatomic, strong, readonly) MASConstraint *size; 110 | 111 | /** 112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter 113 | * which generates the appropriate MASViewConstraint children (centerX, centerY) 114 | * with the first item set to the makers associated view 115 | */ 116 | @property (nonatomic, strong, readonly) MASConstraint *center; 117 | 118 | /** 119 | * Whether or not to check for an existing constraint instead of adding constraint 120 | */ 121 | @property (nonatomic, assign) BOOL updateExisting; 122 | 123 | /** 124 | * Whether or not to remove existing constraints prior to installing 125 | */ 126 | @property (nonatomic, assign) BOOL removeExisting; 127 | 128 | /** 129 | * initialises the maker with a default view 130 | * 131 | * @param view any MASConstraint are created with this view as the first item 132 | * 133 | * @return a new MASConstraintMaker 134 | */ 135 | - (id)initWithView:(MAS_VIEW *)view; 136 | 137 | /** 138 | * Calls install method on any MASConstraints which have been created by this maker 139 | * 140 | * @return an array of all the installed MASConstraints 141 | */ 142 | - (NSArray *)install; 143 | 144 | - (MASConstraint * (^)(dispatch_block_t))group; 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASUtilities.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 19/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | #if TARGET_OS_IPHONE || TARGET_OS_TV 14 | 15 | #import 16 | #define MAS_VIEW UIView 17 | #define MAS_VIEW_CONTROLLER UIViewController 18 | #define MASEdgeInsets UIEdgeInsets 19 | 20 | typedef UILayoutPriority MASLayoutPriority; 21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; 22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; 23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; 24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; 25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; 26 | 27 | #elif TARGET_OS_MAC 28 | 29 | #import 30 | #define MAS_VIEW NSView 31 | #define MASEdgeInsets NSEdgeInsets 32 | 33 | typedef NSLayoutPriority MASLayoutPriority; 34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; 35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; 36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; 37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; 38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; 39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; 40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; 41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; 42 | 43 | #endif 44 | 45 | /** 46 | * Allows you to attach keys to objects matching the variable names passed. 47 | * 48 | * view1.mas_key = @"view1", view2.mas_key = @"view2"; 49 | * 50 | * is equivalent to: 51 | * 52 | * MASAttachKeys(view1, view2); 53 | */ 54 | #define MASAttachKeys(...) \ 55 | { \ 56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ 57 | for (id key in keyPairs.allKeys) { \ 58 | id obj = keyPairs[key]; \ 59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ 60 | @"Cannot attach mas_key to %@", obj); \ 61 | [obj setMas_key:key]; \ 62 | } \ 63 | } 64 | 65 | /** 66 | * Used to create object hashes 67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html 68 | */ 69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) 70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) 71 | 72 | /** 73 | * Given a scalar or struct value, wraps it in NSValue 74 | * Based on EXPObjectify: https://github.com/specta/expecta 75 | */ 76 | static inline id _MASBoxValue(const char *type, ...) { 77 | va_list v; 78 | va_start(v, type); 79 | id obj = nil; 80 | if (strcmp(type, @encode(id)) == 0) { 81 | id actual = va_arg(v, id); 82 | obj = actual; 83 | } else if (strcmp(type, @encode(CGPoint)) == 0) { 84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint); 85 | obj = [NSValue value:&actual withObjCType:type]; 86 | } else if (strcmp(type, @encode(CGSize)) == 0) { 87 | CGSize actual = (CGSize)va_arg(v, CGSize); 88 | obj = [NSValue value:&actual withObjCType:type]; 89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { 90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); 91 | obj = [NSValue value:&actual withObjCType:type]; 92 | } else if (strcmp(type, @encode(double)) == 0) { 93 | double actual = (double)va_arg(v, double); 94 | obj = [NSNumber numberWithDouble:actual]; 95 | } else if (strcmp(type, @encode(float)) == 0) { 96 | float actual = (float)va_arg(v, double); 97 | obj = [NSNumber numberWithFloat:actual]; 98 | } else if (strcmp(type, @encode(int)) == 0) { 99 | int actual = (int)va_arg(v, int); 100 | obj = [NSNumber numberWithInt:actual]; 101 | } else if (strcmp(type, @encode(long)) == 0) { 102 | long actual = (long)va_arg(v, long); 103 | obj = [NSNumber numberWithLong:actual]; 104 | } else if (strcmp(type, @encode(long long)) == 0) { 105 | long long actual = (long long)va_arg(v, long long); 106 | obj = [NSNumber numberWithLongLong:actual]; 107 | } else if (strcmp(type, @encode(short)) == 0) { 108 | short actual = (short)va_arg(v, int); 109 | obj = [NSNumber numberWithShort:actual]; 110 | } else if (strcmp(type, @encode(char)) == 0) { 111 | char actual = (char)va_arg(v, int); 112 | obj = [NSNumber numberWithChar:actual]; 113 | } else if (strcmp(type, @encode(bool)) == 0) { 114 | bool actual = (bool)va_arg(v, int); 115 | obj = [NSNumber numberWithBool:actual]; 116 | } else if (strcmp(type, @encode(unsigned char)) == 0) { 117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int); 118 | obj = [NSNumber numberWithUnsignedChar:actual]; 119 | } else if (strcmp(type, @encode(unsigned int)) == 0) { 120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int); 121 | obj = [NSNumber numberWithUnsignedInt:actual]; 122 | } else if (strcmp(type, @encode(unsigned long)) == 0) { 123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long); 124 | obj = [NSNumber numberWithUnsignedLong:actual]; 125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) { 126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); 127 | obj = [NSNumber numberWithUnsignedLongLong:actual]; 128 | } else if (strcmp(type, @encode(unsigned short)) == 0) { 129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int); 130 | obj = [NSNumber numberWithUnsignedShort:actual]; 131 | } 132 | va_end(v); 133 | return obj; 134 | } 135 | 136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) 137 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.m 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | #import "View+MASAdditions.h" 11 | 12 | @implementation NSArray (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { 15 | NSMutableArray *constraints = [NSMutableArray array]; 16 | for (MAS_VIEW *view in self) { 17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; 19 | } 20 | return constraints; 21 | } 22 | 23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { 24 | NSMutableArray *constraints = [NSMutableArray array]; 25 | for (MAS_VIEW *view in self) { 26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; 28 | } 29 | return constraints; 30 | } 31 | 32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 33 | NSMutableArray *constraints = [NSMutableArray array]; 34 | for (MAS_VIEW *view in self) { 35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; 37 | } 38 | return constraints; 39 | } 40 | 41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 42 | if (self.count < 2) { 43 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 44 | return; 45 | } 46 | 47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 48 | if (axisType == MASAxisTypeHorizontal) { 49 | MAS_VIEW *prev; 50 | for (int i = 0; i < self.count; i++) { 51 | MAS_VIEW *v = self[i]; 52 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 53 | if (prev) { 54 | make.width.equalTo(prev); 55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing); 56 | if (i == self.count - 1) {//last one 57 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 58 | } 59 | } 60 | else {//first one 61 | make.left.equalTo(tempSuperView).offset(leadSpacing); 62 | } 63 | 64 | }]; 65 | prev = v; 66 | } 67 | } 68 | else { 69 | MAS_VIEW *prev; 70 | for (int i = 0; i < self.count; i++) { 71 | MAS_VIEW *v = self[i]; 72 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 73 | if (prev) { 74 | make.height.equalTo(prev); 75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); 76 | if (i == self.count - 1) {//last one 77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 78 | } 79 | } 80 | else {//first one 81 | make.top.equalTo(tempSuperView).offset(leadSpacing); 82 | } 83 | 84 | }]; 85 | prev = v; 86 | } 87 | } 88 | } 89 | 90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 91 | if (self.count < 2) { 92 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 93 | return; 94 | } 95 | 96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 97 | if (axisType == MASAxisTypeHorizontal) { 98 | MAS_VIEW *prev; 99 | for (int i = 0; i < self.count; i++) { 100 | MAS_VIEW *v = self[i]; 101 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 102 | make.width.equalTo(@(fixedItemLength)); 103 | if (prev) { 104 | if (i == self.count - 1) {//last one 105 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 106 | } 107 | else { 108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 110 | } 111 | } 112 | else {//first one 113 | make.left.equalTo(tempSuperView).offset(leadSpacing); 114 | } 115 | }]; 116 | prev = v; 117 | } 118 | } 119 | else { 120 | MAS_VIEW *prev; 121 | for (int i = 0; i < self.count; i++) { 122 | MAS_VIEW *v = self[i]; 123 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 124 | make.height.equalTo(@(fixedItemLength)); 125 | if (prev) { 126 | if (i == self.count - 1) {//last one 127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 128 | } 129 | else { 130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 132 | } 133 | } 134 | else {//first one 135 | make.top.equalTo(tempSuperView).offset(leadSpacing); 136 | } 137 | }]; 138 | prev = v; 139 | } 140 | } 141 | } 142 | 143 | - (MAS_VIEW *)mas_commonSuperviewOfViews 144 | { 145 | MAS_VIEW *commonSuperview = nil; 146 | MAS_VIEW *previousView = nil; 147 | for (id object in self) { 148 | if ([object isKindOfClass:[MAS_VIEW class]]) { 149 | MAS_VIEW *view = (MAS_VIEW *)object; 150 | if (previousView) { 151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; 152 | } else { 153 | commonSuperview = view; 154 | } 155 | previousView = view; 156 | } 157 | } 158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); 159 | return commonSuperview; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSLayoutConstraint+MASDebugAdditions.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | 13 | @implementation NSLayoutConstraint (MASDebugAdditions) 14 | 15 | #pragma mark - description maps 16 | 17 | + (NSDictionary *)layoutRelationDescriptionsByValue { 18 | static dispatch_once_t once; 19 | static NSDictionary *descriptionMap; 20 | dispatch_once(&once, ^{ 21 | descriptionMap = @{ 22 | @(NSLayoutRelationEqual) : @"==", 23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=", 24 | @(NSLayoutRelationLessThanOrEqual) : @"<=", 25 | }; 26 | }); 27 | return descriptionMap; 28 | } 29 | 30 | + (NSDictionary *)layoutAttributeDescriptionsByValue { 31 | static dispatch_once_t once; 32 | static NSDictionary *descriptionMap; 33 | dispatch_once(&once, ^{ 34 | descriptionMap = @{ 35 | @(NSLayoutAttributeTop) : @"top", 36 | @(NSLayoutAttributeLeft) : @"left", 37 | @(NSLayoutAttributeBottom) : @"bottom", 38 | @(NSLayoutAttributeRight) : @"right", 39 | @(NSLayoutAttributeLeading) : @"leading", 40 | @(NSLayoutAttributeTrailing) : @"trailing", 41 | @(NSLayoutAttributeWidth) : @"width", 42 | @(NSLayoutAttributeHeight) : @"height", 43 | @(NSLayoutAttributeCenterX) : @"centerX", 44 | @(NSLayoutAttributeCenterY) : @"centerY", 45 | @(NSLayoutAttributeBaseline) : @"baseline", 46 | 47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", 49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline", 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin", 54 | @(NSLayoutAttributeRightMargin) : @"rightMargin", 55 | @(NSLayoutAttributeTopMargin) : @"topMargin", 56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin", 57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", 58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", 59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", 60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", 61 | #endif 62 | 63 | }; 64 | 65 | }); 66 | return descriptionMap; 67 | } 68 | 69 | 70 | + (NSDictionary *)layoutPriorityDescriptionsByValue { 71 | static dispatch_once_t once; 72 | static NSDictionary *descriptionMap; 73 | dispatch_once(&once, ^{ 74 | #if TARGET_OS_IPHONE || TARGET_OS_TV 75 | descriptionMap = @{ 76 | @(MASLayoutPriorityDefaultHigh) : @"high", 77 | @(MASLayoutPriorityDefaultLow) : @"low", 78 | @(MASLayoutPriorityDefaultMedium) : @"medium", 79 | @(MASLayoutPriorityRequired) : @"required", 80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", 81 | }; 82 | #elif TARGET_OS_MAC 83 | descriptionMap = @{ 84 | @(MASLayoutPriorityDefaultHigh) : @"high", 85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", 86 | @(MASLayoutPriorityDefaultMedium) : @"medium", 87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", 88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", 89 | @(MASLayoutPriorityDefaultLow) : @"low", 90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", 91 | @(MASLayoutPriorityRequired) : @"required", 92 | }; 93 | #endif 94 | }); 95 | return descriptionMap; 96 | } 97 | 98 | #pragma mark - description override 99 | 100 | + (NSString *)descriptionForObject:(id)obj { 101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { 102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; 103 | } 104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; 105 | } 106 | 107 | - (NSString *)description { 108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; 109 | 110 | [description appendString:[self.class descriptionForObject:self]]; 111 | 112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; 113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { 114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; 115 | } 116 | 117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; 118 | 119 | if (self.secondItem) { 120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; 121 | } 122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { 123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; 124 | } 125 | 126 | if (self.multiplier != 1) { 127 | [description appendFormat:@" * %g", self.multiplier]; 128 | } 129 | 130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { 131 | [description appendFormat:@" %g", self.constant]; 132 | } else { 133 | if (self.constant) { 134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; 135 | } 136 | } 137 | 138 | if (self.priority != MASLayoutPriorityRequired) { 139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; 140 | } 141 | 142 | [description appendString:@">"]; 143 | return description; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 56 | 57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 62 | 63 | #endif 64 | 65 | /** 66 | * a key to associate with this view 67 | */ 68 | @property (nonatomic, strong) id mas_key; 69 | 70 | /** 71 | * Finds the closest common superview between this view and another view 72 | * 73 | * @param view other view 74 | * 75 | * @return returns nil if common superview could not be found 76 | */ 77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 82 | * 83 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 84 | * 85 | * @return Array of created MASConstraints 86 | */ 87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 88 | 89 | /** 90 | * Creates a MASConstraintMaker with the callee view. 91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 92 | * If an existing constraint exists then it will be updated instead. 93 | * 94 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 95 | * 96 | * @return Array of created/updated MASConstraints 97 | */ 98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 99 | 100 | /** 101 | * Creates a MASConstraintMaker with the callee view. 102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 103 | * All constraints previously installed for the view will be removed. 104 | * 105 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 106 | * 107 | * @return Array of created/updated MASConstraints 108 | */ 109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 53 | 54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | 59 | #endif 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 64 | 65 | @end 66 | 67 | #define MAS_ATTR_FORWARD(attr) \ 68 | - (MASViewAttribute *)attr { \ 69 | return [self mas_##attr]; \ 70 | } 71 | 72 | @implementation MAS_VIEW (MASShorthandAdditions) 73 | 74 | MAS_ATTR_FORWARD(top); 75 | MAS_ATTR_FORWARD(left); 76 | MAS_ATTR_FORWARD(bottom); 77 | MAS_ATTR_FORWARD(right); 78 | MAS_ATTR_FORWARD(leading); 79 | MAS_ATTR_FORWARD(trailing); 80 | MAS_ATTR_FORWARD(width); 81 | MAS_ATTR_FORWARD(height); 82 | MAS_ATTR_FORWARD(centerX); 83 | MAS_ATTR_FORWARD(centerY); 84 | MAS_ATTR_FORWARD(baseline); 85 | 86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 87 | 88 | MAS_ATTR_FORWARD(firstBaseline); 89 | MAS_ATTR_FORWARD(lastBaseline); 90 | 91 | #endif 92 | 93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 94 | 95 | MAS_ATTR_FORWARD(leftMargin); 96 | MAS_ATTR_FORWARD(rightMargin); 97 | MAS_ATTR_FORWARD(topMargin); 98 | MAS_ATTR_FORWARD(bottomMargin); 99 | MAS_ATTR_FORWARD(leadingMargin); 100 | MAS_ATTR_FORWARD(trailingMargin); 101 | MAS_ATTR_FORWARD(centerXWithinMargins); 102 | MAS_ATTR_FORWARD(centerYWithinMargins); 103 | 104 | #endif 105 | 106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 107 | 108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); 109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); 110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); 111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); 112 | 113 | #endif 114 | 115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 116 | return [self mas_attribute]; 117 | } 118 | 119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 120 | return [self mas_makeConstraints:block]; 121 | } 122 | 123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 124 | return [self mas_updateConstraints:block]; 125 | } 126 | 127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 128 | return [self mas_remakeConstraints:block]; 129 | } 130 | 131 | @end 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Target Support Files/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/Pods/Target Support Files/.DS_Store -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## Masonry 28 | 29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 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 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all 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 | Generated by CocoaPods - https://cocoapods.org 49 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo-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-2016 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 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | License 66 | MIT 67 | Title 68 | Masonry 69 | Type 70 | PSGroupSpecifier 71 | 72 | 73 | FooterText 74 | Generated by CocoaPods - https://cocoapods.org 75 | Title 76 | 77 | Type 78 | PSGroupSpecifier 79 | 80 | 81 | StringsTable 82 | Acknowledgements 83 | Title 84 | Acknowledgements 85 | 86 | 87 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_YWLogisticsQueryDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_YWLogisticsQueryDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 71 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 85 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 86 | else 87 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 136 | wait 137 | fi 138 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_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 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo.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/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-YWLogisticsQueryDemo/Pods-YWLogisticsQueryDemo.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/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Pod](https://img.shields.io/badge/Pod-1.0.6-orange.svg)](https://github.com/90candy/YWLogisticsQuery) 2 | [![Platform](https://img.shields.io/badge/Platform-iOS-ff69b4.svg)](https://github.com/90candy) 3 | [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/90candy) 4 | [![Author](https://img.shields.io/badge/Author-阿唯不知道-blue.svg)](https://www.jianshu.com/u/0f7d26d766f4) 5 | 6 | ### 推荐使用`Cocoapod`导入,具体使用请直接查看示例Demo 7 | 8 | ``` 9 | pod 'YWLogisticsQuery', '~> 1.0.6' 10 | ``` 11 | 12 | ### ************** 效果图展示 ************** 13 | ![效果图](./效果图.png) 14 | 15 | ### 这里使用的是快递100 16 | 17 | **快递100API帮助文档:https://www.kuaidi100.com/openapi/api_post.shtml** 18 | 19 | **所支持的快递公司及参数说明:https://www.kuaidi100.com/download/api_kuaidi100_com(20140729).doc** 20 | 21 | 22 | 查询测试:https://m.kuaidi100.com/query?type=shentong&postid=3345541356152 23 | 24 | ### JSON格式 25 | ``` 26 | { 27 | "message": "ok", 28 | "nu": "3345541356152", 29 | "ischeck": "1", 30 | "condition": "F00", 31 | "com": "shentong", 32 | "status": "200", 33 | "state": "3", 34 | "data": [{ 35 | "time": "2017-11-27 21:04:12", 36 | "ftime": "2017-11-27 21:04:12", 37 | "context": "湛江市 网点代签-已签收,感谢您选择申通快递,期待再次为您服务。", 38 | "location": "" 39 | }, { 40 | "time": "2017-11-27 14:05:09", 41 | "ftime": "2017-11-27 14:05:09", 42 | "context": "湛江市 广东湛江硇洲镇分部-硇洲镇存放点自取(15876396468)-派件中", 43 | "location": "" 44 | }, { 45 | "time": "2017-11-27 13:51:05", 46 | "ftime": "2017-11-27 13:51:05", 47 | "context": "湛江市 已到达-广东湛江硇洲镇分部", 48 | "location": "" 49 | }, { 50 | "time": "2017-11-26 10:10:34", 51 | "ftime": "2017-11-26 10:10:34", 52 | "context": "湛江市 广东湛江转运中心-已发往-广东湛江硇洲镇分部", 53 | "location": "" 54 | }, { 55 | "time": "2017-11-26 10:04:17", 56 | "ftime": "2017-11-26 10:04:17", 57 | "context": "湛江市 已到达-广东湛江转运中心", 58 | "location": "" 59 | }, { 60 | "time": "2017-11-25 08:03:00", 61 | "ftime": "2017-11-25 08:03:00", 62 | "context": "中山市 广东中山转运中心-已发往-广东湛江转运中心", 63 | "location": "" 64 | }, { 65 | "time": "2017-11-23 23:01:48", 66 | "ftime": "2017-11-23 23:01:48", 67 | "context": "石家庄市 河北石家庄航空部-已发往-广东中山中转部", 68 | "location": "" 69 | }, { 70 | "time": "2017-11-23 21:58:42", 71 | "ftime": "2017-11-23 21:58:42", 72 | "context": "石家庄市 河北石家庄公司-已发往-河北石家庄航空部", 73 | "location": "" 74 | }, { 75 | "time": "2017-11-23 18:04:23", 76 | "ftime": "2017-11-23 18:04:23", 77 | "context": "石家庄市 河北石家庄平安营业部(0311-85867000)-王超泽(18803012047)-已收件", 78 | "location": "" 79 | }] 80 | } 81 | ``` -------------------------------------------------------------------------------- /YWLogisticsQuery.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "YWLogisticsQuery" 4 | s.version = "1.0.6" 5 | s.summary = "物流查询:传入物流单号、对应物流公司、以及对应物流公司编码" 6 | s.description = <<-DESC 7 | 物流查询/快递查询:传入快递单号、对应物流公司、以及对应物流公司编码即可 8 | DESC 9 | s.homepage = "https://github.com/90candy/YWLogisticsQuery" 10 | s.license = { :type => "MIT", :file => "LICENSE" } 11 | s.author = { "90Candy" => "90candy.com@gmail.com" } 12 | s.social_media_url = "https://www.jianshu.com/u/0f7d26d766f4" 13 | s.platform = :ios, "9.0" 14 | s.source = { :git => "https://github.com/90candy/YWLogisticsQuery.git", :tag => s.version } 15 | s.source_files = "YWLogisticsQuery/**/*.{h,m}" 16 | s.resources = "YWLogisticsQuery/Resources/*.png" 17 | s.requires_arc = true 18 | s.dependency "Masonry", "~> 1.1.0" 19 | end 20 | 21 | # 验证:pod spec lint YWLogisticsQuery.podspec --allow-warnings --verbose 22 | # 发布:pod trunk push YWLogisticsQuery.podspec --allow-warnings --verbose 23 | -------------------------------------------------------------------------------- /YWLogisticsQuery/Resources/icon_placeholder_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/YWLogisticsQuery/Resources/icon_placeholder_image.png -------------------------------------------------------------------------------- /YWLogisticsQuery/YWConfigFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWConfigFile.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #ifndef YWConfigFile_h 10 | #define YWConfigFile_h 11 | 12 | #define YWScreenWidth ([UIScreen mainScreen].bounds.size.width) 13 | #define YWScreenHeight ([UIScreen mainScreen].bounds.size.height) 14 | 15 | //宏定义weak 16 | #define WeakSelf __weak typeof(self) weakSelf = self 17 | 18 | //R G B 颜色 19 | #define YWRGBColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] 20 | 21 | //R G B A 颜色 22 | #define YWRGBAColor(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)] 23 | 24 | #define PLACEHOlDER_IMAGE [UIImage imageNamed:@"icon_placeholder_image"] 25 | 26 | static CGFloat Gap = 10; 27 | static CGFloat YW_leftSpace = 50.0; 28 | static CGFloat YW_rightSpace = 10.0; 29 | 30 | //#import "SDWebImage/UIImageView+WebCache.h" 31 | #import "Masonry/Masonry.h" 32 | 33 | #endif /* YWConfigFile_h */ 34 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWImageCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWImageCache.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/3/5. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef void(^YWImageBlock)(UIImage *image); 13 | 14 | @interface YWImageCache : NSObject 15 | 16 | @property (nonatomic, copy) NSString * imageUrl; 17 | @property (nonatomic, copy) YWImageBlock imageBlock; 18 | 19 | //开始下载图像 20 | - (void)startCacheImage:(NSString *)imageUrl; 21 | 22 | //从本地加载图像 23 | - (UIImage *)loadLocalImage:(NSString *)imageUrl; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWImageCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWImageCache.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/3/5. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import "YWImageCache.h" 10 | #import "YWConfigFile.h" 11 | @implementation YWImageCache 12 | 13 | - (void)dealloc { 14 | 15 | self.imageUrl = nil; 16 | } 17 | 18 | #pragma mark - 异步加载 19 | - (void)startCacheImage:(NSString *)imageUrl 20 | { 21 | WeakSelf; 22 | self.imageUrl = imageUrl; 23 | 24 | // 先判断本地沙盒是否已经存在图像,存在直接获取,不存在再下载,下载后保存 25 | // 存在沙盒的Caches的子文件夹CacheImages中 26 | __block UIImage * image = [self loadLocalImage:imageUrl]; 27 | 28 | if (image == nil) { 29 | // 沙盒中没有,下载 30 | // 异步下载,分配在程序进程缺省产生的并发队列 31 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 32 | 33 | // 多线程中下载图像--->方便简洁写法 34 | NSData * imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl]]; 35 | 36 | // 缓存图片 37 | [imageData writeToFile:[self imageFilePath:imageUrl] atomically:YES]; 38 | image = [UIImage imageWithData:imageData]; 39 | // 利用blcok,将image对象回调 40 | if (weakSelf.imageBlock) { 41 | weakSelf.imageBlock(image); 42 | } 43 | }); 44 | } else { 45 | if (_imageBlock) { 46 | _imageBlock(image); 47 | } 48 | } 49 | 50 | } 51 | 52 | 53 | #pragma mark - 加载本地图像 54 | - (UIImage *)loadLocalImage:(NSString *)imageUrl 55 | { 56 | 57 | self.imageUrl = imageUrl; 58 | 59 | // 获取图像路径 60 | NSString * filePath = [self imageFilePath:self.imageUrl]; 61 | 62 | UIImage * image = [UIImage imageWithContentsOfFile:filePath]; 63 | 64 | if (image != nil) { 65 | return image; 66 | } 67 | 68 | return nil; 69 | 70 | } 71 | 72 | #pragma mark - 获取图像路径 73 | - (NSString *)imageFilePath:(NSString *)imageUrl 74 | { 75 | // 获取caches文件夹路径 76 | NSString * cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]; 77 | NSLog(@"cachesPath = %@", cachesPath); 78 | // 创建CacheImages文件夹 79 | NSString * CacheImagesPath = [cachesPath stringByAppendingPathComponent:@"CacheImages"]; 80 | NSFileManager * fileManager = [NSFileManager defaultManager]; 81 | if (![fileManager fileExistsAtPath:CacheImagesPath]) { 82 | 83 | [fileManager createDirectoryAtPath:CacheImagesPath withIntermediateDirectories:YES attributes:nil error:nil]; 84 | } 85 | 86 | #pragma mark 拼接图像文件在沙盒中的路径,因为图像URL有"/",要在存入前替换掉,随意用"_"代替 87 | NSString * imageName = [imageUrl stringByReplacingOccurrencesOfString:@"/" withString:@"_"]; 88 | NSString * imageFilePath = [CacheImagesPath stringByAppendingPathComponent:imageName]; 89 | 90 | return imageFilePath; 91 | } 92 | 93 | @end 94 | 95 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticCell.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YWLogisticCellModel.h" 11 | 12 | @interface YWLogisticCell : UITableViewCell 13 | 14 | @property (assign, nonatomic) BOOL hasUpLine; 15 | @property (assign, nonatomic) BOOL hasDownLine; 16 | @property (assign, nonatomic) BOOL currented; 17 | 18 | - (void)reloadDataWithModel:(YWLogisticCellModel *)model; 19 | @end 20 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticCell.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "YWLogisticCell.h" 10 | #import "YWConfigFile.h" 11 | #import "YWTableCellContentView.h" 12 | 13 | @interface YWLogisticCell () 14 | 15 | @property (strong, nonatomic)YWTableCellContentView *customView; 16 | @end 17 | @implementation YWLogisticCell 18 | 19 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 20 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 21 | if (self) { 22 | 23 | self.selectionStyle = UITableViewCellSelectionStyleNone; 24 | 25 | [self setupUI]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (void)reloadDataWithModel:(YWLogisticCellModel *)model { 32 | 33 | [self.customView reloadDataWithModel:model]; 34 | } 35 | 36 | - (void)setHasUpLine:(BOOL)hasUpLine { 37 | 38 | self.customView.hasUpLine = hasUpLine; 39 | } 40 | 41 | - (void)setHasDownLine:(BOOL)hasDownLine { 42 | 43 | self.customView.hasDownLine = hasDownLine; 44 | } 45 | 46 | - (void)setCurrented:(BOOL)currented { 47 | 48 | self.customView.currented = currented; 49 | } 50 | 51 | - (void)setupUI { 52 | 53 | YWTableCellContentView *custom = [[YWTableCellContentView alloc]init]; 54 | [self addSubview:custom]; 55 | self.customView = custom; 56 | 57 | custom.currented = NO; 58 | custom.hasUpLine = YES; 59 | custom.hasDownLine = YES; 60 | [custom mas_makeConstraints:^(MASConstraintMaker *make) { 61 | make.edges.mas_equalTo(self); 62 | }]; 63 | } 64 | 65 | - (void)awakeFromNib { 66 | [super awakeFromNib]; 67 | // Initialization code 68 | } 69 | 70 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 71 | [super setSelected:selected animated:animated]; 72 | 73 | // Configure the view for the selected state 74 | } 75 | 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticCellModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticCellModel.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface YWLogisticCellModel : NSObject 13 | @property (copy, nonatomic) NSString *dsc; 14 | @property (copy, nonatomic) NSString *date; 15 | @property (assign, nonatomic, readonly)CGFloat height; 16 | @end 17 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticCellModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticCellModel.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "YWLogisticCellModel.h" 10 | #import "YWConfigFile.h" 11 | 12 | @interface YWLogisticCellModel () 13 | 14 | @property (assign, nonatomic)CGFloat tempHeight; 15 | @end 16 | 17 | @implementation YWLogisticCellModel 18 | 19 | - (CGFloat)height { 20 | 21 | if (_tempHeight == 0) { 22 | 23 | NSDictionary * dict = [NSDictionary dictionaryWithObject: [UIFont systemFontOfSize:12] forKey:NSFontAttributeName]; 24 | 25 | CGRect rect = [self.dsc boundingRectWithSize:CGSizeMake(YWScreenWidth - YW_leftSpace - 2*YW_rightSpace, CGFLOAT_MAX) options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil]; 26 | 27 | _tempHeight = rect.size.height + 50;; 28 | } 29 | 30 | return _tempHeight; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticModel.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/27. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YWLogisticModel : NSObject 12 | 13 | @property (copy, nonatomic) NSString *logisticCode; // 物流编码(快递码,用于辨别对应的快递公司,如:shentong) 14 | @property (copy, nonatomic) NSString *logisticNumber; // 物流单号(快递单号) 15 | @property (copy, nonatomic) NSString *logisticCompany; // 物流公司名称 16 | @property (copy, nonatomic) NSString *goodsPicUrlStr; // 物流公司Logo(也可传入对应商品图片)完整链接 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticModel.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/27. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import "YWLogisticModel.h" 10 | 11 | @implementation YWLogisticModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticsView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticsView.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YWConfigFile.h" 11 | #import "YWTableHeaderView.h" 12 | #import "YWLogisticModel.h" 13 | #import "YWLogisticCellModel.h" 14 | 15 | @interface YWLogisticsView : UIView 16 | 17 | @property (nonatomic, strong) NSArray * dataSource; 18 | 19 | @property (nonatomic, strong) YWLogisticModel * logisticModel; 20 | 21 | - (instancetype)initWithDataSource:(NSArray*)array; 22 | - (void)reloadDataWithDataSource:(NSArray *)array; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWLogisticsView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWLogisticsView.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "YWLogisticsView.h" 10 | #import "YWLogisticCell.h" 11 | 12 | #import "YWImageCache.h" 13 | 14 | @interface YWLogisticsView () 15 | 16 | @property (strong, nonatomic)NSMutableArray *dataArray; 17 | @property (strong, nonatomic)UITableView *table; 18 | 19 | @end 20 | 21 | @implementation YWLogisticsView 22 | - (instancetype)initWithFrame:(CGRect)frame { 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | 26 | [self setupUI]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (instancetype)init { 33 | self = [super init]; 34 | if (self) { 35 | [self setupUI]; 36 | } 37 | return self; 38 | } 39 | 40 | - (instancetype)initWithDataSource:(NSArray*)array { 41 | self = [super init]; 42 | if (self) { 43 | [self.dataArray addObjectsFromArray:array]; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)setDataSource:(NSArray *)dataSource { 49 | if (_dataSource == dataSource) { 50 | _dataSource = dataSource; 51 | } 52 | [self.table reloadData]; 53 | } 54 | 55 | - (void)setLogisticModel:(YWLogisticModel *)logisticModel { 56 | _logisticModel = logisticModel; 57 | YWTableHeaderView *header = [[YWTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, YWScreenWidth, 90)];; 58 | header.type.text = @"运输中"; 59 | YWLogisticCellModel *model = self.dataArray.firstObject; 60 | if ([model.dsc containsString:@"已签收"]) { 61 | NSLog(@"快递信息中 包含 已签收 字样"); 62 | header.type.text = @"已签收"; 63 | } 64 | header.number = _logisticModel.logisticNumber; 65 | header.company = _logisticModel.logisticCompany; 66 | 67 | // [header.goodsPic sd_setImageWithURL:[NSURL URLWithString:_logisticModel.goodsPicUrlStr] placeholderImage:PLACEHOlDER_IMAGE]; 68 | YWImageCache *imageCache = [[YWImageCache alloc] init]; 69 | imageCache.imageBlock = ^(UIImage *image) { 70 | if (!image) { 71 | header.goodsPic.image = PLACEHOlDER_IMAGE; 72 | } else { 73 | header.goodsPic.image = image; 74 | } 75 | }; 76 | [imageCache startCacheImage:_logisticModel.goodsPicUrlStr]; 77 | 78 | self.table.tableHeaderView = header; 79 | } 80 | 81 | - (void)reloadDataWithDataSource:(NSArray *)array { 82 | 83 | [self.dataArray addObjectsFromArray:array]; 84 | [self.table reloadData]; 85 | } 86 | - (NSMutableArray *)dataArray { 87 | if (_dataArray == nil) { 88 | _dataArray = [NSMutableArray array]; 89 | } 90 | 91 | return _dataArray; 92 | } 93 | 94 | - (void)setupUI { 95 | UITableView *table = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 96 | table.delegate = self; 97 | table.dataSource = self; 98 | table.separatorStyle = UITableViewCellSeparatorStyleNone; 99 | table.contentInset = UIEdgeInsetsMake(0, 0, 20, 0); 100 | [table setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]]; 101 | [self addSubview:table]; 102 | self.table = table; 103 | [table mas_makeConstraints:^(MASConstraintMaker *make) { 104 | make.edges.mas_equalTo(self); 105 | }]; 106 | } 107 | 108 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 109 | 110 | return self.dataArray.count; 111 | } 112 | 113 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 114 | 115 | YWLogisticCell *cell = [tableView dequeueReusableCellWithIdentifier:@"logisticsCellIdentifier"]; 116 | if (cell == nil) { 117 | 118 | cell = [[YWLogisticCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"logisticsCellIdentifier"]; 119 | } 120 | 121 | if (indexPath.row == 0) { 122 | cell.hasUpLine = NO; 123 | cell.currented = YES; 124 | } else { 125 | cell.hasUpLine = YES; 126 | cell.currented = NO; 127 | } 128 | 129 | if (indexPath.row == self.dataArray.count - 1) { 130 | cell.hasDownLine = NO; 131 | } else { 132 | cell.hasDownLine = YES; 133 | } 134 | 135 | YWLogisticCellModel *model = [self.dataArray objectAtIndex:indexPath.row]; 136 | 137 | [cell reloadDataWithModel:model]; 138 | return cell; 139 | } 140 | 141 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 142 | 143 | YWLogisticCellModel *model = [self.dataArray objectAtIndex:indexPath.row]; 144 | 145 | return model.height; 146 | } 147 | 148 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 149 | return 90; 150 | } 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWTableCellContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWTableCellContentView.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class YWLogisticCellModel; 12 | @interface YWTableCellContentView : UIView 13 | 14 | @property (assign, nonatomic) BOOL hasUpLine; 15 | @property (assign, nonatomic) BOOL hasDownLine; 16 | @property (assign, nonatomic) BOOL currented; 17 | 18 | - (void)reloadDataWithModel:(YWLogisticCellModel*)model; 19 | @end 20 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWTableCellContentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWTableCellContentView.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "YWTableCellContentView.h" 10 | #import "YWConfigFile.h" 11 | #import "YWLogisticCellModel.h" 12 | 13 | @interface YWTableCellContentView () 14 | 15 | @property (strong, nonatomic)UILabel *infoLabel; 16 | @property (strong, nonatomic)UILabel *dateLabel; 17 | @end 18 | @implementation YWTableCellContentView 19 | 20 | - (instancetype)init { 21 | self = [super init]; 22 | if (self) { 23 | 24 | [self setupUI]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)reloadDataWithModel:(YWLogisticCellModel*)model { 31 | 32 | self.infoLabel.text = model.dsc; 33 | self.dateLabel.text = model.date; 34 | 35 | [self setNeedsDisplay]; 36 | } 37 | 38 | - (void)setCurrentTextColor:(UIColor *)currentTextColor { 39 | 40 | self.infoLabel.textColor = currentTextColor; 41 | } 42 | 43 | - (void)setTextColor:(UIColor *)textColor { 44 | 45 | self.infoLabel.textColor = textColor; 46 | } 47 | 48 | - (void)setCurrented:(BOOL)currented { 49 | 50 | _currented = currented; 51 | if (currented) { 52 | self.infoLabel.textColor = YWRGBColor(33, 167, 230); 53 | self.dateLabel.textColor = YWRGBColor(33, 167, 230); 54 | } else { 55 | self.infoLabel.textColor = YWRGBColor(139, 139, 139); 56 | self.dateLabel.textColor = YWRGBColor(139, 139, 139); 57 | } 58 | } 59 | 60 | - (void)setupUI { 61 | 62 | self.backgroundColor = [UIColor whiteColor]; 63 | 64 | UILabel *info= [[UILabel alloc]init]; 65 | info.text = @"[北京顺义区顺义机场公司]派件人:xxx 派件中 派件员电话12345666777"; 66 | info.font = [UIFont systemFontOfSize:12]; 67 | info.numberOfLines = 0; 68 | if (self.currented) { 69 | info.textColor = YWRGBColor(0, 0, 0); 70 | } else { 71 | info.textColor = YWRGBColor(139, 139, 139); 72 | } 73 | 74 | [self addSubview:info]; 75 | _infoLabel = info; 76 | 77 | UILabel *date = [[UILabel alloc]init]; 78 | date.text = @"2016-07-13 04:30"; 79 | date.font = [UIFont systemFontOfSize:12]; 80 | date.textColor = YWRGBColor(185, 185, 185); 81 | [self addSubview:date]; 82 | _dateLabel = date; 83 | 84 | UILabel *line = [[UILabel alloc]init]; 85 | line.backgroundColor = YWRGBColor(238, 238, 238); 86 | [self addSubview:line]; 87 | 88 | 89 | [info mas_makeConstraints:^(MASConstraintMaker *make) { 90 | make.top.mas_equalTo(self).offset(10); 91 | make.left.mas_equalTo(self).offset(YW_leftSpace); 92 | make.right.mas_equalTo(self).offset(-YW_rightSpace); 93 | make.bottom.mas_equalTo(date.mas_top).offset(-4); 94 | }]; 95 | 96 | [date mas_makeConstraints:^(MASConstraintMaker *make) { 97 | make.left.mas_equalTo(info); 98 | make.bottom.mas_equalTo(self).offset(-10); 99 | make.right.mas_equalTo(info); 100 | make.top.mas_equalTo(info.mas_bottom).offset(4); 101 | make.height.mas_equalTo(@20); 102 | }]; 103 | 104 | [line mas_makeConstraints:^(MASConstraintMaker *make) { 105 | make.left.mas_equalTo(self).offset(YW_leftSpace); 106 | make.right.mas_equalTo(self); 107 | make.bottom.mas_equalTo(self); 108 | make.height.mas_equalTo(@1); 109 | }]; 110 | 111 | } 112 | 113 | // Only override drawRect: if you perform custom drawing. 114 | // An empty implementation adversely affects performance during animation. 115 | - (void)drawRect:(CGRect)rect { 116 | // Drawing code 117 | 118 | CGFloat height = self.bounds.size.height; 119 | CGFloat cicleWith = self.currented?12:6; 120 | // CGFloat shadowWith = cicleWith/3.0; 121 | 122 | if (self.hasUpLine) { 123 | 124 | UIBezierPath *topBezier = [UIBezierPath bezierPath]; 125 | [topBezier moveToPoint:CGPointMake(YW_leftSpace/2.0, 0)]; 126 | [topBezier addLineToPoint:CGPointMake(YW_leftSpace/2.0, height/2.0 - cicleWith/2.0 - cicleWith/6.0)]; 127 | 128 | topBezier.lineWidth = 1.0; 129 | UIColor *stroke = YWRGBColor(185, 185, 185); 130 | [stroke set]; 131 | [topBezier stroke]; 132 | } 133 | 134 | if (self.currented) { 135 | 136 | UIBezierPath *cicle = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(YW_leftSpace/2.0 - cicleWith/2.0, height/2.0 - cicleWith/2.0, cicleWith, cicleWith)]; 137 | 138 | cicle.lineWidth = cicleWith/3.0; 139 | UIColor *cColor = YWRGBAColor(33, 167, 230, 1.0); 140 | [cColor set]; 141 | [cicle fill]; 142 | 143 | UIColor *shadowColor = YWRGBAColor(33, 167, 230, 0.5); 144 | [shadowColor set]; 145 | 146 | 147 | [cicle stroke]; 148 | } else { 149 | 150 | UIBezierPath *cicle = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(YW_leftSpace/2.0-cicleWith/2.0, height/2.0 - cicleWith/2.0, cicleWith, cicleWith)]; 151 | 152 | UIColor *cColor = YWRGBColor(185, 185, 185); 153 | [cColor set]; 154 | [cicle fill]; 155 | 156 | [cicle stroke]; 157 | } 158 | 159 | if (self.hasDownLine) { 160 | 161 | UIBezierPath *downBezier = [UIBezierPath bezierPath]; 162 | [downBezier moveToPoint:CGPointMake(YW_leftSpace/2.0, height/2.0 + cicleWith/2.0 + cicleWith/6.0)]; 163 | [downBezier addLineToPoint:CGPointMake(YW_leftSpace/2.0, height)]; 164 | 165 | downBezier.lineWidth = 1.0; 166 | UIColor *stroke = YWRGBColor(185, 185, 185); 167 | [stroke set]; 168 | [downBezier stroke]; 169 | } 170 | } 171 | @end 172 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWTableHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // YWTableHeaderView.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YWTableHeaderView : UIView 12 | @property (nonatomic,strong) UIImageView *goodsPic; //商品图片(也可传入物对应流公司logo图片) 13 | @property (nonatomic,strong) UILabel *type; // 14 | @property (strong, nonatomic) UILabel *numLabel; 15 | @property (strong, nonatomic) UILabel *comLabel; 16 | @property (strong, nonatomic) UILabel *phoneLabel; 17 | @property (nonatomic,strong) UIImageView *psHeaderPic; 18 | @property (nonatomic,strong) UILabel *psName; 19 | @property (nonatomic,strong) UIButton *psPhone; 20 | @property (copy, nonatomic)NSString *number; 21 | @property (copy, nonatomic)NSString *company; 22 | @property (copy, nonatomic)NSString *phone; 23 | @end 24 | -------------------------------------------------------------------------------- /YWLogisticsQuery/YWTableHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // YWTableHeaderView.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 17/12/19. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // 8 | 9 | #import "YWTableHeaderView.h" 10 | #import "YWConfigFile.h" 11 | 12 | @interface YWTableHeaderView () 13 | 14 | 15 | @end 16 | @implementation YWTableHeaderView 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame{ 19 | 20 | self=[super initWithFrame:frame]; 21 | if (self) { 22 | [self setupUI]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setPhone:(NSString *)phone { 28 | 29 | self.phoneLabel.text = phone; 30 | } 31 | 32 | - (void)setNumber:(NSString *)number { 33 | 34 | self.numLabel.text = number; 35 | } 36 | 37 | - (void)setCompany:(NSString *)company { 38 | 39 | self.comLabel.text = company; 40 | } 41 | 42 | - (void)setupUI { 43 | self.backgroundColor=[UIColor whiteColor]; 44 | 45 | UIView *bgView = [[UIView alloc]init]; 46 | bgView.backgroundColor = [UIColor whiteColor]; 47 | [self addSubview:bgView]; 48 | 49 | self.goodsPic.frame=CGRectMake(Gap, Gap, 6*Gap, 6*Gap); 50 | // 默认图片 51 | self.goodsPic.image=PLACEHOlDER_IMAGE; 52 | [bgView addSubview:self.goodsPic]; 53 | 54 | UILabel *label0=[[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.goodsPic.frame)+Gap,Gap, 7*Gap, 2*Gap)]; 55 | label0.font = [UIFont systemFontOfSize:15]; 56 | label0.textColor = [UIColor grayColor]; 57 | label0.text = @"物流状态:"; 58 | [bgView addSubview:label0]; 59 | 60 | self.type.frame=CGRectMake(CGRectGetMaxX(label0.frame)+Gap/2, label0.frame.origin.y, YWScreenWidth/2, label0.frame.size.height); 61 | self.type.font=[UIFont systemFontOfSize:15]; 62 | self.type.textColor=[UIColor grayColor]; 63 | self.type.textAlignment=NSTextAlignmentLeft; 64 | [bgView addSubview:self.type]; 65 | 66 | UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(label0.frame.origin.x ,CGRectGetMaxY(label0.frame), 7*Gap, 2*Gap)]; 67 | label1.font = [UIFont systemFontOfSize:15]; 68 | label1.textColor = [UIColor grayColor]; 69 | label1.text = @"物流单号:"; 70 | [bgView addSubview:label1]; 71 | 72 | self.numLabel.frame=CGRectMake(CGRectGetMaxX(label1.frame)+Gap/2, label1.frame.origin.y, YWScreenWidth/2, label1.frame.size.height); 73 | self.numLabel.font=[UIFont systemFontOfSize:15]; 74 | self.numLabel.textColor=[UIColor grayColor]; 75 | self.numLabel.textAlignment=NSTextAlignmentLeft; 76 | [bgView addSubview:self.numLabel]; 77 | 78 | 79 | UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(label1.frame.origin.x ,CGRectGetMaxY(label1.frame), 7*Gap, 2*Gap)]; 80 | label2.font = [UIFont systemFontOfSize:15]; 81 | label2.textColor = [UIColor grayColor]; 82 | label2.text = @"物流公司:"; 83 | [bgView addSubview:label2]; 84 | 85 | 86 | self.comLabel.frame=CGRectMake(CGRectGetMaxX(label2.frame)+Gap/2, label2.frame.origin.y, YWScreenWidth/2, label1.frame.size.height); 87 | self.comLabel.font=[UIFont systemFontOfSize:15]; 88 | self.comLabel.textColor=[UIColor grayColor]; 89 | self.comLabel.textAlignment=NSTextAlignmentLeft; 90 | [bgView addSubview:self.comLabel]; 91 | 92 | 93 | UILabel *line=[[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.goodsPic.frame)+Gap, YWScreenWidth, Gap)]; 94 | line.backgroundColor = YWRGBAColor(240, 240, 240, 1.0); 95 | [bgView addSubview:line]; 96 | 97 | } 98 | 99 | #pragma mark 懒加载 100 | - (UIImageView *)goodsPic{ 101 | if(!_goodsPic) { 102 | _goodsPic = [[UIImageView alloc]init]; 103 | _goodsPic.contentMode = UIViewContentModeScaleAspectFill; 104 | _goodsPic.layer.masksToBounds = YES; 105 | } 106 | 107 | return _goodsPic; 108 | 109 | } 110 | - (UILabel *)type{ 111 | 112 | if(!_type) { 113 | 114 | _type = [[UILabel alloc]init]; 115 | 116 | } 117 | 118 | return _type; 119 | 120 | } 121 | - (UILabel *)numLabel{ 122 | 123 | if(!_numLabel) { 124 | 125 | _numLabel = [[UILabel alloc]init]; 126 | 127 | } 128 | 129 | return _numLabel; 130 | 131 | } 132 | - (UILabel *)comLabel{ 133 | 134 | if(!_comLabel) { 135 | 136 | _comLabel = [[UILabel alloc]init]; 137 | 138 | } 139 | 140 | return _comLabel; 141 | 142 | } 143 | - (UILabel *)phoneLabel{ 144 | 145 | if(!_phoneLabel) { 146 | 147 | _phoneLabel =[[UILabel alloc]init]; 148 | 149 | } 150 | 151 | return _phoneLabel; 152 | 153 | } 154 | - (UIImageView *)psHeaderPic{ 155 | 156 | if(!_psHeaderPic) { 157 | 158 | _psHeaderPic =[[UIImageView alloc]init]; 159 | 160 | } 161 | 162 | return _psHeaderPic; 163 | 164 | } 165 | - (UILabel *)psName{ 166 | 167 | if(!_psName) { 168 | 169 | _psName =[[UILabel alloc]init]; 170 | 171 | } 172 | 173 | return _psName; 174 | 175 | } 176 | - (UIButton *)psPhone{ 177 | 178 | if(!_psPhone) { 179 | 180 | _psPhone =[[UIButton alloc]init]; 181 | 182 | } 183 | 184 | return _psPhone; 185 | 186 | } 187 | /* 188 | // Only override drawRect: if you perform custom drawing. 189 | // An empty implementation adversely affects performance during animation. 190 | - (void)drawRect:(CGRect)rect { 191 | // Drawing code 192 | } 193 | */ 194 | 195 | 196 | @end 197 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/YWLogisticsQueryDemo/.DS_Store -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/10. 6 | // Copyright © 2018年 com.scsskc. 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 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/10. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | 22 | //设置全局状态栏字体颜色为白色 23 | [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; 24 | 25 | // 直接设置导航控制器 26 | UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:[ViewController new]]; 27 | navVC.navigationBar.barTintColor = [UIColor orangeColor]; 28 | navVC.navigationBar.tintColor = [UIColor whiteColor]; 29 | [navVC.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; 30 | self.window.backgroundColor = [UIColor whiteColor]; 31 | self.window.rootViewController = navVC; 32 | 33 | return YES; 34 | } 35 | 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application { 38 | // 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. 39 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 40 | } 41 | 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | 49 | - (void)applicationWillEnterForeground:(UIApplication *)application { 50 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 51 | } 52 | 53 | 54 | - (void)applicationDidBecomeActive:(UIApplication *)application { 55 | // 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. 56 | } 57 | 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application { 60 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/YWLogisticsQueryDemo/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0.3 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/LogisticsQueryViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogisticsQueryViewController.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/27. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YWLogisticsView.h" 11 | 12 | @interface LogisticsQueryViewController : UIViewController 13 | 14 | @property (nonatomic, strong) YWLogisticModel * model; // 包括:物流信息(编码、单号、物流公司、商品图片或物流公司logo) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/LogisticsQueryViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LogisticsQueryViewController.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/27. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import "LogisticsQueryViewController.h" 10 | #import 11 | 12 | @interface LogisticsQueryViewController () 13 | 14 | @property (nonatomic, strong) NSMutableArray * dataSource; 15 | @property (nonatomic, strong) NSMutableArray * contextArray; 16 | @property (nonatomic, strong) NSMutableArray * timeArray; 17 | 18 | - (void)initUserInterface; /**< 初始化用户界面 */ 19 | - (void)initUserDataSource; /**< 初始化数据源 */ 20 | 21 | @end 22 | 23 | @implementation LogisticsQueryViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do any additional setup after loading the view. 28 | 29 | self.title = @"物流信息"; 30 | [self initUserInterface]; 31 | [self initUserDataSource]; 32 | 33 | } 34 | 35 | - (void)initUserDataSource { 36 | WeakSelf; 37 | _dataSource = [NSMutableArray array]; 38 | 39 | // 快递100 帮助文档 - https://www.kuaidi100.com/openapi/api_post.shtml 40 | NSString *queryUrl = [NSString stringWithFormat:@"https://m.kuaidi100.com/query?type=%@&postid=%@", 41 | _model.logisticCode, 42 | _model.logisticNumber 43 | ]; 44 | 45 | AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; 46 | manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/html",@"text/javascript", @"text/plain", nil]; 47 | manager.requestSerializer.timeoutInterval = 15.0; 48 | [manager POST:queryUrl parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { 49 | 50 | NSLog(@"responseObject:\n%@", responseObject); 51 | if ([responseObject allKeys].count > 0) { 52 | if ([responseObject[@"status"] integerValue] == 200) { 53 | NSArray *expressArr = responseObject[@"data"]; 54 | for (NSDictionary *express in expressArr) { 55 | YWLogisticCellModel *model = [[YWLogisticCellModel alloc]init]; 56 | model.dsc = express[@"context"]; 57 | model.date = express[@"time"]; 58 | [_dataSource addObject:model]; 59 | } 60 | } 61 | } 62 | [weakSelf initUserInterface]; 63 | 64 | } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 65 | 66 | NSLog(@"物流信息加载失败,请稍后重试"); 67 | 68 | }]; 69 | 70 | } 71 | 72 | - (void)initUserInterface { 73 | YWLogisticsView *logis = [[YWLogisticsView alloc] initWithDataSource:_dataSource]; 74 | logis.frame = CGRectMake(0, 0, YWScreenWidth, YWScreenHeight); 75 | logis.logisticModel = _model; 76 | [self.view addSubview:logis]; 77 | } 78 | 79 | 80 | - (void)didReceiveMemoryWarning { 81 | [super didReceiveMemoryWarning]; 82 | // Dispose of any resources that can be recreated. 83 | } 84 | 85 | 86 | @end 87 | 88 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/10. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/10. 6 | // Copyright © 2018年 com.scsskc. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import "LogisticsQueryViewController.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | self.title = @"YWLogisticsQueryDemo"; 24 | 25 | // 查询最新物流信息按钮 26 | UIButton *queryBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 27 | queryBtn.frame = CGRectMake(0, 0, 200, 50); 28 | queryBtn.center = self.view.center; 29 | [queryBtn setTitle:@"点我查询最新物流信息" forState:UIControlStateNormal]; 30 | [queryBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 31 | [queryBtn setBackgroundColor:[UIColor orangeColor]]; 32 | [queryBtn addTarget:self action:@selector(queryBtnAction) forControlEvents:UIControlEventTouchUpInside]; 33 | [self.view addSubview:queryBtn]; 34 | 35 | self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:nil]; 36 | 37 | } 38 | 39 | - (void)queryBtnAction { 40 | 41 | // 这里的 'shentong' 等参数 来自快递100 帮助文档 - https://www.kuaidi100.com/openapi/api_post.shtml 42 | YWLogisticModel *model = [[YWLogisticModel alloc] init]; 43 | model.logisticCode = @"shentong"; 44 | model.logisticCompany = @"申通快递"; 45 | model.logisticNumber = @"3345541356152"; 46 | model.goodsPicUrlStr = @"https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/it/u=3696414240,752471806&fm=58"; 47 | // model.goodsPicUrlStr = @"http://img.daimg.com/uploads/allimg/171228/3-1G22Q34R8.jpg"; 48 | LogisticsQueryViewController *logisticsQueryVC = [[LogisticsQueryViewController alloc] init]; 49 | logisticsQueryVC.model = model; 50 | 51 | [self.navigationController pushViewController:logisticsQueryVC animated:YES]; 52 | } 53 | 54 | - (void)didReceiveMemoryWarning { 55 | [super didReceiveMemoryWarning]; 56 | // Dispose of any resources that can be recreated. 57 | } 58 | 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/ZXPUnicode.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZXPUnicode.h 3 | // 4 | // blog : http://blog.csdn.net/biggercoffee 5 | // github : https://github.com/biggercoffee/ZXPUnicode 6 | // 7 | // Created by Mango on 2017/3/31. 8 | // Copyright © 2017年 coffee. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | 14 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/ZXPUnicode.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZXPUnicode.m 3 | // 4 | // blog : http://blog.csdn.net/biggercoffee 5 | // github : https://github.com/biggercoffee/ZXPUnicode 6 | // 7 | // Created by Mango on 2017/3/31. 8 | // Copyright © 2017年 coffee. All rights reserved. 9 | // 10 | 11 | #import "ZXPUnicode.h" 12 | #import 13 | 14 | static inline void zxp_swizzleSelector(Class class, SEL originalSelector, SEL swizzledSelector) { 15 | Method originalMethod = class_getInstanceMethod(class, originalSelector); 16 | Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); 17 | if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { 18 | class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 19 | } else { 20 | method_exchangeImplementations(originalMethod, swizzledMethod); 21 | } 22 | } 23 | 24 | @implementation NSString (ZXPUnicode) 25 | 26 | - (NSString *)stringByReplaceUnicode { 27 | NSMutableString *convertedString = [self mutableCopy]; 28 | [convertedString replaceOccurrencesOfString:@"\\U" 29 | withString:@"\\u" 30 | options:0 31 | range:NSMakeRange(0, convertedString.length)]; 32 | 33 | CFStringRef transform = CFSTR("Any-Hex/Java"); 34 | CFStringTransform((__bridge CFMutableStringRef)convertedString, NULL, transform, YES); 35 | return convertedString; 36 | } 37 | 38 | @end 39 | 40 | @implementation NSArray (ZXPUnicode) 41 | 42 | + (void)load { 43 | static dispatch_once_t onceToken; 44 | dispatch_once(&onceToken, ^{ 45 | Class class = [self class]; 46 | zxp_swizzleSelector(class, @selector(description), @selector(zxp_description)); 47 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:), @selector(zxp_descriptionWithLocale:)); 48 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:indent:), @selector(zxp_descriptionWithLocale:indent:)); 49 | }); 50 | } 51 | 52 | /** 53 | * 我觉得 54 | * 可以把以下的方法放到一个NSObject的category中 55 | * 然后在需要的类中进行swizzle 56 | * 但是又觉得这样太粗暴了。。。。 57 | */ 58 | 59 | - (NSString *)zxp_description { 60 | return [[self zxp_description] stringByReplaceUnicode]; 61 | } 62 | 63 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale { 64 | return [[self zxp_descriptionWithLocale:locale] stringByReplaceUnicode]; 65 | } 66 | 67 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level { 68 | return [[self zxp_descriptionWithLocale:locale indent:level] stringByReplaceUnicode]; 69 | } 70 | 71 | @end 72 | 73 | @implementation NSDictionary (ZXPUnicode) 74 | 75 | + (void)load { 76 | static dispatch_once_t onceToken; 77 | dispatch_once(&onceToken, ^{ 78 | Class class = [self class]; 79 | zxp_swizzleSelector(class, @selector(description), @selector(zxp_description)); 80 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:), @selector(zxp_descriptionWithLocale:)); 81 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:indent:), @selector(zxp_descriptionWithLocale:indent:)); 82 | }); 83 | } 84 | 85 | - (NSString *)zxp_description { 86 | return [[self zxp_description] stringByReplaceUnicode]; 87 | } 88 | 89 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale { 90 | return [[self zxp_descriptionWithLocale:locale] stringByReplaceUnicode]; 91 | } 92 | 93 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level { 94 | return [[self zxp_descriptionWithLocale:locale indent:level] stringByReplaceUnicode]; 95 | } 96 | 97 | @end 98 | 99 | @implementation NSSet (ZXPUnicode) 100 | 101 | + (void)load { 102 | static dispatch_once_t onceToken; 103 | dispatch_once(&onceToken, ^{ 104 | Class class = [self class]; 105 | zxp_swizzleSelector(class, @selector(description), @selector(zxp_description)); 106 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:), @selector(zxp_descriptionWithLocale:)); 107 | zxp_swizzleSelector(class, @selector(descriptionWithLocale:indent:), @selector(zxp_descriptionWithLocale:indent:)); 108 | }); 109 | } 110 | 111 | - (NSString *)zxp_description { 112 | return [[self zxp_description] stringByReplaceUnicode]; 113 | } 114 | 115 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale { 116 | return [[self zxp_descriptionWithLocale:locale] stringByReplaceUnicode]; 117 | } 118 | 119 | - (NSString *)zxp_descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level { 120 | return [[self zxp_descriptionWithLocale:locale indent:level] stringByReplaceUnicode]; 121 | } 122 | 123 | @end 124 | 125 | -------------------------------------------------------------------------------- /YWLogisticsQueryDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YWLogisticsQueryDemo 4 | // 5 | // Created by Candy on 2018/2/28. 6 | // Copyright © 2018年 com.scsskc. 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 | -------------------------------------------------------------------------------- /效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAWayne/YWLogisticsQuery/168619af9dda354b275b34f44701ab1c86f8f8bb/效果图.png --------------------------------------------------------------------------------