Commit 8a90b306 authored by 陈业泓's avatar 陈业泓

更新了SDK代码

parent 97f3c80e
PODS: PODS:
- AFNetworking (4.0.1): - AFNetworking (3.2.1):
- AFNetworking/NSURLSession (= 4.0.1) - AFNetworking/NSURLSession (= 3.2.1)
- AFNetworking/Reachability (= 4.0.1) - AFNetworking/Reachability (= 3.2.1)
- AFNetworking/Security (= 4.0.1) - AFNetworking/Security (= 3.2.1)
- AFNetworking/Serialization (= 4.0.1) - AFNetworking/Serialization (= 3.2.1)
- AFNetworking/UIKit (= 4.0.1) - AFNetworking/UIKit (= 3.2.1)
- AFNetworking/NSURLSession (4.0.1): - AFNetworking/NSURLSession (3.2.1):
- AFNetworking/Reachability - AFNetworking/Reachability
- AFNetworking/Security - AFNetworking/Security
- AFNetworking/Serialization - AFNetworking/Serialization
- AFNetworking/Reachability (4.0.1) - AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (4.0.1) - AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (4.0.1) - AFNetworking/Serialization (3.2.1)
- AFNetworking/UIKit (4.0.1): - AFNetworking/UIKit (3.2.1):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- Masonry (1.1.0) - Masonry (1.1.0)
- SYCSDK (0.1.2): - SYCSDK (0.1.4):
- SYCSDK/Network (= 0.1.2) - SYCSDK/Network (= 0.1.4)
- SYCSDK/ViewUtil (= 0.1.2) - SYCSDK/ViewUtil (= 0.1.4)
- SYCSDK/Network (0.1.2): - SYCSDK/Network (0.1.4):
- AFNetworking - AFNetworking (= 3.2.1)
- SYCSDK/ViewUtil (0.1.2): - SYCSDK/ViewUtil (0.1.4):
- Masonry - Masonry
DEPENDENCIES: DEPENDENCIES:
...@@ -36,9 +36,9 @@ EXTERNAL SOURCES: ...@@ -36,9 +36,9 @@ EXTERNAL SOURCES:
:path: "../" :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
SYCSDK: aa7d336beddd913b88f5ffcc2a449b6e60a44d31 SYCSDK: f8ca0b8b7f60af66493c546c9659806c3bdebaa4
PODFILE CHECKSUM: 18b04bde28add2b6b321bd8aedba0e35c72818b1 PODFILE CHECKSUM: 18b04bde28add2b6b321bd8aedba0e35c72818b1
......
...@@ -22,16 +22,10 @@ ...@@ -22,16 +22,10 @@
#ifndef AFCompatibilityMacros_h #ifndef AFCompatibilityMacros_h
#define AFCompatibilityMacros_h #define AFCompatibilityMacros_h
#ifdef API_AVAILABLE
#define AF_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
#else
#define AF_API_AVAILABLE(...)
#endif // API_AVAILABLE
#ifdef API_UNAVAILABLE #ifdef API_UNAVAILABLE
#define AF_API_UNAVAILABLE(...) API_UNAVAILABLE(__VA_ARGS__) #define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
#else #else
#define AF_API_UNAVAILABLE(...) #define AF_API_UNAVAILABLE(x)
#endif // API_UNAVAILABLE #endif // API_UNAVAILABLE
#if __has_warning("-Wunguarded-availability-new") #if __has_warning("-Wunguarded-availability-new")
...@@ -40,10 +34,4 @@ ...@@ -40,10 +34,4 @@
#define AF_CAN_USE_AT_AVAILABLE 0 #define AF_CAN_USE_AT_AVAILABLE 0
#endif #endif
#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
#else
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
#endif
#endif /* AFCompatibilityMacros_h */ #endif /* AFCompatibilityMacros_h */
...@@ -32,7 +32,6 @@ NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire ...@@ -32,7 +32,6 @@ NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire
NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem"; NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem";
typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
typedef AFNetworkReachabilityManager * (^AFNetworkReachabilityStatusCallback)(AFNetworkReachabilityStatus status);
NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
switch (status) { switch (status) {
...@@ -79,21 +78,20 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork ...@@ -79,21 +78,20 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork
* a queued notification (for an earlier status condition) is processed after * a queued notification (for an earlier status condition) is processed after
* the later update, resulting in the listener being left in the wrong state. * the later update, resulting in the listener being left in the wrong state.
*/ */
static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusCallback block) { static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) {
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
AFNetworkReachabilityManager *manager = nil;
if (block) { if (block) {
manager = block(status); block(status);
} }
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) };
[notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:manager userInfo:userInfo]; [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo];
}); });
} }
static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) { static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusCallback)info); AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info);
} }
...@@ -212,15 +210,14 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { ...@@ -212,15 +210,14 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
} }
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
AFNetworkReachabilityStatusCallback callback = ^(AFNetworkReachabilityStatus status) { AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) {
__strong __typeof(weakSelf)strongSelf = weakSelf; __strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf.networkReachabilityStatus = status; strongSelf.networkReachabilityStatus = status;
if (strongSelf.networkReachabilityStatusBlock) { if (strongSelf.networkReachabilityStatusBlock) {
strongSelf.networkReachabilityStatusBlock(status); strongSelf.networkReachabilityStatusBlock(status);
} }
return strongSelf;
}; };
SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL}; SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
......
...@@ -45,10 +45,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -45,10 +45,10 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
The certificates used to evaluate server trust according to the SSL pinning mode. The certificates used to evaluate server trust according to the SSL pinning mode.
By default, this property is set to any (`.cer`) certificates included in the 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`.
Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
@see policyWithPinningMode:withPinnedCertificates:
*/ */
@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates; @property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
...@@ -90,14 +90,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -90,14 +90,10 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
Creates and returns a security policy with the specified pinning mode. Creates and returns a security policy with the specified pinning mode.
Certificates with the `.cer` extension found in the main bundle will be pinned. If you want more control over which certificates are pinned, please use `policyWithPinningMode:withPinnedCertificates:` instead.
@param pinningMode The SSL pinning mode. @param pinningMode The SSL pinning mode.
@return A new security policy. @return A new security policy.
@see -policyWithPinningMode:withPinnedCertificates:
*/ */
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
...@@ -108,10 +104,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -108,10 +104,7 @@ NS_ASSUME_NONNULL_BEGIN
@param pinnedCertificates The certificates to pin against. @param pinnedCertificates The certificates to pin against.
@return A new security policy. @return A new security policy.
*/
@see +certificatesInBundle:
@see -pinnedCertificates
*/
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates; + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
///------------------------------ ///------------------------------
......
...@@ -60,10 +60,7 @@ static id AFPublicKeyForCertificate(NSData *certificate) { ...@@ -60,10 +60,7 @@ static id AFPublicKeyForCertificate(NSData *certificate) {
policy = SecPolicyCreateBasicX509(); policy = SecPolicyCreateBasicX509();
__Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out); __Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
#pragma clang diagnostic pop
allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
...@@ -86,10 +83,7 @@ _out: ...@@ -86,10 +83,7 @@ _out:
static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) {
BOOL isValid = NO; BOOL isValid = NO;
SecTrustResultType result; SecTrustResultType result;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out);
#pragma clang diagnostic pop
isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
...@@ -121,11 +115,10 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -121,11 +115,10 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
SecTrustRef trust; SecTrustRef trust;
__Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
SecTrustResultType result; SecTrustResultType result;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out);
#pragma clang diagnostic pop
[trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)];
_out: _out:
...@@ -165,6 +158,17 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -165,6 +158,17 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
return [NSSet setWithSet:certificates]; return [NSSet setWithSet:certificates];
} }
+ (NSSet *)defaultPinnedCertificates {
static NSSet *_defaultPinnedCertificates = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
_defaultPinnedCertificates = [self certificatesInBundle:bundle];
});
return _defaultPinnedCertificates;
}
+ (instancetype)defaultPolicy { + (instancetype)defaultPolicy {
AFSecurityPolicy *securityPolicy = [[self alloc] init]; AFSecurityPolicy *securityPolicy = [[self alloc] init];
securityPolicy.SSLPinningMode = AFSSLPinningModeNone; securityPolicy.SSLPinningMode = AFSSLPinningModeNone;
...@@ -173,8 +177,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -173,8 +177,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
} }
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
NSSet <NSData *> *defaultPinnedCertificates = [self certificatesInBundle:[NSBundle mainBundle]]; return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];
return [self policyWithPinningMode:pinningMode withPinnedCertificates:defaultPinnedCertificates];
} }
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates { + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {
...@@ -244,11 +247,14 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -244,11 +247,14 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
if (self.SSLPinningMode == AFSSLPinningModeNone) { if (self.SSLPinningMode == AFSSLPinningModeNone) {
return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust);
} else if (!self.allowInvalidCertificates && !AFServerTrustIsValid(serverTrust)) { } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
return NO; return NO;
} }
switch (self.SSLPinningMode) { switch (self.SSLPinningMode) {
case AFSSLPinningModeNone:
default:
return NO;
case AFSSLPinningModeCertificate: { case AFSSLPinningModeCertificate: {
NSMutableArray *pinnedCertificates = [NSMutableArray array]; NSMutableArray *pinnedCertificates = [NSMutableArray array];
for (NSData *certificateData in self.pinnedCertificates) { for (NSData *certificateData in self.pinnedCertificates) {
...@@ -284,9 +290,6 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -284,9 +290,6 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
} }
return trustedPublicKeyCount > 0; return trustedPublicKeyCount > 0;
} }
default:
return NO;
} }
return NO; return NO;
...@@ -314,7 +317,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { ...@@ -314,7 +317,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue]; self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];
self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))]; self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))]; self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];
self.pinnedCertificates = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
return self; return self;
} }
......
...@@ -216,7 +216,7 @@ forHTTPHeaderField:(NSString *)field; ...@@ -216,7 +216,7 @@ forHTTPHeaderField:(NSString *)field;
@param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request.
*/ */
- (void)setQueryStringSerializationWithBlock:(nullable NSString * _Nullable (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; - (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block;
///------------------------------- ///-------------------------------
/// @name Creating Request Objects /// @name Creating Request Objects
...@@ -234,10 +234,10 @@ forHTTPHeaderField:(NSString *)field; ...@@ -234,10 +234,10 @@ forHTTPHeaderField:(NSString *)field;
@return An `NSMutableURLRequest` object. @return An `NSMutableURLRequest` object.
*/ */
- (nullable NSMutableURLRequest *)requestWithMethod:(NSString *)method - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
URLString:(NSString *)URLString URLString:(NSString *)URLString
parameters:(nullable id)parameters parameters:(nullable id)parameters
error:(NSError * _Nullable __autoreleasing *)error; error:(NSError * _Nullable __autoreleasing *)error;
/** /**
Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2
......
...@@ -217,13 +217,12 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb ...@@ -217,13 +217,12 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
}]; }];
[self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"]; [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"];
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
NSString *userAgent = nil; NSString *userAgent = nil;
#if TARGET_OS_IOS #if TARGET_OS_IOS
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]]; userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
#elif TARGET_OS_TV
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; tvOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
#elif TARGET_OS_WATCH #elif TARGET_OS_WATCH
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]]; userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]];
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]; userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
...@@ -313,7 +312,7 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb ...@@ -313,7 +312,7 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
- (void)setValue:(NSString *)value - (void)setValue:(NSString *)value
forHTTPHeaderField:(NSString *)field forHTTPHeaderField:(NSString *)field
{ {
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{ dispatch_barrier_async(self.requestHeaderModificationQueue, ^{
[self.mutableHTTPRequestHeaders setValue:value forKey:field]; [self.mutableHTTPRequestHeaders setValue:value forKey:field];
}); });
} }
...@@ -335,7 +334,7 @@ forHTTPHeaderField:(NSString *)field ...@@ -335,7 +334,7 @@ forHTTPHeaderField:(NSString *)field
} }
- (void)clearAuthorizationHeader { - (void)clearAuthorizationHeader {
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{ dispatch_barrier_async(self.requestHeaderModificationQueue, ^{
[self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"]; [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
}); });
} }
...@@ -572,7 +571,7 @@ forHTTPHeaderField:(NSString *)field ...@@ -572,7 +571,7 @@ forHTTPHeaderField:(NSString *)field
dispatch_sync(self.requestHeaderModificationQueue, ^{ dispatch_sync(self.requestHeaderModificationQueue, ^{
[coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))]; [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
}); });
[coder encodeObject:@(self.queryStringSerializationStyle) forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
} }
#pragma mark - NSCopying #pragma mark - NSCopying
...@@ -1296,7 +1295,7 @@ typedef enum { ...@@ -1296,7 +1295,7 @@ typedef enum {
- (void)encodeWithCoder:(NSCoder *)coder { - (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder]; [super encodeWithCoder:coder];
[coder encodeObject:@(self.writingOptions) forKey:NSStringFromSelector(@selector(writingOptions))]; [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))];
} }
#pragma mark - NSCopying #pragma mark - NSCopying
...@@ -1382,7 +1381,7 @@ typedef enum { ...@@ -1382,7 +1381,7 @@ typedef enum {
- (void)encodeWithCoder:(NSCoder *)coder { - (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder]; [super encodeWithCoder:coder];
[coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))]; [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
[coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))]; [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))];
} }
......
...@@ -24,11 +24,6 @@ ...@@ -24,11 +24,6 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/**
Recursively removes `NSNull` values from a JSON object.
*/
FOUNDATION_EXPORT id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions);
/** /**
The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
...@@ -62,6 +57,8 @@ FOUNDATION_EXPORT id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJ ...@@ -62,6 +57,8 @@ FOUNDATION_EXPORT id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJ
- (instancetype)init; - (instancetype)init;
@property (nonatomic, assign) NSStringEncoding stringEncoding DEPRECATED_MSG_ATTRIBUTE("The string encoding is never used. AFHTTPResponseSerializer only validates status codes and content types but does not try to decode the received data in any way.");
/** /**
Creates and returns a serializer with default configuration. Creates and returns a serializer with default configuration.
*/ */
......
...@@ -60,13 +60,11 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co ...@@ -60,13 +60,11 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
return NO; return NO;
} }
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
if ([JSONObject isKindOfClass:[NSArray class]]) { if ([JSONObject isKindOfClass:[NSArray class]]) {
NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]];
for (id value in (NSArray *)JSONObject) { for (id value in (NSArray *)JSONObject) {
if (![value isEqual:[NSNull null]]) { [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
[mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
}
} }
return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray];
...@@ -114,7 +112,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions ...@@ -114,7 +112,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
BOOL responseIsValid = YES; BOOL responseIsValid = YES;
NSError *validationError = nil; NSError *validationError = nil;
if ([response isKindOfClass:[NSHTTPURLResponse class]]) { if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] && if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] &&
!([response MIMEType] == nil && [data length] == 0)) { !([response MIMEType] == nil && [data length] == 0)) {
...@@ -182,7 +180,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions ...@@ -182,7 +180,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
} }
self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
return self; return self;
} }
...@@ -271,10 +269,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions ...@@ -271,10 +269,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
#pragma mark - NSSecureCoding #pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder { - (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder]; self = [super initWithCoder:decoder];
if (!self) { if (!self) {
...@@ -492,10 +486,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions ...@@ -492,10 +486,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
#pragma mark - NSSecureCoding #pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder { - (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder]; self = [super initWithCoder:decoder];
if (!self) { if (!self) {
...@@ -712,10 +702,6 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r ...@@ -712,10 +702,6 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSSecureCoding #pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder { - (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder]; self = [super initWithCoder:decoder];
if (!self) { if (!self) {
...@@ -802,18 +788,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r ...@@ -802,18 +788,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSSecureCoding #pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder { - (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder]; self = [super initWithCoder:decoder];
if (!self) { if (!self) {
return nil; return nil;
} }
NSSet *classes = [NSSet setWithArray:@[[NSArray class], [AFHTTPResponseSerializer <AFURLResponseSerialization> class]]]; self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))];
self.responseSerializers = [decoder decodeObjectOfClasses:classes forKey:NSStringFromSelector(@selector(responseSerializers))];
return self; return self;
} }
......
Copyright (c) 2011-2020 Alamofire Software Foundation (http://alamofire.org/) Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -2,20 +2,25 @@ ...@@ -2,20 +2,25 @@
<img src="https://raw.github.com/AFNetworking/AFNetworking/assets/afnetworking-logo.png" alt="AFNetworking" title="AFNetworking"> <img src="https://raw.github.com/AFNetworking/AFNetworking/assets/afnetworking-logo.png" alt="AFNetworking" title="AFNetworking">
</p> </p>
[![Build Status](https://github.com/AFNetworking/AFNetworking/workflows/AFNetworking%20CI/badge.svg?branch=master)](https://github.com/AFNetworking/AFNetworking/actions) [![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking)
[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking) [![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking)
[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking) [![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking)
AFNetworking is a delightful networking library for iOS, macOS, watchOS, and tvOS. It's built on top of the [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. AFNetworking is a delightful networking library for iOS, macOS, watchOS, and tvOS. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac.
Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did!
## How To Get Started ## How To Get Started
- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps - [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps
- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki) - Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki)
- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking
- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0.
## Communication ## Communication
...@@ -30,37 +35,56 @@ AFNetworking supports multiple methods for installing the library in a project. ...@@ -30,37 +35,56 @@ AFNetworking supports multiple methods for installing the library in a project.
## Installation with CocoaPods ## Installation with CocoaPods
To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: [CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command:
```ruby ```bash
pod 'AFNetworking', '~> 4.0' $ gem install cocoapods
``` ```
### Installation with Swift Package Manager > CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+.
#### Podfile
Once you have your Swift package set up, adding AFNetworking as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
```swift target 'TargetName' do
dependencies: [ pod 'AFNetworking', '~> 3.0'
.package(url: "https://github.com/AFNetworking/AFNetworking.git", .upToNextMajor(from: "4.0.0")) end
]
``` ```
> Note: AFNetworking's Swift package does not include it's UIKit extensions. Then, run the following command:
```bash
$ pod install
```
### Installation with Carthage ### Installation with Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate AFNetworking, add the following to your `Cartfile`. [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```
To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl ```ogdl
github "AFNetworking/AFNetworking" ~> 4.0 github "AFNetworking/AFNetworking" ~> 3.0
``` ```
Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project.
## Requirements ## Requirements
| AFNetworking Version | Minimum iOS Target | Minimum macOS Target | Minimum watchOS Target | Minimum tvOS Target | Notes | | AFNetworking Version | Minimum iOS Target | Minimum macOS Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| |:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:|
| 4.x | iOS 9 | macOS 10.10 | watchOS 2.0 | tvOS 9.0 | Xcode 11+ is required. |
| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. | | 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. |
| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. | | 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. |
| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | | 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. |
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
@interface AFCachedImage : NSObject @interface AFCachedImage : NSObject
@property (nonatomic, strong) UIImage *image; @property (nonatomic, strong) UIImage *image;
@property (nonatomic, copy) NSString *identifier; @property (nonatomic, strong) NSString *identifier;
@property (nonatomic, assign) UInt64 totalBytes; @property (nonatomic, assign) UInt64 totalBytes;
@property (nonatomic, strong) NSDate *lastAccessDate; @property (nonatomic, strong) NSDate *lastAccessDate;
@property (nonatomic, assign) UInt64 currentMemoryUsage; @property (nonatomic, assign) UInt64 currentMemoryUsage;
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
@implementation AFCachedImage @implementation AFCachedImage
- (instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { -(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier {
if (self = [self init]) { if (self = [self init]) {
self.image = image; self.image = image;
self.identifier = identifier; self.identifier = identifier;
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
return self; return self;
} }
- (UIImage *)accessImage { - (UIImage*)accessImage {
self.lastAccessDate = [NSDate date]; self.lastAccessDate = [NSDate date];
return self.image; return self.image;
} }
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
[self.cachedImages removeObjectForKey:cachedImage.identifier]; [self.cachedImages removeObjectForKey:cachedImage.identifier];
bytesPurged += cachedImage.totalBytes; bytesPurged += cachedImage.totalBytes;
if (bytesPurged >= bytesToPurge) { if (bytesPurged >= bytesToPurge) {
break; break ;
} }
} }
self.currentMemoryUsage -= bytesPurged; self.currentMemoryUsage -= bytesPurged;
......
...@@ -67,7 +67,7 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { ...@@ -67,7 +67,7 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) {
/** /**
Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default.
*/ */
@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritization; @property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton;
/** /**
The shared default instance of `AFImageDownloader` initialized with default values. The shared default instance of `AFImageDownloader` initialized with default values.
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
@interface AFImageDownloaderResponseHandler : NSObject @interface AFImageDownloaderResponseHandler : NSObject
@property (nonatomic, strong) NSUUID *uuid; @property (nonatomic, strong) NSUUID *uuid;
@property (nonatomic, copy) void (^successBlock)(NSURLRequest *, NSHTTPURLResponse *, UIImage *); @property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*);
@property (nonatomic, copy) void (^failureBlock)(NSURLRequest *, NSHTTPURLResponse *, NSError *); @property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*);
@end @end
@implementation AFImageDownloaderResponseHandler @implementation AFImageDownloaderResponseHandler
...@@ -71,11 +71,11 @@ ...@@ -71,11 +71,11 @@
return self; return self;
} }
- (void)addResponseHandler:(AFImageDownloaderResponseHandler *)handler { - (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler {
[self.responseHandlers addObject:handler]; [self.responseHandlers addObject:handler];
} }
- (void)removeResponseHandler:(AFImageDownloaderResponseHandler *)handler { - (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler {
[self.responseHandlers removeObject:handler]; [self.responseHandlers removeObject:handler];
} }
...@@ -109,24 +109,20 @@ ...@@ -109,24 +109,20 @@
@implementation AFImageDownloader @implementation AFImageDownloader
+ (NSURLCache *)defaultURLCache { + (NSURLCache *)defaultURLCache {
NSUInteger memoryCapacity = 20 * 1024 * 1024; // 20MB
NSUInteger diskCapacity = 150 * 1024 * 1024; // 150MB
NSURL *cacheURL = [[[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory
inDomain:NSUserDomainMask
appropriateForURL:nil
create:YES
error:nil]
URLByAppendingPathComponent:@"com.alamofire.imagedownloader"];
#if TARGET_OS_MACCATALYST // It's been discovered that a crash will occur on certain versions
return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity // of iOS if you customize the cache.
diskCapacity:diskCapacity //
directoryURL:cacheURL]; // More info can be found here: https://devforums.apple.com/message/1102182#1102182
#else //
return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity // When iOS 7 support is dropped, this should be modified to use
diskCapacity:diskCapacity // NSProcessInfo methods instead.
diskPath:[cacheURL path]]; if ([[[UIDevice currentDevice] systemVersion] compare:@"8.2" options:NSNumericSearch] == NSOrderedAscending) {
#endif return [NSURLCache sharedURLCache];
}
return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
diskCapacity:150 * 1024 * 1024
diskPath:@"com.alamofire.imagedownloader"];
} }
+ (NSURLSessionConfiguration *)defaultURLSessionConfiguration { + (NSURLSessionConfiguration *)defaultURLSessionConfiguration {
...@@ -167,7 +163,7 @@ ...@@ -167,7 +163,7 @@
if (self = [super init]) { if (self = [super init]) {
self.sessionManager = sessionManager; self.sessionManager = sessionManager;
self.downloadPrioritization = downloadPrioritization; self.downloadPrioritizaton = downloadPrioritization;
self.maximumActiveDownloads = maximumActiveDownloads; self.maximumActiveDownloads = maximumActiveDownloads;
self.imageCache = imageCache; self.imageCache = imageCache;
...@@ -258,14 +254,14 @@ ...@@ -258,14 +254,14 @@
completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
dispatch_async(self.responseQueue, ^{ dispatch_async(self.responseQueue, ^{
__strong __typeof__(weakSelf) strongSelf = weakSelf; __strong __typeof__(weakSelf) strongSelf = weakSelf;
AFImageDownloaderMergedTask *mergedTask = [strongSelf safelyGetMergedTask:URLIdentifier]; AFImageDownloaderMergedTask *mergedTask = strongSelf.mergedTasks[URLIdentifier];
if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) { if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) {
mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier]; mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier];
if (error) { if (error) {
for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) {
if (handler.failureBlock) { if (handler.failureBlock) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
handler.failureBlock(request, (NSHTTPURLResponse *)response, error); handler.failureBlock(request, (NSHTTPURLResponse*)response, error);
}); });
} }
} }
...@@ -277,7 +273,7 @@ ...@@ -277,7 +273,7 @@
for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) {
if (handler.successBlock) { if (handler.successBlock) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
handler.successBlock(request, (NSHTTPURLResponse *)response, responseObject); handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject);
}); });
} }
} }
...@@ -337,14 +333,14 @@ ...@@ -337,14 +333,14 @@
} }
} }
if (mergedTask.responseHandlers.count == 0) { if (mergedTask.responseHandlers.count == 0 && mergedTask.task.state == NSURLSessionTaskStateSuspended) {
[mergedTask.task cancel]; [mergedTask.task cancel];
[self removeMergedTaskWithURLIdentifier:URLIdentifier]; [self removeMergedTaskWithURLIdentifier:URLIdentifier];
} }
}); });
} }
- (AFImageDownloaderMergedTask *)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier { - (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier {
__block AFImageDownloaderMergedTask *mergedTask = nil; __block AFImageDownloaderMergedTask *mergedTask = nil;
dispatch_sync(self.synchronizationQueue, ^{ dispatch_sync(self.synchronizationQueue, ^{
mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier]; mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier];
...@@ -387,7 +383,7 @@ ...@@ -387,7 +383,7 @@
} }
- (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask { - (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask {
switch (self.downloadPrioritization) { switch (self.downloadPrioritizaton) {
case AFImageDownloadPrioritizationFIFO: case AFImageDownloadPrioritizationFIFO:
[self.queuedMergedTasks addObject:mergedTask]; [self.queuedMergedTasks addObject:mergedTask];
break; break;
...@@ -408,14 +404,6 @@ ...@@ -408,14 +404,6 @@
return self.activeRequestCount < self.maximumActiveDownloads; return self.activeRequestCount < self.maximumActiveDownloads;
} }
- (AFImageDownloaderMergedTask *)safelyGetMergedTask:(NSString *)URLIdentifier {
__block AFImageDownloaderMergedTask *mergedTask;
dispatch_sync(self.synchronizationQueue, ^(){
mergedTask = self.mergedTasks[URLIdentifier];
});
return mergedTask;
}
@end @end
#endif #endif
...@@ -109,9 +109,11 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl ...@@ -109,9 +109,11 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible { - (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible {
if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) { if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) {
[self willChangeValueForKey:@"networkActivityIndicatorVisible"];
@synchronized(self) { @synchronized(self) {
_networkActivityIndicatorVisible = networkActivityIndicatorVisible; _networkActivityIndicatorVisible = networkActivityIndicatorVisible;
} }
[self didChangeValueForKey:@"networkActivityIndicatorVisible"];
if (self.networkActivityActionBlock) { if (self.networkActivityActionBlock) {
self.networkActivityActionBlock(networkActivityIndicatorVisible); self.networkActivityActionBlock(networkActivityIndicatorVisible);
} else { } else {
...@@ -120,20 +122,35 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl ...@@ -120,20 +122,35 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
} }
} }
- (void)setActivityCount:(NSInteger)activityCount {
@synchronized(self) {
_activityCount = activityCount;
}
dispatch_async(dispatch_get_main_queue(), ^{
[self updateCurrentStateForNetworkActivityChange];
});
}
- (void)incrementActivityCount { - (void)incrementActivityCount {
@synchronized(self) { [self willChangeValueForKey:@"activityCount"];
self.activityCount++; @synchronized(self) {
} _activityCount++;
}
[self didChangeValueForKey:@"activityCount"];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self updateCurrentStateForNetworkActivityChange]; [self updateCurrentStateForNetworkActivityChange];
}); });
} }
- (void)decrementActivityCount { - (void)decrementActivityCount {
@synchronized(self) { [self willChangeValueForKey:@"activityCount"];
self.activityCount = MAX(_activityCount - 1, 0); @synchronized(self) {
} _activityCount = MAX(_activityCount - 1, 0);
}
[self didChangeValueForKey:@"activityCount"];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self updateCurrentStateForNetworkActivityChange]; [self updateCurrentStateForNetworkActivityChange];
}); });
...@@ -155,6 +172,7 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl ...@@ -155,6 +172,7 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
- (void)setCurrentState:(AFNetworkActivityManagerState)currentState { - (void)setCurrentState:(AFNetworkActivityManagerState)currentState {
@synchronized(self) { @synchronized(self) {
if (_currentState != currentState) { if (_currentState != currentState) {
[self willChangeValueForKey:@"currentState"];
_currentState = currentState; _currentState = currentState;
switch (currentState) { switch (currentState) {
case AFNetworkActivityManagerStateNotActive: case AFNetworkActivityManagerStateNotActive:
...@@ -173,7 +191,9 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl ...@@ -173,7 +191,9 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
[self startCompletionDelayTimer]; [self startCompletionDelayTimer];
break; break;
} }
[self didChangeValueForKey:@"currentState"];
} }
} }
} }
......
...@@ -103,11 +103,11 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState ...@@ -103,11 +103,11 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
+ (AFImageDownloader *)sharedImageDownloader { + (AFImageDownloader *)sharedImageDownloader {
return objc_getAssociatedObject([UIButton class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
} }
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
objc_setAssociatedObject([UIButton class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} }
#pragma mark - #pragma mark -
...@@ -168,7 +168,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState ...@@ -168,7 +168,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
if (success) { if (success) {
success(request, response, responseObject); success(request, response, responseObject);
} else if (responseObject) { } else if(responseObject) {
[strongSelf setImage:responseObject forState:state]; [strongSelf setImage:responseObject forState:state];
} }
[strongSelf af_setImageDownloadReceipt:nil forState:state]; [strongSelf af_setImageDownloadReceipt:nil forState:state];
...@@ -247,7 +247,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState ...@@ -247,7 +247,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) { if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
if (success) { if (success) {
success(request, response, responseObject); success(request, response, responseObject);
} else if (responseObject) { } else if(responseObject) {
[strongSelf setBackgroundImage:responseObject forState:state]; [strongSelf setBackgroundImage:responseObject forState:state];
} }
[strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state]; [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];
......
//
// UIImage+AFNetworking.h
//
//
// Created by Paulo Ferreira on 08/07/15.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if TARGET_OS_IOS || TARGET_OS_TV
#import <UIKit/UIKit.h>
@interface UIImage (AFNetworking)
+ (UIImage*) safeImageWithData:(NSData*)data;
@end
#endif
...@@ -48,11 +48,11 @@ ...@@ -48,11 +48,11 @@
@implementation UIImageView (AFNetworking) @implementation UIImageView (AFNetworking)
+ (AFImageDownloader *)sharedImageDownloader { + (AFImageDownloader *)sharedImageDownloader {
return objc_getAssociatedObject([UIImageView class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
} }
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
objc_setAssociatedObject([UIImageView class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} }
#pragma mark - #pragma mark -
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
{ {
if ([urlRequest URL] == nil) { if ([urlRequest URL] == nil) {
self.image = placeholderImage; self.image = placeholderImage;
if (failure) { if (failure) {
...@@ -84,7 +85,7 @@ ...@@ -84,7 +85,7 @@
return; return;
} }
if ([self isActiveTaskURLEqualToURLRequest:urlRequest]) { if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){
return; return;
} }
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
if (success) { if (success) {
success(request, response, responseObject); success(request, response, responseObject);
} else if (responseObject) { } else if(responseObject) {
strongSelf.image = responseObject; strongSelf.image = responseObject;
} }
[strongSelf clearActiveDownloadInformation]; [strongSelf clearActiveDownloadInformation];
......
...@@ -20,24 +20,23 @@ ...@@ -20,24 +20,23 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#import <TargetConditionals.h> #if TARGET_OS_IOS || TARGET_OS_TV
#import <UIKit/UIKit.h>
#ifndef _UIKIT_AFNETWORKING_ #ifndef _UIKIT_AFNETWORKING_
#define _UIKIT_AFNETWORKING_ #define _UIKIT_AFNETWORKING_
#if TARGET_OS_IOS || TARGET_OS_TV #if TARGET_OS_IOS
#import "AFAutoPurgingImageCache.h" #import "AFAutoPurgingImageCache.h"
#import "AFImageDownloader.h" #import "AFImageDownloader.h"
#import "UIActivityIndicatorView+AFNetworking.h"
#import "UIButton+AFNetworking.h"
#import "UIImageView+AFNetworking.h"
#import "UIProgressView+AFNetworking.h"
#endif
#if TARGET_OS_IOS
#import "AFNetworkActivityIndicatorManager.h" #import "AFNetworkActivityIndicatorManager.h"
#import "UIRefreshControl+AFNetworking.h" #import "UIRefreshControl+AFNetworking.h"
#import "WKWebView+AFNetworking.h" #import "UIWebView+AFNetworking.h"
#endif #endif
#import "UIActivityIndicatorView+AFNetworking.h"
#import "UIButton+AFNetworking.h"
#import "UIImageView+AFNetworking.h"
#import "UIProgressView+AFNetworking.h"
#endif /* _UIKIT_AFNETWORKING_ */ #endif /* _UIKIT_AFNETWORKING_ */
#endif
// WkWebView+AFNetworking.h // UIWebView+AFNetworking.h
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -26,47 +26,47 @@ ...@@ -26,47 +26,47 @@
#if TARGET_OS_IOS #if TARGET_OS_IOS
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class AFHTTPSessionManager; @class AFHTTPSessionManager;
@interface WKWebView (AFNetworking) /**
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.
@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.
*/
@interface UIWebView (AFNetworking)
/** /**
The session manager used to download all request The session manager used to download all requests.
*/ */
@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; @property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
/** /**
Asynchronously loads the specified request. Asynchronously loads the specified request.
@param request A URL request identifying the location of the content to load. This must not be `nil`. @param request A URL request identifying the location of the content to load. This must not be `nil`.
@param navigation The WKNavigation object that containts information for tracking the loading progress of a webpage. This must not be `nil`.
@param progress A progress object monitoring the current download progress. @param progress A progress object monitoring the current download progress.
@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. @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.
@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. @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.
*/ */
- (void)loadRequest:(NSURLRequest *)request - (void)loadRequest:(NSURLRequest *)request
navigation:(WKNavigation * _Nonnull)navigation
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
failure:(nullable void (^)(NSError *error))failure; failure:(nullable void (^)(NSError *error))failure;
/** /**
Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
@param request A URL request identifying the location of the content to load. This must not be `nil`. @param request A URL request identifying the location of the content to load. This must not be `nil`.
@param navigation The WKNavigation object that containts information for tracking the loading progress of a webpage. This must not be `nil`.
@param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
@param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
@param progress A progress object monitoring the current download progress. @param progress A progress object monitoring the current download progress.
@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. @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.
@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. @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.
*/ */
- (void)loadRequest:(NSURLRequest *)request - (void)loadRequest:(NSURLRequest *)request
navigation:(WKNavigation * _Nonnull)navigation
MIMEType:(nullable NSString *)MIMEType MIMEType:(nullable NSString *)MIMEType
textEncodingName:(nullable NSString *)textEncodingName textEncodingName:(nullable NSString *)textEncodingName
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
......
// WkWebView+AFNetworking.m // UIWebView+AFNetworking.m
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#import "WKWebView+AFNetworking.h" #import "UIWebView+AFNetworking.h"
#import <objc/runtime.h> #import <objc/runtime.h>
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
#import "AFURLResponseSerialization.h" #import "AFURLResponseSerialization.h"
#import "AFURLRequestSerialization.h" #import "AFURLRequestSerialization.h"
@interface WKWebView (_AFNetworking) @interface UIWebView (_AFNetworking)
@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; @property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask;
@end @end
@implementation WKWebView (_AFNetworking) @implementation UIWebView (_AFNetworking)
- (NSURLSessionDataTask *)af_URLSessionTask { - (NSURLSessionDataTask *)af_URLSessionTask {
return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask));
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
#pragma mark - #pragma mark -
@implementation WKWebView (AFNetworking) @implementation UIWebView (AFNetworking)
- (AFHTTPSessionManager *)sessionManager { - (AFHTTPSessionManager *)sessionManager {
static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
_af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer]; _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer];
_af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
}); });
return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager;
} }
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
_af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
}); });
return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
} }
...@@ -82,11 +82,11 @@ ...@@ -82,11 +82,11 @@
#pragma mark - #pragma mark -
- (void)loadRequest:(NSURLRequest *)request - (void)loadRequest:(NSURLRequest *)request
navigation:(WKNavigation * _Nonnull)navigation
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
failure:(nullable void (^)(NSError *error))failure { failure:(void (^)(NSError *error))failure
[self loadRequest:request navigation:navigation MIMEType:nil textEncodingName:nil progress:progress success:^NSData * _Nonnull(NSHTTPURLResponse * _Nonnull response, NSData * _Nonnull data) { {
[self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) {
NSStringEncoding stringEncoding = NSUTF8StringEncoding; NSStringEncoding stringEncoding = NSUTF8StringEncoding;
if (response.textEncodingName) { if (response.textEncodingName) {
CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName); CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
...@@ -94,58 +94,61 @@ ...@@ -94,58 +94,61 @@
stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding); stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
} }
} }
NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding]; NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding];
if (success) { if (success) {
string = success(response, string); string = success(response, string);
} }
return [string dataUsingEncoding:stringEncoding]; return [string dataUsingEncoding:stringEncoding];
} failure:failure]; } failure:failure];
} }
- (void)loadRequest:(NSURLRequest *)request - (void)loadRequest:(NSURLRequest *)request
navigation:(WKNavigation * _Nonnull)navigation MIMEType:(NSString *)MIMEType
MIMEType:(nullable NSString *)MIMEType textEncodingName:(NSString *)textEncodingName
textEncodingName:(nullable NSString *)textEncodingName
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
failure:(nullable void (^)(NSError *error))failure { failure:(void (^)(NSError *error))failure
{
NSParameterAssert(request); NSParameterAssert(request);
if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) { if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) {
[self.af_URLSessionTask cancel]; [self.af_URLSessionTask cancel];
} }
self.af_URLSessionTask = nil; self.af_URLSessionTask = nil;
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
__block NSURLSessionDataTask *dataTask; __block NSURLSessionDataTask *dataTask;
__strong __typeof(weakSelf) strongSelf = weakSelf; dataTask = [self.sessionManager
__strong __typeof(weakSelf.navigationDelegate) strongSelfDelegate = strongSelf.navigationDelegate; dataTaskWithRequest:request
dataTask = [self.sessionManager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { uploadProgress:nil
if (error) { downloadProgress:nil
if (failure) { completionHandler:^(NSURLResponse * _Nonnull response, id _Nonnull responseObject, NSError * _Nullable error) {
failure(error); __strong __typeof(weakSelf) strongSelf = weakSelf;
} if (error) {
} else { if (failure) {
if (success) { failure(error);
success((NSHTTPURLResponse *)response, responseObject); }
} } else {
[strongSelf loadData:responseObject MIMEType:MIMEType characterEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]]; if (success) {
success((NSHTTPURLResponse *)response, responseObject);
if ([strongSelfDelegate respondsToSelector:@selector(webView:didFinishNavigation:)]) { }
[strongSelfDelegate webView:strongSelf didFinishNavigation:navigation]; [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]];
}
} if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
}]; [strongSelf.delegate webViewDidFinishLoad:strongSelf];
}
}
}];
self.af_URLSessionTask = dataTask; self.af_URLSessionTask = dataTask;
if (progress != nil) { if (progress != nil) {
*progress = [self.sessionManager downloadProgressForTask:dataTask]; *progress = [self.sessionManager downloadProgressForTask:dataTask];
} }
[self.af_URLSessionTask resume]; [self.af_URLSessionTask resume];
if ([strongSelfDelegate respondsToSelector:@selector(webView:didStartProvisionalNavigation:)]) { if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
[strongSelfDelegate webView:self didStartProvisionalNavigation:navigation]; [self.delegate webViewDidStartLoad:self];
} }
} }
......
{ {
"name": "SYCSDK", "name": "SYCSDK",
"version": "0.1.2", "version": "0.1.4",
"summary": "A short description of SYCSDK.", "summary": "A short description of SYCSDK.",
"description": "TODO: Add long description of the pod here.", "description": "TODO: Add long description of the pod here.",
"homepage": "http://www.shengyc.com/", "homepage": "http://www.shengyc.com/",
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"source": { "source": {
"git": "http://139.159.244.151:2900/chenyehong/SYCSDK.git", "git": "http://139.159.244.151:2900/chenyehong/SYCSDK.git",
"tag": "0.1.2" "tag": "0.1.4"
}, },
"platforms": { "platforms": {
"ios": "9.0" "ios": "9.0"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"source_files": "SYCSDK/Classes/Network/**/*", "source_files": "SYCSDK/Classes/Network/**/*",
"dependencies": { "dependencies": {
"AFNetworking": [ "AFNetworking": [
"3.2.1"
] ]
} }
}, },
......
PODS: PODS:
- AFNetworking (4.0.1): - AFNetworking (3.2.1):
- AFNetworking/NSURLSession (= 4.0.1) - AFNetworking/NSURLSession (= 3.2.1)
- AFNetworking/Reachability (= 4.0.1) - AFNetworking/Reachability (= 3.2.1)
- AFNetworking/Security (= 4.0.1) - AFNetworking/Security (= 3.2.1)
- AFNetworking/Serialization (= 4.0.1) - AFNetworking/Serialization (= 3.2.1)
- AFNetworking/UIKit (= 4.0.1) - AFNetworking/UIKit (= 3.2.1)
- AFNetworking/NSURLSession (4.0.1): - AFNetworking/NSURLSession (3.2.1):
- AFNetworking/Reachability - AFNetworking/Reachability
- AFNetworking/Security - AFNetworking/Security
- AFNetworking/Serialization - AFNetworking/Serialization
- AFNetworking/Reachability (4.0.1) - AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (4.0.1) - AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (4.0.1) - AFNetworking/Serialization (3.2.1)
- AFNetworking/UIKit (4.0.1): - AFNetworking/UIKit (3.2.1):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- Masonry (1.1.0) - Masonry (1.1.0)
- SYCSDK (0.1.2): - SYCSDK (0.1.4):
- SYCSDK/Network (= 0.1.2) - SYCSDK/Network (= 0.1.4)
- SYCSDK/ViewUtil (= 0.1.2) - SYCSDK/ViewUtil (= 0.1.4)
- SYCSDK/Network (0.1.2): - SYCSDK/Network (0.1.4):
- AFNetworking - AFNetworking (= 3.2.1)
- SYCSDK/ViewUtil (0.1.2): - SYCSDK/ViewUtil (0.1.4):
- Masonry - Masonry
DEPENDENCIES: DEPENDENCIES:
...@@ -36,9 +36,9 @@ EXTERNAL SOURCES: ...@@ -36,9 +36,9 @@ EXTERNAL SOURCES:
:path: "../" :path: "../"
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
SYCSDK: aa7d336beddd913b88f5ffcc2a449b6e60a44d31 SYCSDK: f8ca0b8b7f60af66493c546c9659806c3bdebaa4
PODFILE CHECKSUM: 18b04bde28add2b6b321bd8aedba0e35c72818b1 PODFILE CHECKSUM: 18b04bde28add2b6b321bd8aedba0e35c72818b1
......
This diff is collapsed.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>4.0.1</string> <string>3.2.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -10,3 +10,14 @@ ...@@ -10,3 +10,14 @@
#endif #endif
#endif #endif
#ifndef TARGET_OS_IOS
#define TARGET_OS_IOS TARGET_OS_IPHONE
#endif
#ifndef TARGET_OS_WATCH
#define TARGET_OS_WATCH 0
#endif
#ifndef TARGET_OS_TV
#define TARGET_OS_TV 0
#endif
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
#import "AFNetworkActivityIndicatorManager.h" #import "AFNetworkActivityIndicatorManager.h"
#import "UIActivityIndicatorView+AFNetworking.h" #import "UIActivityIndicatorView+AFNetworking.h"
#import "UIButton+AFNetworking.h" #import "UIButton+AFNetworking.h"
#import "UIImage+AFNetworking.h"
#import "UIImageView+AFNetworking.h" #import "UIImageView+AFNetworking.h"
#import "UIKit+AFNetworking.h" #import "UIKit+AFNetworking.h"
#import "UIProgressView+AFNetworking.h" #import "UIProgressView+AFNetworking.h"
#import "UIRefreshControl+AFNetworking.h" #import "UIRefreshControl+AFNetworking.h"
#import "WKWebView+AFNetworking.h" #import "UIWebView+AFNetworking.h"
FOUNDATION_EXPORT double AFNetworkingVersionNumber; FOUNDATION_EXPORT double AFNetworkingVersionNumber;
FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
......
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT} PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT} PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
...@@ -3,7 +3,7 @@ This application makes use of the following third party libraries: ...@@ -3,7 +3,7 @@ This application makes use of the following third party libraries:
## AFNetworking ## AFNetworking
Copyright (c) 2011-2020 Alamofire Software Foundation (http://alamofire.org/) Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</dict> </dict>
<dict> <dict>
<key>FooterText</key> <key>FooterText</key>
<string>Copyright (c) 2011-2020 Alamofire Software Foundation (http://alamofire.org/) <string>Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -3,7 +3,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetwork ...@@ -3,7 +3,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetwork
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers" HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "SYCSDK" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "SYCSDK" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
...@@ -3,7 +3,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetwork ...@@ -3,7 +3,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetwork
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers" HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers"
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "SYCSDK" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "SYCSDK" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO ...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK" FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers" HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "SYCSDK" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "SYCSDK" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO ...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK" FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers" HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK/SYCSDK.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "SYCSDK" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "SYCSDK" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.1.2</string> <string>0.1.4</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO ...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT} PODS_ROOT = ${SRCROOT}
......
...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO ...@@ -2,7 +2,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SYCSDK
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "Foundation" -framework "Masonry" -framework "UIKit" OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Foundation" -framework "Masonry" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
PODS_BUILD_DIR = ${BUILD_DIR} PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT} PODS_ROOT = ${SRCROOT}
......
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = "<group>"; };
633215E12642BD48F744D182 /* Pods-SYCSDK_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Tests.release.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Tests/Pods-SYCSDK_Tests.release.xcconfig"; sourceTree = "<group>"; }; 633215E12642BD48F744D182 /* Pods-SYCSDK_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Tests.release.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Tests/Pods-SYCSDK_Tests.release.xcconfig"; sourceTree = "<group>"; };
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8048837B6CD0AEEECF5A725D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; }; 8048837B6CD0AEEECF5A725D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
82271941D9DAAED96077277E /* SYCSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = SYCSDK.podspec; path = ../SYCSDK.podspec; sourceTree = "<group>"; }; 82271941D9DAAED96077277E /* SYCSDK.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SYCSDK.podspec; path = ../SYCSDK.podspec; sourceTree = "<group>"; };
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8E817A741F1E4B984D680BDE /* Pods-SYCSDK_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Example.debug.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Example/Pods-SYCSDK_Example.debug.xcconfig"; sourceTree = "<group>"; }; 8E817A741F1E4B984D680BDE /* Pods-SYCSDK_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Example.debug.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Example/Pods-SYCSDK_Example.debug.xcconfig"; sourceTree = "<group>"; };
BFEA092E6EC0BEDEF6B485EA /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; }; BFEA092E6EC0BEDEF6B485EA /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
C70A143BCDE596BB106E40FC /* Pods-SYCSDK_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Example.release.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Example/Pods-SYCSDK_Example.release.xcconfig"; sourceTree = "<group>"; }; C70A143BCDE596BB106E40FC /* Pods-SYCSDK_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SYCSDK_Example.release.xcconfig"; path = "Target Support Files/Pods-SYCSDK_Example/Pods-SYCSDK_Example.release.xcconfig"; sourceTree = "<group>"; };
FCBA33B5C682897CF990B3E3 /* Pods_SYCSDK_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SYCSDK_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FCBA33B5C682897CF990B3E3 /* Pods_SYCSDK_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SYCSDK_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -193,7 +193,6 @@ ...@@ -193,7 +193,6 @@
5B4F3E5BC81284A78590AFA9 /* Pods-SYCSDK_Tests.debug.xcconfig */, 5B4F3E5BC81284A78590AFA9 /* Pods-SYCSDK_Tests.debug.xcconfig */,
633215E12642BD48F744D182 /* Pods-SYCSDK_Tests.release.xcconfig */, 633215E12642BD48F744D182 /* Pods-SYCSDK_Tests.release.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
...@@ -258,6 +257,7 @@ ...@@ -258,6 +257,7 @@
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
English,
en, en,
Base, Base,
); );
...@@ -501,6 +501,7 @@ ...@@ -501,6 +501,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SYCSDK/SYCSDK-Prefix.pch"; GCC_PREFIX_HEADER = "SYCSDK/SYCSDK-Prefix.pch";
INFOPLIST_FILE = "SYCSDK/SYCSDK-Info.plist"; INFOPLIST_FILE = "SYCSDK/SYCSDK-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MODULE_NAME = ExampleApp; MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
...@@ -517,6 +518,7 @@ ...@@ -517,6 +518,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SYCSDK/SYCSDK-Prefix.pch"; GCC_PREFIX_HEADER = "SYCSDK/SYCSDK-Prefix.pch";
INFOPLIST_FILE = "SYCSDK/SYCSDK-Info.plist"; INFOPLIST_FILE = "SYCSDK/SYCSDK-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MODULE_NAME = ExampleApp; MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'SYCSDK' s.name = 'SYCSDK'
s.version = '0.1.3' s.version = '0.1.4'
s.summary = 'A short description of SYCSDK.' s.summary = 'A short description of SYCSDK.'
# This description is used to generate tags and improve search results. # This description is used to generate tags and improve search results.
...@@ -34,7 +34,7 @@ TODO: Add long description of the pod here. ...@@ -34,7 +34,7 @@ TODO: Add long description of the pod here.
s.subspec 'Network' do |network| s.subspec 'Network' do |network|
network.source_files = 'SYCSDK/Classes/Network/**/*' network.source_files = 'SYCSDK/Classes/Network/**/*'
network.dependency 'AFNetworking' network.dependency 'AFNetworking', '3.2.1'
end end
s.subspec 'ViewUtil' do |viewUtil| s.subspec 'ViewUtil' do |viewUtil|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment