From f8159fee72f4eadd22e8465b9f7ea8aef8ec25b5 Mon Sep 17 00:00:00 2001 From: BKKim Date: Tue, 30 May 2017 21:35:54 +0900 Subject: [PATCH 01/69] Fix AFURLSessionManager security weakness crashes when calling to a released block pointer --- AFNetworking/AFURLSessionManager.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/AFNetworking/AFURLSessionManager.m b/AFNetworking/AFURLSessionManager.m index 2475595..da02ce6 100644 --- a/AFNetworking/AFURLSessionManager.m +++ b/AFNetworking/AFURLSessionManager.m @@ -39,13 +39,18 @@ static dispatch_queue_t url_session_manager_creation_queue() { } static void url_session_manager_create_task_safely(dispatch_block_t block) { - if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { - // Fix of bug - // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) - // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 - dispatch_sync(url_session_manager_creation_queue(), block); + + if(block != nil) { + if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { + // Fix of bug + // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) + // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 + dispatch_sync(url_session_manager_creation_queue(), block); + } else { + block(); + } } else { - block(); + return; } } From 0ffb17d61932a1afacb39834a34ffe786301f5e1 Mon Sep 17 00:00:00 2001 From: skyline75489 Date: Fri, 14 Oct 2016 22:26:04 +0800 Subject: [PATCH 02/69] Add XMLParser/XMLDocument serializer tests --- AFNetworking.xcodeproj/project.pbxproj | 12 +++ AFNetworking/AFURLResponseSerialization.h | 2 +- .../AFXMLDocumentResponseSerializerTests.m | 101 ++++++++++++++++++ .../AFXMLParserResponseSerializerTests.m | 89 +++++++++++++++ 4 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 Tests/Tests/AFXMLDocumentResponseSerializerTests.m create mode 100644 Tests/Tests/AFXMLParserResponseSerializerTests.m diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index 7feb916..3276628 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -173,6 +173,10 @@ 29D96E991BCC406B00F571A5 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522931BBF13C700859F49 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29D96E9A1BCC406B00F571A5 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522961BBF13C700859F49 /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29F5EF031C47E64F008B976A /* AFUIWebViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */; }; + 2D4563901DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */; }; + 2D4563911DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */; }; + 2D4563921DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */; }; + 2D4563941DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */; }; 5F4323BB1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */; }; 5F4323BC1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */; }; 5F4323BD1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */; }; @@ -297,6 +301,8 @@ 2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = ""; }; 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCompoundResponseSerializerTests.m; sourceTree = ""; }; 29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIWebViewTests.m; sourceTree = ""; }; + 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLParserResponseSerializerTests.m; sourceTree = ""; }; + 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLDocumentResponseSerializerTests.m; sourceTree = ""; }; 5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Equifax_Secure_Certificate_Authority_Root.cer; sourceTree = ""; }; 5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "GeoTrust_Global_CA-cross.cer"; sourceTree = ""; }; 5F4323B51BF63741003B8749 /* google.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.com.cer; sourceTree = ""; }; @@ -434,6 +440,8 @@ 298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */, 298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */, 298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */, + 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */, + 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */, 298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */, E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */, 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */, @@ -967,6 +975,7 @@ 2987B0CF1BC40A7600179A4C /* AFPropertyListResponseSerializerTests.m in Sources */, 2987B0D21BC40AD800179A4C /* AFTestCase.m in Sources */, 2987B0CD1BC40A7600179A4C /* AFJSONSerializationTests.m in Sources */, + 2D4563921DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */, E91164671DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -992,6 +1001,7 @@ 298D7C981BC2CA2500FD3B3E /* AFURLSessionManagerTests.m in Sources */, 297824AC1BC2DB450041C395 /* AFImageDownloaderTests.m in Sources */, 29F5EF031C47E64F008B976A /* AFUIWebViewTests.m in Sources */, + 2D4563901DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */, 298D7CD51BC2CAEC00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */, 298D7CD71BC2CAEF00FD3B3E /* AFJSONSerializationTests.m in Sources */, 298D7CDB1BC2CAF500FD3B3E /* AFPropertyListResponseSerializerTests.m in Sources */, @@ -1010,8 +1020,10 @@ 1BF9F9611C87843200F1F35A /* AFImageResponseSerializerTests.m in Sources */, 298D7C971BC2C94500FD3B3E /* AFTestCase.m in Sources */, 298D7CD81BC2CAF000FD3B3E /* AFJSONSerializationTests.m in Sources */, + 2D4563941DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m in Sources */, 298D7CDC1BC2CAF500FD3B3E /* AFPropertyListResponseSerializerTests.m in Sources */, 298D7CD61BC2CAED00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */, + 2D4563911DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */, 298D7CDA1BC2CAF300FD3B3E /* AFNetworkReachabilityManagerTests.m in Sources */, 298D7C991BC2CA2600FD3B3E /* AFURLSessionManagerTests.m in Sources */, ); diff --git a/AFNetworking/AFURLResponseSerialization.h b/AFNetworking/AFURLResponseSerialization.h index 0f6d462..fca835b 100644 --- a/AFNetworking/AFURLResponseSerialization.h +++ b/AFNetworking/AFURLResponseSerialization.h @@ -163,7 +163,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; /** - Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSXMLDocument` documentation section "Input and Output Options". `0` by default. */ @property (nonatomic, assign) NSUInteger options; diff --git a/Tests/Tests/AFXMLDocumentResponseSerializerTests.m b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m new file mode 100644 index 0000000..6108d52 --- /dev/null +++ b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m @@ -0,0 +1,101 @@ +// AFXMLDocumentResponseSerializerTests.m +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// 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. + +#import "AFTestCase.h" + +#import "AFURLRequestSerialization.h" +#import "AFURLResponseSerialization.h" + +#import + +static NSData * AFXMLTestData() { + return [@"someValue" dataUsingEncoding:NSUTF8StringEncoding]; +} + +#pragma mark - + +@interface AFXMLDocumentResponseSerializerTests : AFTestCase +@property (nonatomic, strong) AFXMLDocumentResponseSerializer *responseSerializer; +@end + +#pragma mark - + +@implementation AFXMLDocumentResponseSerializerTests + +- (void)setUp { + [super setUp]; + self.responseSerializer = [AFXMLDocumentResponseSerializer serializer]; +} + +- (void)testThatXMLDocumentResponseSerializerAccpetsApplicationXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Error handling application/xml"); +} + +- (void)testThatXMLDocumentResponseSerializerAccpetsTextXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"text/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Error handling text/xml"); +} + +- (void)testThatXMLDocumentResponseSerializerDoesNotAcceptNonStandardXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"nonstandard/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNotNil(error, @"Error should have been thrown for nonstandard/xml"); +} + +- (void)testThatXMLDocumentResponseSerializerReturnsNSXMLDocumentObjectForValidXML { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; + NSError *error = nil; + id responseObject = [self.responseSerializer responseObjectForResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Serialization error should be nil"); + XCTAssert([responseObject isKindOfClass:[NSXMLDocument class]], @"Expected response to be a NSXMLDocument"); +} + +- (void)testThatXMLDocumentResponseSerializerReturnsErrorForInvalidXML { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; + NSError *error = nil; + [self.responseSerializer responseObjectForResponse:response data:[@"someValue" dataUsingEncoding:NSUTF8StringEncoding]; +} + +#pragma mark - + +@interface AFXMLParserResponseSerializerTests : AFTestCase +@property (nonatomic, strong) AFXMLParserResponseSerializer *responseSerializer; +@end + +#pragma mark - + +@implementation AFXMLParserResponseSerializerTests + +- (void)setUp { + [super setUp]; + self.responseSerializer = [AFXMLParserResponseSerializer serializer]; +} + +- (void)testThatXMLParserResponseSerializerAccpetsApplicationXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Error handling application/xml"); +} + +- (void)testThatXMLParserResponseSerializerAccpetsTextXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"text/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Error handling text/xml"); +} + +- (void)testThatXMLParserResponseSerializerDoesNotAcceptNonStandardXMLMimeType { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"nonstandard/xml"}]; + NSError *error = nil; + [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNotNil(error, @"Error should have been thrown for nonstandard/xml"); +} + +- (void)testThatXMLParserResponseSerializerReturnsNSXMLParserObjectForValidXML { + NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; + NSError *error = nil; + id responseObject = [self.responseSerializer responseObjectForResponse:response data:AFXMLTestData() error:&error]; + + XCTAssertNil(error, @"Serialization error should be nil"); + XCTAssert([responseObject isKindOfClass:[NSXMLParser class]], @"Expected response to be a NSXMLParser"); +} + +- (void)testThatXMLParserResponseSerializerCanBeCopied { + [self.responseSerializer setAcceptableStatusCodes:[NSIndexSet indexSetWithIndex:100]]; + [self.responseSerializer setAcceptableContentTypes:[NSSet setWithObject:@"test/type"]]; + + AFXMLParserResponseSerializer *copiedSerializer = [self.responseSerializer copy]; + XCTAssertNotEqual(copiedSerializer, self.responseSerializer); + XCTAssertEqual(copiedSerializer.acceptableStatusCodes, self.responseSerializer.acceptableStatusCodes); + XCTAssertEqual(copiedSerializer.acceptableContentTypes, self.responseSerializer.acceptableContentTypes); +} + +@end From 0840d05555745007ccc688bc032014bac0bac82a Mon Sep 17 00:00:00 2001 From: skyline75489 Date: Fri, 14 Oct 2016 22:33:03 +0800 Subject: [PATCH 03/69] Fix some typo --- Tests/Tests/AFXMLDocumentResponseSerializerTests.m | 6 +++--- Tests/Tests/AFXMLParserResponseSerializerTests.m | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Tests/AFXMLDocumentResponseSerializerTests.m b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m index 6108d52..4f9af2d 100644 --- a/Tests/Tests/AFXMLDocumentResponseSerializerTests.m +++ b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m @@ -45,7 +45,7 @@ static NSData * AFXMLTestData() { self.responseSerializer = [AFXMLDocumentResponseSerializer serializer]; } -- (void)testThatXMLDocumentResponseSerializerAccpetsApplicationXMLMimeType { +- (void)testThatXMLDocumentResponseSerializerAcceptsApplicationXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; @@ -53,7 +53,7 @@ static NSData * AFXMLTestData() { XCTAssertNil(error, @"Error handling application/xml"); } -- (void)testThatXMLDocumentResponseSerializerAccpetsTextXMLMimeType { +- (void)testThatXMLDocumentResponseSerializerAcceptsTextXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"text/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; @@ -61,7 +61,7 @@ static NSData * AFXMLTestData() { XCTAssertNil(error, @"Error handling text/xml"); } -- (void)testThatXMLDocumentResponseSerializerDoesNotAcceptNonStandardXMLMimeType { +- (void)testThatXMLDocumentResponseSerializerDoesNotAcceptsNonStandardXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"nonstandard/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; diff --git a/Tests/Tests/AFXMLParserResponseSerializerTests.m b/Tests/Tests/AFXMLParserResponseSerializerTests.m index 2596c8b..09f85c7 100644 --- a/Tests/Tests/AFXMLParserResponseSerializerTests.m +++ b/Tests/Tests/AFXMLParserResponseSerializerTests.m @@ -43,7 +43,7 @@ static NSData * AFXMLTestData() { self.responseSerializer = [AFXMLParserResponseSerializer serializer]; } -- (void)testThatXMLParserResponseSerializerAccpetsApplicationXMLMimeType { +- (void)testThatXMLParserResponseSerializerAcceptsApplicationXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; @@ -51,7 +51,7 @@ static NSData * AFXMLTestData() { XCTAssertNil(error, @"Error handling application/xml"); } -- (void)testThatXMLParserResponseSerializerAccpetsTextXMLMimeType { +- (void)testThatXMLParserResponseSerializerAcceptsTextXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"text/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; @@ -59,7 +59,7 @@ static NSData * AFXMLTestData() { XCTAssertNil(error, @"Error handling text/xml"); } -- (void)testThatXMLParserResponseSerializerDoesNotAcceptNonStandardXMLMimeType { +- (void)testThatXMLParserResponseSerializerDoesNotAcceptsNonStandardXMLMimeType { NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"nonstandard/xml"}]; NSError *error = nil; [self.responseSerializer validateResponse:response data:AFXMLTestData() error:&error]; From 158dc56d301df6b9e221cf73e157d1abc90564b0 Mon Sep 17 00:00:00 2001 From: skyline75489 Date: Fri, 14 Oct 2016 22:49:21 +0800 Subject: [PATCH 04/69] Fix a failure description --- Tests/Tests/AFXMLDocumentResponseSerializerTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/AFXMLDocumentResponseSerializerTests.m b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m index 4f9af2d..0682943 100644 --- a/Tests/Tests/AFXMLDocumentResponseSerializerTests.m +++ b/Tests/Tests/AFXMLDocumentResponseSerializerTests.m @@ -83,7 +83,7 @@ static NSData * AFXMLTestData() { NSError *error = nil; [self.responseSerializer responseObjectForResponse:response data:[@" Date: Wed, 19 Jul 2017 14:29:27 +0900 Subject: [PATCH 05/69] fix space used in Objective-C method (coding style) --- UIKit+AFNetworking/AFAutoPurgingImageCache.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/UIKit+AFNetworking/AFAutoPurgingImageCache.m index 1f40715..b147aac 100644 --- a/UIKit+AFNetworking/AFAutoPurgingImageCache.m +++ b/UIKit+AFNetworking/AFAutoPurgingImageCache.m @@ -37,7 +37,7 @@ @implementation AFCachedImage --(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { +- (instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier { if (self = [self init]) { self.image = image; self.identifier = identifier; From 27c819537a664cfcaadd62f9f0c37a5325e6cb4c Mon Sep 17 00:00:00 2001 From: leehonghwa Date: Wed, 19 Jul 2017 15:08:26 +0900 Subject: [PATCH 06/69] Fix asterisk location in method declaration --- Tests/Tests/AFURLSessionManagerTests.m | 2 +- UIKit+AFNetworking/AFAutoPurgingImageCache.m | 2 +- UIKit+AFNetworking/AFImageDownloader.m | 14 +++++++------- UIKit+AFNetworking/UIImage+AFNetworking.h | 2 +- UIKit+AFNetworking/UIWebView+AFNetworking.m | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/Tests/AFURLSessionManagerTests.m b/Tests/Tests/AFURLSessionManagerTests.m index 0dfd587..d8cbf5d 100644 --- a/Tests/Tests/AFURLSessionManagerTests.m +++ b/Tests/Tests/AFURLSessionManagerTests.m @@ -459,7 +459,7 @@ return [NSURLRequest requestWithURL:self.delayURL]; } -- (IMP)_implementationForTask:(NSURLSessionTask *)task selector:(SEL)selector { +- (IMP)_implementationForTask:(NSURLSessionTask *)task selector:(SEL)selector { return [self _implementationForClass:[task class] selector:selector]; } diff --git a/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/UIKit+AFNetworking/AFAutoPurgingImageCache.m index b147aac..a4ddd47 100644 --- a/UIKit+AFNetworking/AFAutoPurgingImageCache.m +++ b/UIKit+AFNetworking/AFAutoPurgingImageCache.m @@ -51,7 +51,7 @@ return self; } -- (UIImage*)accessImage { +- (UIImage *)accessImage { self.lastAccessDate = [NSDate date]; return self.image; } diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 5bb28ef..e0df803 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -28,8 +28,8 @@ @interface AFImageDownloaderResponseHandler : NSObject @property (nonatomic, strong) NSUUID *uuid; -@property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*); -@property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*); +@property (nonatomic, copy) void (^successBlock)(NSURLRequest *, NSHTTPURLResponse *, UIImage *); +@property (nonatomic, copy) void (^failureBlock)(NSURLRequest *, NSHTTPURLResponse *, NSError *); @end @implementation AFImageDownloaderResponseHandler @@ -71,11 +71,11 @@ return self; } -- (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler { +- (void)addResponseHandler:(AFImageDownloaderResponseHandler *)handler { [self.responseHandlers addObject:handler]; } -- (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler { +- (void)removeResponseHandler:(AFImageDownloaderResponseHandler *)handler { [self.responseHandlers removeObject:handler]; } @@ -257,7 +257,7 @@ for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { if (handler.failureBlock) { dispatch_async(dispatch_get_main_queue(), ^{ - handler.failureBlock(request, (NSHTTPURLResponse*)response, error); + handler.failureBlock(request, (NSHTTPURLResponse *)response, error); }); } } @@ -267,7 +267,7 @@ for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { if (handler.successBlock) { dispatch_async(dispatch_get_main_queue(), ^{ - handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject); + handler.successBlock(request, (NSHTTPURLResponse *)response, responseObject); }); } } @@ -334,7 +334,7 @@ }); } -- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier { +- (AFImageDownloaderMergedTask *)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier { __block AFImageDownloaderMergedTask *mergedTask = nil; dispatch_sync(self.synchronizationQueue, ^{ mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier]; diff --git a/UIKit+AFNetworking/UIImage+AFNetworking.h b/UIKit+AFNetworking/UIImage+AFNetworking.h index 14744cd..c5de1a4 100644 --- a/UIKit+AFNetworking/UIImage+AFNetworking.h +++ b/UIKit+AFNetworking/UIImage+AFNetworking.h @@ -28,7 +28,7 @@ @interface UIImage (AFNetworking) -+ (UIImage*) safeImageWithData:(NSData*)data; ++ (UIImage *)safeImageWithData:(NSData *)data; @end diff --git a/UIKit+AFNetworking/UIWebView+AFNetworking.m b/UIKit+AFNetworking/UIWebView+AFNetworking.m index 030c3e9..b760314 100644 --- a/UIKit+AFNetworking/UIWebView+AFNetworking.m +++ b/UIKit+AFNetworking/UIWebView+AFNetworking.m @@ -49,7 +49,7 @@ @implementation UIWebView (AFNetworking) -- (AFHTTPSessionManager *)sessionManager { +- (AFHTTPSessionManager *)sessionManager { static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ From 41897b19c6fb8b95944909f414a57323371508a3 Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Wed, 26 Jul 2017 18:10:07 -0500 Subject: [PATCH 07/69] Ability to set the defaultURLCache --- UIKit+AFNetworking/AFImageDownloader.h | 5 +++++ UIKit+AFNetworking/AFImageDownloader.m | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/UIKit+AFNetworking/AFImageDownloader.h b/UIKit+AFNetworking/AFImageDownloader.h index 3903eec..51339db 100644 --- a/UIKit+AFNetworking/AFImageDownloader.h +++ b/UIKit+AFNetworking/AFImageDownloader.h @@ -81,6 +81,11 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { */ + (NSURLCache *)defaultURLCache; +/** + Sets the default `NSURLCache` + */ ++ (void) setDefaultURLCache:(NSURLCache *)defaultCache; + /** Default initializer diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 5bb28ef..eef0da2 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -106,10 +106,16 @@ @end +static NSURLCache* _defaultURLCache = nil; @implementation AFImageDownloader + (NSURLCache *)defaultURLCache { + + if (_defaultURLCache) { + return _defaultURLCache; + } + // It's been discovered that a crash will occur on certain versions // of iOS if you customize the cache. // @@ -125,6 +131,11 @@ diskPath:@"com.alamofire.imagedownloader"]; } ++ (void)setDefaultURLCache:(NSURLCache *)defaultCache { + + _defaultURLCache = defaultCache; +} + + (NSURLSessionConfiguration *)defaultURLSessionConfiguration { NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; From 8db67cdfa903a5c51ef6703ee90bf43fc1f032f2 Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 08:45:02 -0500 Subject: [PATCH 08/69] Allow initialization of AFImageDownloader using custom NSURLSessionConfiguration. --- UIKit+AFNetworking/AFImageDownloader.h | 14 ++++++++++++++ UIKit+AFNetworking/AFImageDownloader.m | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/UIKit+AFNetworking/AFImageDownloader.h b/UIKit+AFNetworking/AFImageDownloader.h index 51339db..b1dc85b 100644 --- a/UIKit+AFNetworking/AFImageDownloader.h +++ b/UIKit+AFNetworking/AFImageDownloader.h @@ -86,6 +86,11 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { */ + (void) setDefaultURLCache:(NSURLCache *)defaultCache; +/** + The default `NSURLSessionConfiguration` with common usage parameter values. + */ ++ (NSURLSessionConfiguration *)defaultURLSessionConfiguration; + /** Default initializer @@ -93,6 +98,15 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { */ - (instancetype)init; +/** + Initializer with specific `URLSessionConfiguration` + + @param configuration The `NSURLSessionConfiguration` to be be used + + @return An instance of `AFImageDownloader` initialized with default values and custom `NSURLSessionConfiguration` + */ +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration; + /** Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache. diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index eef0da2..36a113f 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -154,7 +154,11 @@ static NSURLCache* _defaultURLCache = nil; - (instancetype)init { NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration]; - AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration]; + return [self initWithSessionConfiguration:defaultConfiguration]; +} + +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration { + AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration]; sessionManager.responseSerializer = [AFImageResponseSerializer serializer]; return [self initWithSessionManager:sessionManager From f6f64c83b35fed51633327ef15ad0dfc391dae8b Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 08:48:58 -0500 Subject: [PATCH 09/69] Remove setter for defaultURLCache --- UIKit+AFNetworking/AFImageDownloader.h | 5 ----- UIKit+AFNetworking/AFImageDownloader.m | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/UIKit+AFNetworking/AFImageDownloader.h b/UIKit+AFNetworking/AFImageDownloader.h index b1dc85b..7e25e37 100644 --- a/UIKit+AFNetworking/AFImageDownloader.h +++ b/UIKit+AFNetworking/AFImageDownloader.h @@ -81,11 +81,6 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { */ + (NSURLCache *)defaultURLCache; -/** - Sets the default `NSURLCache` - */ -+ (void) setDefaultURLCache:(NSURLCache *)defaultCache; - /** The default `NSURLSessionConfiguration` with common usage parameter values. */ diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 36a113f..6753243 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -106,16 +106,10 @@ @end -static NSURLCache* _defaultURLCache = nil; - @implementation AFImageDownloader + (NSURLCache *)defaultURLCache { - if (_defaultURLCache) { - return _defaultURLCache; - } - // It's been discovered that a crash will occur on certain versions // of iOS if you customize the cache. // @@ -131,11 +125,6 @@ static NSURLCache* _defaultURLCache = nil; diskPath:@"com.alamofire.imagedownloader"]; } -+ (void)setDefaultURLCache:(NSURLCache *)defaultCache { - - _defaultURLCache = defaultCache; -} - + (NSURLSessionConfiguration *)defaultURLSessionConfiguration { NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; From 51a80847ed9e55d067436cef1f032b2d58bc0bc7 Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 11:15:44 -0500 Subject: [PATCH 10/69] Ask implementor if an image should be cached. Implementors may prevent caching. --- UIKit+AFNetworking/AFAutoPurgingImageCache.h | 11 +++++++++++ UIKit+AFNetworking/AFAutoPurgingImageCache.m | 4 ++++ UIKit+AFNetworking/AFImageDownloader.m | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/UIKit+AFNetworking/AFAutoPurgingImageCache.h b/UIKit+AFNetworking/AFAutoPurgingImageCache.h index 9bdc15c..1a27bb4 100644 --- a/UIKit+AFNetworking/AFAutoPurgingImageCache.h +++ b/UIKit+AFNetworking/AFAutoPurgingImageCache.h @@ -72,6 +72,17 @@ NS_ASSUME_NONNULL_BEGIN */ @protocol AFImageRequestCache +/** + Asks if the image should be cached using an identifier created from the request and additional identifier. + + @param image The image to be cached. + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return A BOOL indicating whether or not the image should be added to the cache. YES will cache, NO will prevent caching. + */ +- (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + /** Adds the image to the cache using an identifier created from the request and additional identifier. diff --git a/UIKit+AFNetworking/AFAutoPurgingImageCache.m b/UIKit+AFNetworking/AFAutoPurgingImageCache.m index 1f40715..374eeac 100644 --- a/UIKit+AFNetworking/AFAutoPurgingImageCache.m +++ b/UIKit+AFNetworking/AFAutoPurgingImageCache.m @@ -196,6 +196,10 @@ return key; } +- (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier { + return YES; +} + @end #endif diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 6753243..1fbc523 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -266,7 +266,9 @@ } } } else { - [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil]; + if ([strongSelf.imageCache shouldCacheImage:responseObject forRequest:request withAdditionalIdentifier:nil]) { + [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil]; + } for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) { if (handler.successBlock) { From 6babb5f039b08e23f96e833b4daa6ff7a03d6231 Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 15:29:53 -0500 Subject: [PATCH 11/69] Test-cases. --- Tests/Tests/AFAutoPurgingImageCacheTests.m | 8 ++ Tests/Tests/AFImageDownloaderTests.m | 134 +++++++++++++++++++++ 2 files changed, 142 insertions(+) diff --git a/Tests/Tests/AFAutoPurgingImageCacheTests.m b/Tests/Tests/AFAutoPurgingImageCacheTests.m index e05f9ed..d5e3224 100644 --- a/Tests/Tests/AFAutoPurgingImageCacheTests.m +++ b/Tests/Tests/AFAutoPurgingImageCacheTests.m @@ -230,4 +230,12 @@ } } +#pragma mark - Should Cache Image +- (void)testThatShouldCacheIsYes { + NSURL *url = [NSURL URLWithString:@"http://test.com/image"]; + NSString *identifier = @"filter"; + NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url]; + BOOL result = [self.cache shouldCacheImage:self.testImage forRequest:request withAdditionalIdentifier:identifier]; + XCTAssertTrue(result); +} @end diff --git a/Tests/Tests/AFImageDownloaderTests.m b/Tests/Tests/AFImageDownloaderTests.m index 4dc999b..c5b743a 100644 --- a/Tests/Tests/AFImageDownloaderTests.m +++ b/Tests/Tests/AFImageDownloaderTests.m @@ -22,6 +22,11 @@ #import "AFTestCase.h" #import "AFImageDownloader.h" +@interface MockAFAutoPurgingImageCache : AFAutoPurgingImageCache +@property (nonatomic, strong) BOOL(^shouldCache)(UIImage*, NSURLRequest*, NSString*); +@property (nonatomic, strong) void(^addCache)(UIImage*, NSString*); +@end + @interface AFImageDownloaderTests : AFTestCase @property (nonatomic, strong) NSURLRequest *pngRequest; @property (nonatomic, strong) NSURLRequest *jpegRequest; @@ -234,6 +239,114 @@ XCTAssertEqual(responseImage1, responseImage2); } +- (void)testThatImageCacheIsPromptedShouldCache { + XCTestExpectation *expectation3 = [self expectationWithDescription:@"image 1 shouldCache called"]; + XCTestExpectation *expectation4 = [self expectationWithDescription:@"image 1 addCache called"]; + + MockAFAutoPurgingImageCache *mock = [[MockAFAutoPurgingImageCache alloc] init]; + mock.shouldCache = ^BOOL(UIImage *img, NSURLRequest *req, NSString *iden) { + [expectation3 fulfill]; + return YES; + }; + mock.addCache = ^(UIImage *img, NSString *ident) { + [expectation4 fulfill]; + }; + self.downloader.imageCache = mock; + + XCTestExpectation *expectation1 = [self expectationWithDescription:@"image 1 download should succeed"]; + __block NSHTTPURLResponse *urlResponse1 = nil; + __block UIImage *responseImage1 = nil; + + [self.downloader + downloadImageForURLRequest:self.pngRequest + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + urlResponse1 = response; + responseImage1 = responseObject; + [expectation1 fulfill]; + } + failure:nil]; + + [self waitForExpectationsWithCommonTimeout]; + + XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"]; + __block NSHTTPURLResponse *urlResponse2 = nil; + __block UIImage *responseImage2 = nil; + + [self.downloader + downloadImageForURLRequest:self.pngRequest + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + urlResponse2 = response; + responseImage2 = responseObject; + [expectation2 fulfill]; + } + failure:nil]; + + [self waitForExpectationsWithCommonTimeout]; + + XCTAssertNotNil(urlResponse1); + XCTAssertNotNil(responseImage1); + XCTAssertNil(urlResponse2); + XCTAssertEqual(responseImage1, responseImage2); +} + +- (void)testThatImageCacheIsPromptedShouldCacheNot { + XCTestExpectation *expectation3 = [self expectationWithDescription:@"image 1 shouldCache called"]; + XCTestExpectation *expectation4 = [self expectationWithDescription:@"image 1 & 2 addCache NOT called"]; + expectation4.inverted = YES; + + MockAFAutoPurgingImageCache *mock = [[MockAFAutoPurgingImageCache alloc] init]; + mock.shouldCache = ^BOOL(UIImage *img, NSURLRequest *req, NSString *iden) { + [expectation3 fulfill]; + return NO; + }; + mock.addCache = ^(UIImage *img, NSString *ident) { + XCTFail(@"Not expected"); + }; + self.downloader.imageCache = mock; + + XCTestExpectation *expectation1 = [self expectationWithDescription:@"image 1 download should succeed"]; + __block NSHTTPURLResponse *urlResponse1 = nil; + __block UIImage *responseImage1 = nil; + + [self.downloader + downloadImageForURLRequest:self.pngRequest + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + urlResponse1 = response; + responseImage1 = responseObject; + [expectation1 fulfill]; + } + failure:nil]; + + [self waitForExpectationsWithCommonTimeout]; + + XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"]; + __block NSHTTPURLResponse *urlResponse2 = nil; + __block UIImage *responseImage2 = nil; + + XCTestExpectation *expectation5 = [self expectationWithDescription:@"image 2 shouldCache called"]; + + mock.shouldCache = ^BOOL(UIImage *img, NSURLRequest *req, NSString *iden) { + [expectation5 fulfill]; + return NO; + }; + + [self.downloader + downloadImageForURLRequest:self.pngRequest + success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { + urlResponse2 = response; + responseImage2 = responseObject; + [expectation2 fulfill]; + } + failure:nil]; + + [self waitForExpectationsWithCommonTimeout]; + + XCTAssertNotNil(urlResponse1); + XCTAssertNotNil(responseImage1); + XCTAssertNotNil(urlResponse2); + XCTAssertNotEqual(responseImage1, responseImage2); +} + - (void)testThatImageDownloadReceiptIsNilForCachedImage { XCTestExpectation *expectation1 = [self expectationWithDescription:@"image 1 download should succeed"]; AFImageDownloadReceipt *receipt1; @@ -445,3 +558,24 @@ } @end + +#pragma mark - + +@implementation MockAFAutoPurgingImageCache + +-(BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier { + if (self.shouldCache) { + return self.shouldCache(image, request, identifier); + } + else { + return [super shouldCacheImage:image forRequest:request withAdditionalIdentifier:identifier]; + } +} + +-(void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier{ + [super addImage:image withIdentifier:identifier]; + if (self.addCache) { + self.addCache(image, identifier); + } +} +@end From a241b4fcdd42c40b653167501095a2795a4cac8a Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 15:46:45 -0500 Subject: [PATCH 12/69] Remove usage of XCTestExpectation.inverted (not supported) --- Tests/Tests/AFImageDownloaderTests.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/Tests/AFImageDownloaderTests.m b/Tests/Tests/AFImageDownloaderTests.m index c5b743a..9a94b86 100644 --- a/Tests/Tests/AFImageDownloaderTests.m +++ b/Tests/Tests/AFImageDownloaderTests.m @@ -291,8 +291,6 @@ - (void)testThatImageCacheIsPromptedShouldCacheNot { XCTestExpectation *expectation3 = [self expectationWithDescription:@"image 1 shouldCache called"]; - XCTestExpectation *expectation4 = [self expectationWithDescription:@"image 1 & 2 addCache NOT called"]; - expectation4.inverted = YES; MockAFAutoPurgingImageCache *mock = [[MockAFAutoPurgingImageCache alloc] init]; mock.shouldCache = ^BOOL(UIImage *img, NSURLRequest *req, NSString *iden) { From c69c109da8d7f1e65cd05ccaee3f5dbe54a5d92f Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 15:46:45 -0500 Subject: [PATCH 13/69] Remove usage of XCTestExpectation.inverted (not supported) --- Tests/Tests/AFImageDownloaderTests.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/Tests/AFImageDownloaderTests.m b/Tests/Tests/AFImageDownloaderTests.m index c5b743a..9a94b86 100644 --- a/Tests/Tests/AFImageDownloaderTests.m +++ b/Tests/Tests/AFImageDownloaderTests.m @@ -291,8 +291,6 @@ - (void)testThatImageCacheIsPromptedShouldCacheNot { XCTestExpectation *expectation3 = [self expectationWithDescription:@"image 1 shouldCache called"]; - XCTestExpectation *expectation4 = [self expectationWithDescription:@"image 1 & 2 addCache NOT called"]; - expectation4.inverted = YES; MockAFAutoPurgingImageCache *mock = [[MockAFAutoPurgingImageCache alloc] init]; mock.shouldCache = ^BOOL(UIImage *img, NSURLRequest *req, NSString *iden) { From 9b33c1699f3f94135fbc35cb06080cbfe9cf11d1 Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Fri, 28 Jul 2017 17:11:47 -0500 Subject: [PATCH 14/69] self in block --- UIKit+AFNetworking/AFImageDownloader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 1fbc523..36745b5 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -254,7 +254,7 @@ completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { dispatch_async(self.responseQueue, ^{ __strong __typeof__(weakSelf) strongSelf = weakSelf; - AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier]; + AFImageDownloaderMergedTask *mergedTask = strongSelf.mergedTasks[URLIdentifier]; if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) { mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier]; if (error) { From 75763005cb473908013a9d8473c94beff77541ce Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Mon, 18 Sep 2017 11:11:02 -0400 Subject: [PATCH 15/69] Modifies AFJSONObjectByRemovingKeysWithNullValues to remove NSArray null objects. --- AFNetworking/AFURLResponseSerialization.m | 4 +++- Tests/Tests/AFJSONSerializationTests.m | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AFNetworking/AFURLResponseSerialization.m b/AFNetworking/AFURLResponseSerialization.m index b7be3d4..bb378fa 100755 --- a/AFNetworking/AFURLResponseSerialization.m +++ b/AFNetworking/AFURLResponseSerialization.m @@ -64,7 +64,9 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO if ([JSONObject isKindOfClass:[NSArray class]]) { NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; for (id value in (NSArray *)JSONObject) { - [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + if (![value isEqual:[NSNull null]]) { + [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + } } return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; diff --git a/Tests/Tests/AFJSONSerializationTests.m b/Tests/Tests/AFJSONSerializationTests.m index d1b15e9..8be5bfe 100644 --- a/Tests/Tests/AFJSONSerializationTests.m +++ b/Tests/Tests/AFJSONSerializationTests.m @@ -177,7 +177,7 @@ static NSData * AFJSONTestData() { - (void)testThatJSONRemovesKeysWithNullValues { self.responseSerializer.removesKeysWithNullValues = YES; NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type":@"text/json"}]; - NSData *data = [NSJSONSerialization dataWithJSONObject:@{@"key":@"value",@"nullkey":[NSNull null],@"array":@[@{@"subnullkey":[NSNull null]}]} + NSData *data = [NSJSONSerialization dataWithJSONObject:@{@"key":@"value",@"nullkey":[NSNull null],@"array":@[@{@"subnullkey":[NSNull null]}], @"arrayWithNulls": @[[NSNull null]]} options:(NSJSONWritingOptions)0 error:nil]; @@ -189,6 +189,7 @@ static NSData * AFJSONTestData() { XCTAssertNotNil(responseObject[@"key"]); XCTAssertNil(responseObject[@"nullkey"]); XCTAssertNil(responseObject[@"array"][0][@"subnullkey"]); + XCTAssertEqualObjects(responseObject[@"arrayWithNulls"], @[]); } - (void)testThatJSONResponseSerializerCanBeCopied { From 3297dfe5f047fe78ceda8986bdd4194145459675 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Wed, 22 Nov 2017 23:47:31 -0500 Subject: [PATCH 16/69] Update security policy test certificates (#4103) --- AFNetworking.xcodeproj/project.pbxproj | 16 ++++++++-------- .../HTTPBinOrgServerTrustChain/httpbin_0.cer | Bin 1295 -> 1294 bytes .../HTTPBin.org/httpbinorg_02102018.cer | Bin 0 -> 1294 bytes .../HTTPBin.org/httpbinorg_08132017.cer | Bin 1295 -> 0 bytes Tests/Tests/AFSecurityPolicyTests.m | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 Tests/Resources/HTTPBin.org/httpbinorg_02102018.cer delete mode 100644 Tests/Resources/HTTPBin.org/httpbinorg_08132017.cer diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index 7feb916..a40878b 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -10,15 +10,15 @@ 1BF9F9601C87832B00F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; 1BF9F9611C87843200F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; 1BF9F9621C87843300F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; + 1F0EEE581FC5E7EC00DAF282 /* httpbinorg_02102018.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F0EEE571FC5E74A00DAF282 /* httpbinorg_02102018.cer */; }; + 1F0EEE591FC5E7F100DAF282 /* httpbinorg_02102018.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F0EEE571FC5E74A00DAF282 /* httpbinorg_02102018.cer */; }; + 1F0EEE5A1FC5E7F200DAF282 /* httpbinorg_02102018.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F0EEE571FC5E74A00DAF282 /* httpbinorg_02102018.cer */; }; 1F6F7DF71F17051000C979D0 /* DST Root CA X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF61F1703A100C979D0 /* DST Root CA X3.cer */; }; 1F6F7DF81F17051000C979D0 /* Let's Encrypt Authority X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF51F1703A100C979D0 /* Let's Encrypt Authority X3.cer */; }; - 1F6F7DF91F17051000C979D0 /* httpbinorg_08132017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF41F1703A100C979D0 /* httpbinorg_08132017.cer */; }; 1F6F7DFA1F17051000C979D0 /* DST Root CA X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF61F1703A100C979D0 /* DST Root CA X3.cer */; }; 1F6F7DFB1F17051000C979D0 /* Let's Encrypt Authority X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF51F1703A100C979D0 /* Let's Encrypt Authority X3.cer */; }; - 1F6F7DFC1F17051000C979D0 /* httpbinorg_08132017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF41F1703A100C979D0 /* httpbinorg_08132017.cer */; }; 1F6F7DFD1F17051100C979D0 /* DST Root CA X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF61F1703A100C979D0 /* DST Root CA X3.cer */; }; 1F6F7DFE1F17051100C979D0 /* Let's Encrypt Authority X3.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF51F1703A100C979D0 /* Let's Encrypt Authority X3.cer */; }; - 1F6F7DFF1F17051100C979D0 /* httpbinorg_08132017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F6F7DF41F1703A100C979D0 /* httpbinorg_08132017.cer */; }; 2960BAC31C1B2F1A00BA02F0 /* AFUIButtonTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */; }; 297824A31BC2D69A0041C395 /* adn_0.cer in Resources */ = {isa = PBXBuildFile; fileRef = 297824A01BC2D69A0041C395 /* adn_0.cer */; }; 297824A41BC2D69A0041C395 /* adn_0.cer in Resources */ = {isa = PBXBuildFile; fileRef = 297824A01BC2D69A0041C395 /* adn_0.cer */; }; @@ -225,7 +225,7 @@ /* Begin PBXFileReference section */ 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = ""; }; - 1F6F7DF41F1703A100C979D0 /* httpbinorg_08132017.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_08132017.cer; sourceTree = ""; }; + 1F0EEE571FC5E74A00DAF282 /* httpbinorg_02102018.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_02102018.cer; sourceTree = ""; }; 1F6F7DF51F1703A100C979D0 /* Let's Encrypt Authority X3.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Let's Encrypt Authority X3.cer"; sourceTree = ""; }; 1F6F7DF61F1703A100C979D0 /* DST Root CA X3.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DST Root CA X3.cer"; sourceTree = ""; }; 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = ""; }; @@ -401,7 +401,7 @@ 298D7CE21BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain */, 1F6F7DF61F1703A100C979D0 /* DST Root CA X3.cer */, 1F6F7DF51F1703A100C979D0 /* Let's Encrypt Authority X3.cer */, - 1F6F7DF41F1703A100C979D0 /* httpbinorg_08132017.cer */, + 1F0EEE571FC5E74A00DAF282 /* httpbinorg_02102018.cer */, ); path = HTTPBin.org; sourceTree = ""; @@ -831,11 +831,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1F0EEE5A1FC5E7F200DAF282 /* httpbinorg_02102018.cer in Resources */, 2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */, 2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */, 2987B0DF1BC40AFB00179A4C /* NoDomains.cer in Resources */, 2987B0D41BC40AE900179A4C /* adn_1.cer in Resources */, - 1F6F7DFF1F17051100C979D0 /* httpbinorg_08132017.cer in Resources */, 2987B0DD1BC40AFB00179A4C /* AltName.cer in Resources */, 2987B0D71BC40AF000179A4C /* HTTPBinOrgServerTrustChain in Resources */, 2987B0D31BC40AE900179A4C /* adn_0.cer in Resources */, @@ -857,11 +857,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1F0EEE581FC5E7EC00DAF282 /* httpbinorg_02102018.cer in Resources */, 298D7CBF1BC2CA9D00FD3B3E /* foobar.com.cer in Resources */, 298D7CBA1BC2CA9800FD3B3E /* logo.png in Resources */, 297824A31BC2D69A0041C395 /* adn_0.cer in Resources */, 298D7CE31BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */, - 1F6F7DF91F17051000C979D0 /* httpbinorg_08132017.cer in Resources */, 297824A71BC2D69A0041C395 /* adn_2.cer in Resources */, 297824A51BC2D69A0041C395 /* adn_1.cer in Resources */, 298D7CC01BC2CA9D00FD3B3E /* NoDomains.cer in Resources */, @@ -883,11 +883,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1F0EEE591FC5E7F100DAF282 /* httpbinorg_02102018.cer in Resources */, 298D7CBC1BC2CA9C00FD3B3E /* foobar.com.cer in Resources */, 298D7CB91BC2CA9800FD3B3E /* logo.png in Resources */, 297824A41BC2D69A0041C395 /* adn_0.cer in Resources */, 298D7CE41BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */, - 1F6F7DFC1F17051000C979D0 /* httpbinorg_08132017.cer in Resources */, 297824A81BC2D69A0041C395 /* adn_2.cer in Resources */, 297824A61BC2D69A0041C395 /* adn_1.cer in Resources */, 298D7CBD1BC2CA9C00FD3B3E /* NoDomains.cer in Resources */, diff --git a/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer b/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer index f2ee78266ef5c032bc4f0b9af540e5a5e658c879..0fe81041550bc2b37d5baabbed958567d57b155f 100644 GIT binary patch delta 669 zcmV;O0%HA-3XTdPFoFdNFoFZ}paTK{0s;~P&o1i*M2A#r9lcPpSx9FZYm88I<2 zGBPtWGB7n-7Y#8uFfuVPGBYzWFg1~zI)BBmN)^lf)HlS!kgB|{&GQd?)#yC-c@c+* zPCmYm^pVV+Q#MyDJ$6FtUeypbU6iTn>=0RJQm_gV7~D0BC6K%dID#MU7An<8ayV+* zEwZg7OXxk2Qq*9{(_oDyG)4QXiF26=vd}sj0@4Knp*rQZ`X+U%%%?n&7v4TV3x9bl z!v-wDB!6jft_2F}x-X>P0@cKLWi>^lPpujJ3$aRK^a|+J)4Bk987|RQY~hYM7*yLg z#RaXWI#_NJ56i*1ImYp4i^)lma#wwVBfpix-?)yxiceA52ZjhO5mGyg+~&}jVr!{v zD-+RxD9l=5>jYcaF}SHDXk5AhSr2}D0s{d60i%Kf958|c7?a`wNEFt@1z-0UP2h63 z4lNp&ZrrW>o_>=)0wNu61_&z#0R;sI0RaSKFkvt*1_&z#0R;sIFad@llYIgrv!DWR z0e@KJk!|q&K93?To@~BA{m?#8Pc!P(@vJi=mAwI8avEhnHA%sfAfLi`MJOo$p!`6H z+k06b%m|4&^=N5F=FtK{#s^Bs;f!wZ4mqYrk{sOtSDmE$do8|`-VfSyMYw~s=CxA`qt2$w2m%o)Qrqa2>%KV*{{VhD&|Or|Dyt7dVrYLY*B3vN2TmG?tCvd4Jc< z!GPd53!{#Gj3uGimrM0wA zG^`1$jEbV2VZl0E0Bt8Nags`Exhz7LPJ0s{d60i%Kf9Wa6d8I$4xNEH8Ou<#T{v-GT2 z2vMZ0+e{U<#b1*?0wNu71_&z#0R;sI0RaSLFk&z-1_&z#0R;sIFad@mlYIgr0WY(k z0&f9-NAlx!M^uV7>D4WIQ@}s0JqpIfd7zBi|Gq~(R2(bQ#-Vg-{E!{a z3@DrV+O`i2`EW~uL0sMx6%}Jam6}N_#bEn?9&7r@)_GE8921nVPW~v#cn>EeIjdE$ zw|Qav!T0M3nhaRy=MiRe=DtX1kfzb%G1@g%%uv;jM`uznqr54@m&VyS$Med9_xReq zt@{u;64Ywu4{T|z_zU^`_7Yl3K#MGHZS@uQ3jhY>J}a11h_Y>>`=3nudJ)9U@*M2~ FJW%01E3^Or diff --git a/Tests/Resources/HTTPBin.org/httpbinorg_02102018.cer b/Tests/Resources/HTTPBin.org/httpbinorg_02102018.cer new file mode 100644 index 0000000000000000000000000000000000000000..0fe81041550bc2b37d5baabbed958567d57b155f GIT binary patch literal 1294 zcmXqLV&yVuV*a#%nTe5!Nr?Hp-fK3O_K>W{Pdo0EYcKGXG2mt6)N1o+`_9YA$j!=N z;AO~dz{$oO%EBhh6dG(OW*`FMa0&DJq?V``E4bz*7gZLN7%Cemg2b7HrBK8b97{_w z@{2M{DitD(4dldm4b2S=4ULS9jg1UUqkvos10zENDAz#DP{cq8VhndiNl8IcW}aSt zQMy4BqY|>S7+D#Zn;7{SfZ|+CO^l2TM>lwhp8k8q{K%mRtM;rr`I<81m4fXZ zes=r%zf3$cH`pv($F|Jrb=*|}v)CysU%e5COb^4KFM(g;r0u{ZcDkb!NHEMDcre z4&0U6huL%vs?=u|u4CnTwM&1=eWt5NDpE~dm-w%h{KLJ`E9nc@i>sG+F;q$FT@1^4 z*k>sba@+hU>)Pd35qU!Vrw{J5JoYiY`=sZ@qVU=#<^59+-QUr-uggF1CVLx)u3(UL z_nl`KW+Y{=%+VIU*r0JHD&aLt^bNxuD^)ULb}>fQRWmU&GB7S~Vv;dvVv;c61BRe1 zKO^IR78YhE)&&N#AigRKDCRh{*%(<_*_j#PEG7dUkhCyJIgmfYBdqb? z#eE+XZRgXKnx1!O?Vovd2J#@q$}AEFVhtiIyt0y6YVYoPcF}VCGS}4ipI5wDXpj#x znURqt*&xwC55_lOY*PZosg=HdesXbvUS?j2ZiTU4PHIVUDkKeoqgo%Xo~cb4sy;cj zs04?4eFJrniv(E|4CI=S(@Yb8d3m`Waw2N{2U4lP()i7w@v{L38(VrK4h60d(%|H$22qs1`DVQS)iZLA9xEijI$)Ir_Pvh*6jLc#MXP|pC(=wA2 zOHvhb6Dt++^KvQ`l2R3lQgbp>Qxr-I^79muDiwlKb1F0Q(iH*{fyz^h6%zAOAWAdy z6cUq@^NUgv^O92)$}>wc6iPBuQH%}9&&f=#R7lG&1!_txQ2;rz7#Or@!Kq)AT999y zS(0B=sgIn4fEgQ@gBTeio=nXB@W-xSNq1h(K8L>->;n9aUtRsU##njkUdFg0sZ@JY z&x4Z{<{zqX)zJ9A;EzMc?dnMRGaQ``Ho~F{jlV9tx~}%Vs6iK#)9Z6wf1WyA^i;K% z`<8t@>$TAQ&#&UPyEM=JBzvxD2g|+at*et{k}kff6WSvd|99z=EwiN-MD$M9ad{@7 zdq12-ESLM*^xIRFoR}TXG~84!SR5RZ6SMlfBj=8-_V)`e`Xx%Y8g5DrU-h!Ps$}(( z_gg>9_L&^!ZoI#kzwFYA*F0*HrN2aWhD$g7z1(=`@r&P%Oa*FD>KgKQ!sjmeU9G!s e^5avAu2o0BcpaIocIDvFdyO}GOjkZAwFCfSSJ6WN literal 0 HcmV?d00001 diff --git a/Tests/Resources/HTTPBin.org/httpbinorg_08132017.cer b/Tests/Resources/HTTPBin.org/httpbinorg_08132017.cer deleted file mode 100644 index f2ee78266ef5c032bc4f0b9af540e5a5e658c879..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1295 zcmXqLV&yhyV*b2Rh;S%QcNi9(?R&dQrE~+djF;q5C1c@^XOQDD>IF^=V z$h9*$1ftaC)fe^$P?u?R>f~3qmz5Jqd zgC<5LWM?t5GB7tW@-qO%xtN+585wSWKD*?o%TMk9lI;<~v9b4sZgO5`dHuZ6Y?Y_4 ztao1ira3bfyy#mJ+Iz|4>Qa8D=eHIv$hsY*qaHMQruq5TPfT_vzy7|)Yhb;;3|Kcho~Vh+Fsi^TENTmWx<2QrG&juW9Z0U_Wj7*FMjnCM)f#Jf! z*mNHl3_$)h12vednHa^Spsr3XC`Na!LE~z;LMDU8c|47?Lozap6`X=87E(+dkFEhpBFb^s>E^e>K!_ z-q%WRyKHx%uGrgW@zI3_Z_|D;9}LazW3n|NGo+ zLu9lsA6rUPDPwk@#zvZ%jow!yRlqw@U zWrN>8jguAp>MEA2LpN-%O#FTD`)iI_JQ2^I3#Ju6+vkxnVcEq;hPO;Z&jeiUcTW#8 zSiDE`@bqIhEsuXb)%5+xt-Wi13s?$W$$G}0lezW>_s>7ygrdA0x^?n$zlwh2W?*|_ ar#&O2V^i*;-}8NbRS6zB`$^`lO#lGVCf0@k diff --git a/Tests/Tests/AFSecurityPolicyTests.m b/Tests/Tests/AFSecurityPolicyTests.m index 2ebbd80..953b2c7 100644 --- a/Tests/Tests/AFSecurityPolicyTests.m +++ b/Tests/Tests/AFSecurityPolicyTests.m @@ -58,7 +58,7 @@ static SecTrustRef AFUTADNNetServerTrust() { } static SecCertificateRef AFUTHTTPBinOrgCertificate() { - NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_08132017" ofType:@"cer"]; + NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_02102018" ofType:@"cer"]; NSCAssert(certPath != nil, @"Path for certificate should not be nil"); NSData *certData = [NSData dataWithContentsOfFile:certPath]; From 1f2ffbb41b689b4ba1594714820a4c7111bcef92 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Thu, 23 Nov 2017 00:05:16 -0500 Subject: [PATCH 17/69] Update project settings to Xcode 9.1 defaults. --- AFNetworking.xcodeproj/project.pbxproj | 20 +++++++- .../xcschemes/AFNetworking OS X.xcscheme | 4 +- .../xcschemes/AFNetworking iOS.xcscheme | 8 +-- .../xcschemes/AFNetworking tvOS.xcscheme | 10 ++-- .../xcschemes/AFNetworking watchOS.xcscheme | 4 +- .../project.pbxproj | 51 ++++++++++++++++++- .../xcschemes/OS X Example.xcscheme | 14 ++++- .../Today Extension Example.xcscheme | 14 ++++- .../xcschemes/iOS Example.xcscheme | 14 ++++- .../xcschemes/tvOS Example.xcscheme | 14 ++++- .../xcschemes/watchOS Example.xcscheme | 4 +- 11 files changed, 141 insertions(+), 16 deletions(-) diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index 2120c91..6713220 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -776,7 +776,7 @@ 299522301BBF104D00859F49 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = AFNetworking; TargetAttributes = { 2987B0A41BC408A200179A4C = { @@ -1100,6 +1100,7 @@ 2987B0B61BC408A200179A4C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; @@ -1123,6 +1124,7 @@ 2987B0B71BC408A200179A4C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; @@ -1238,7 +1240,9 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -1248,10 +1252,14 @@ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; @@ -1312,7 +1320,9 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -1322,10 +1332,14 @@ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; @@ -1374,6 +1388,7 @@ 299522421BBF104D00859F49 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1396,6 +1411,7 @@ 299522431BBF104D00859F49 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1464,6 +1480,7 @@ 2995227D1BBF136400859F49 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COMBINE_HIDPI_IMAGES = YES; @@ -1489,6 +1506,7 @@ 2995227E1BBF136400859F49 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COMBINE_HIDPI_IMAGES = YES; diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme index a03e886..f7bb4dd 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme @@ -1,6 +1,6 @@ @@ -68,6 +69,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme index e4fb085..53e858d 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES"> @@ -88,6 +89,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme index dca989f..85776e2 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme @@ -1,6 +1,6 @@ + enableAddressSanitizer = "YES" + language = "" + shouldUseLaunchSchemeArgsEnv = "NO"> @@ -78,11 +79,12 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableThreadSanitizer = "YES" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" - enableThreadSanitizer = "YES" stopOnEveryThreadSanitizerIssue = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme index f38ee58..04419c4 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Example/AFNetworking Example.xcodeproj/project.pbxproj b/Example/AFNetworking Example.xcodeproj/project.pbxproj index 3e883ca..b1acb2a 100644 --- a/Example/AFNetworking Example.xcodeproj/project.pbxproj +++ b/Example/AFNetworking Example.xcodeproj/project.pbxproj @@ -500,7 +500,7 @@ 29E6F16B1BB9DA2E00A4466C /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0910; TargetAttributes = { 291BFDB81BB9E85400FFB029 = { CreatedOnToolsVersion = 7.1; @@ -1074,12 +1074,61 @@ 29E6F16F1BB9DA2E00A4466C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; }; name = Debug; }; 29E6F1701BB9DA2E00A4466C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme index f02f6a4..674e9b3 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + @@ -87,6 +88,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" From 00addee8a11a21b3a32b140f404d7443664b1e4f Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Thu, 23 Nov 2017 00:05:25 -0500 Subject: [PATCH 18/69] Fix analyzer warning about mutable copies. --- AFNetworking/AFURLRequestSerialization.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AFNetworking/AFURLRequestSerialization.m b/AFNetworking/AFURLRequestSerialization.m index 68c2c2d..a4d5d9d 100644 --- a/AFNetworking/AFURLRequestSerialization.m +++ b/AFNetworking/AFURLRequestSerialization.m @@ -679,6 +679,11 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; return self; } +- (void)setRequest:(NSMutableURLRequest *)request +{ + _request = [request mutableCopy]; +} + - (BOOL)appendPartWithFileURL:(NSURL *)fileURL name:(NSString *)name error:(NSError * __autoreleasing *)error From 20ff51cb8eeaaf3df582d6d9bb94fa11ab67cebe Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Thu, 23 Nov 2017 00:05:43 -0500 Subject: [PATCH 19/69] Fix analyzer warning about NULL dereference. --- Tests/Tests/AFHTTPRequestSerializationTests.m | 4 +++- Tests/Tests/AFHTTPSessionManagerTests.m | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Tests/Tests/AFHTTPRequestSerializationTests.m b/Tests/Tests/AFHTTPRequestSerializationTests.m index a81c632..2d9ef13 100644 --- a/Tests/Tests/AFHTTPRequestSerializationTests.m +++ b/Tests/Tests/AFHTTPRequestSerializationTests.m @@ -169,7 +169,9 @@ NSError *serializerError = [NSError errorWithDomain:@"TestDomain" code:0 userInfo:nil]; [serializer setQueryStringSerializationWithBlock:^NSString *(NSURLRequest *request, NSDictionary *parameters, NSError *__autoreleasing *error) { - *error = serializerError; + if (error != NULL) { + *error = serializerError; + } return nil; }]; diff --git a/Tests/Tests/AFHTTPSessionManagerTests.m b/Tests/Tests/AFHTTPSessionManagerTests.m index 48da645..6fbbdf2 100644 --- a/Tests/Tests/AFHTTPSessionManagerTests.m +++ b/Tests/Tests/AFHTTPSessionManagerTests.m @@ -178,7 +178,9 @@ XCTestExpectation *expectation = [self expectationWithDescription:@"Serialization should fail"]; [self.manager.requestSerializer setQueryStringSerializationWithBlock:^NSString * _Nonnull(NSURLRequest * _Nonnull request, id _Nonnull parameters, NSError * _Nullable __autoreleasing * _Nullable error) { - *error = [NSError errorWithDomain:@"Custom" code:-1 userInfo:nil]; + if (error != NULL) { + *error = [NSError errorWithDomain:@"Custom" code:-1 userInfo:nil]; + } return @""; }]; From f45a3abf087798f30d7b6a578c9b76082614c7c5 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Thu, 23 Nov 2017 00:05:51 -0500 Subject: [PATCH 20/69] Fix analyzer warning about memory leak. --- Tests/Tests/AFSecurityPolicyTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/AFSecurityPolicyTests.m b/Tests/Tests/AFSecurityPolicyTests.m index 953b2c7..8ef0c7d 100644 --- a/Tests/Tests/AFSecurityPolicyTests.m +++ b/Tests/Tests/AFSecurityPolicyTests.m @@ -32,7 +32,7 @@ static SecTrustRef AFUTTrustChainForCertsInDirectory(NSString *directoryPath) { for (NSString *path in certFileNames) { NSData *certData = [NSData dataWithContentsOfFile:[directoryPath stringByAppendingPathComponent:path]]; SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData)); - [certs addObject:(__bridge id)(cert)]; + [certs addObject:(__bridge_transfer id)(cert)]; } SecPolicyRef policy = SecPolicyCreateBasicX509(); From 4b64a60d4b6a2bcd4c54646d6e9028222de8b9c8 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Thu, 23 Nov 2017 00:19:44 -0500 Subject: [PATCH 21/69] =?UTF-8?q?Change=20=E2=80=9COS=20X=E2=80=9D=20to=20?= =?UTF-8?q?=E2=80=9CmacOS=E2=80=9D=20across=20the=20board.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also change the “Today Extension Example” to specify iOS now that macOS has those too. --- AFNetworking.xcodeproj/project.pbxproj | 28 +++++----- ...X.xcscheme => AFNetworking macOS.xcscheme} | 12 ++--- .../project.pbxproj | 52 +++++++++---------- ...e => iOS Today Extension Example.xcscheme} | 4 +- ...xample.xcscheme => macOS Example.xcscheme} | 24 ++++----- .../AppDelegate.h | 0 .../AppDelegate.m | 0 .../AppIcon.appiconset/Contents.json | 0 .../Info.plist | 0 .../MainMenu.xib | 31 +++++------ .../{OS X Example => macOS Example}/main.m | 0 Framework/Info.plist | 4 +- README.md | 8 +-- 13 files changed, 82 insertions(+), 81 deletions(-) rename AFNetworking.xcodeproj/xcshareddata/xcschemes/{AFNetworking OS X.xcscheme => AFNetworking macOS.xcscheme} (92%) rename Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/{Today Extension Example.xcscheme => iOS Today Extension Example.xcscheme} (97%) rename Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/{OS X Example.xcscheme => macOS Example.xcscheme} (86%) rename Example/{OS X Example => macOS Example}/AppDelegate.h (100%) rename Example/{OS X Example => macOS Example}/AppDelegate.m (100%) rename Example/{OS X Example => macOS Example}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename Example/{OS X Example => macOS Example}/Info.plist (100%) rename Example/{OS X Example => macOS Example}/MainMenu.xib (94%) rename Example/{OS X Example => macOS Example}/main.m (100%) diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index 6713220..976d11f 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -239,7 +239,7 @@ 2987B0A51BC408A200179A4C /* AFNetworking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AFNetworking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2987B0AE1BC408A200179A4C /* AFNetworking tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking Mac OS X Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 298D7C771BC2C88F00FD3B3E /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; 298D7C791BC2C88F00FD3B3E /* AltName.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AltName.cer; sourceTree = ""; }; 298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = foobar.com.cer; sourceTree = ""; }; @@ -489,7 +489,7 @@ 299522651BBF129200859F49 /* AFNetworking.framework */, 299522771BBF136400859F49 /* AFNetworking.framework */, 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */, - 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */, + 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */, 2987B0A51BC408A200179A4C /* AFNetworking.framework */, 2987B0AE1BC408A200179A4C /* AFNetworking tvOS Tests.xctest */, ); @@ -698,9 +698,9 @@ productReference = 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */ = { + 298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */; + buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */; buildPhases = ( 298D7C461BC2C7B200FD3B3E /* Sources */, 298D7C471BC2C7B200FD3B3E /* Frameworks */, @@ -711,9 +711,9 @@ dependencies = ( 298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */, ); - name = "AFNetworking Mac OS X Tests"; + name = "AFNetworking macOS Tests"; productName = "AFNetworking Mac OS X Tests"; - productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */; + productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 299522381BBF104D00859F49 /* AFNetworking iOS */ = { @@ -752,9 +752,9 @@ productReference = 299522651BBF129200859F49 /* AFNetworking.framework */; productType = "com.apple.product-type.framework"; }; - 299522761BBF136400859F49 /* AFNetworking OS X */ = { + 299522761BBF136400859F49 /* AFNetworking macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */; + buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */; buildPhases = ( 299522721BBF136400859F49 /* Sources */, 299522731BBF136400859F49 /* Frameworks */, @@ -765,7 +765,7 @@ ); dependencies = ( ); - name = "AFNetworking OS X"; + name = "AFNetworking macOS"; productName = "AFNetworking OS X"; productReference = 299522771BBF136400859F49 /* AFNetworking.framework */; productType = "com.apple.product-type.framework"; @@ -818,10 +818,10 @@ targets = ( 299522381BBF104D00859F49 /* AFNetworking iOS */, 299522641BBF129200859F49 /* AFNetworking watchOS */, - 299522761BBF136400859F49 /* AFNetworking OS X */, + 299522761BBF136400859F49 /* AFNetworking macOS */, 2987B0A41BC408A200179A4C /* AFNetworking tvOS */, 298D7C3A1BC2C79500FD3B3E /* AFNetworking iOS Tests */, - 298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */, + 298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */, 2987B0AD1BC408A200179A4C /* AFNetworking tvOS Tests */, ); }; @@ -1091,7 +1091,7 @@ }; 298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 299522761BBF136400859F49 /* AFNetworking OS X */; + target = 299522761BBF136400859F49 /* AFNetworking macOS */; targetProxy = 298D7C501BC2C7B200FD3B3E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -1559,7 +1559,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */ = { + 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 298D7C531BC2C7B200FD3B3E /* Debug */, @@ -1595,7 +1595,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */ = { + 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 2995227D1BBF136400859F49 /* Debug */, diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking macOS.xcscheme similarity index 92% rename from AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme rename to AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking macOS.xcscheme index f7bb4dd..0517056 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking OS X.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking macOS.xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "299522761BBF136400859F49" BuildableName = "AFNetworking.framework" - BlueprintName = "AFNetworking OS X" + BlueprintName = "AFNetworking macOS" ReferencedContainer = "container:AFNetworking.xcodeproj"> @@ -35,8 +35,8 @@ @@ -51,7 +51,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "299522761BBF136400859F49" BuildableName = "AFNetworking.framework" - BlueprintName = "AFNetworking OS X" + BlueprintName = "AFNetworking macOS" ReferencedContainer = "container:AFNetworking.xcodeproj"> @@ -81,7 +81,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "299522761BBF136400859F49" BuildableName = "AFNetworking.framework" - BlueprintName = "AFNetworking OS X" + BlueprintName = "AFNetworking macOS" ReferencedContainer = "container:AFNetworking.xcodeproj"> @@ -99,7 +99,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "299522761BBF136400859F49" BuildableName = "AFNetworking.framework" - BlueprintName = "AFNetworking OS X" + BlueprintName = "AFNetworking macOS" ReferencedContainer = "container:AFNetworking.xcodeproj"> diff --git a/Example/AFNetworking Example.xcodeproj/project.pbxproj b/Example/AFNetworking Example.xcodeproj/project.pbxproj index b1acb2a..52055bf 100644 --- a/Example/AFNetworking Example.xcodeproj/project.pbxproj +++ b/Example/AFNetworking Example.xcodeproj/project.pbxproj @@ -38,7 +38,7 @@ 29E6F1E91BB9E37200A4466C /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29E6F1E81BB9E37200A4466C /* NotificationCenter.framework */; }; 29E6F1ED1BB9E37200A4466C /* TodayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1EC1BB9E37200A4466C /* TodayViewController.m */; }; 29E6F1F01BB9E37200A4466C /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29E6F1EE1BB9E37200A4466C /* MainInterface.storyboard */; }; - 29E6F1F41BB9E37200A4466C /* Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 29E6F1F41BB9E37200A4466C /* iOS Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 29E6F1F91BB9E56200A4466C /* Post.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19A1BB9DD7300A4466C /* Post.m */; }; 29E6F1FA1BB9E56500A4466C /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19C1BB9DD7300A4466C /* User.m */; }; C2BFE0251C11870800BB258D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2BFE0241C11870800BB258D /* AppDelegate.m */; }; @@ -87,7 +87,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( - 29E6F1F41BB9E37200A4466C /* Today Extension Example.appex in Embed App Extensions */, + 29E6F1F41BB9E37200A4466C /* iOS Today Extension Example.appex in Embed App Extensions */, ); name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; @@ -108,7 +108,7 @@ /* Begin PBXFileReference section */ 291BFDB91BB9E85400FFB029 /* watchOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "watchOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "watchOS Example Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; - 291BFDE71BB9E8C700FFB029 /* OS X Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OS X Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 291BFDE71BB9E8C700FFB029 /* macOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "macOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 291BFDED1BB9E8C700FFB029 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 291BFDF21BB9E8C700FFB029 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 291BFDF71BB9E8C700FFB029 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -137,7 +137,7 @@ 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAppDotNetAPIClient.m; sourceTree = ""; }; 29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29E6F1E01BB9E03600A4466C /* Launchscreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Launchscreen.storyboard; path = "iOS Example/Launchscreen.storyboard"; sourceTree = SOURCE_ROOT; }; - 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Today Extension Example.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "iOS Today Extension Example.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 29E6F1E81BB9E37200A4466C /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; 29E6F1EB1BB9E37200A4466C /* TodayViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TodayViewController.h; sourceTree = ""; }; 29E6F1EC1BB9E37200A4466C /* TodayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TodayViewController.m; sourceTree = ""; }; @@ -205,7 +205,7 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 291BFDE81BB9E8C700FFB029 /* OS X Example */ = { + 291BFDE81BB9E8C700FFB029 /* macOS Example */ = { isa = PBXGroup; children = ( C2BFE0231C11870800BB258D /* AppDelegate.h */, @@ -215,7 +215,7 @@ 291BFDF71BB9E8C700FFB029 /* Info.plist */, 291BFDEC1BB9E8C700FFB029 /* Supporting Files */, ); - path = "OS X Example"; + path = "macOS Example"; sourceTree = ""; }; 291BFDEC1BB9E8C700FFB029 /* Supporting Files */ = { @@ -267,7 +267,7 @@ 29E6F1EA1BB9E37200A4466C /* Today Extension Example */, 29E6F20F1BB9E76A00A4466C /* watchOS Example */, 29E6F21E1BB9E76A00A4466C /* watchOS Example Extension */, - 291BFDE81BB9E8C700FFB029 /* OS X Example */, + 291BFDE81BB9E8C700FFB029 /* macOS Example */, 291BFE161BB9ECEE00FFB029 /* tvOS Example */, 29E6F1E71BB9E37200A4466C /* Frameworks */, 29E6F1761BB9DCB500A4466C /* Products */, @@ -281,10 +281,10 @@ isa = PBXGroup; children = ( 29E6F1751BB9DCB500A4466C /* iOS Example.app */, - 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */, + 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */, 291BFDB91BB9E85400FFB029 /* watchOS Example.app */, 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */, - 291BFDE71BB9E8C700FFB029 /* OS X Example.app */, + 291BFDE71BB9E8C700FFB029 /* macOS Example.app */, 291BFE151BB9ECEE00FFB029 /* tvOS Example.app */, ); name = Products; @@ -422,9 +422,9 @@ productReference = 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */; productType = "com.apple.product-type.watchkit2-extension"; }; - 291BFDE61BB9E8C700FFB029 /* OS X Example */ = { + 291BFDE61BB9E8C700FFB029 /* macOS Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */; + buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */; buildPhases = ( 291BFDE31BB9E8C700FFB029 /* Sources */, 291BFDE41BB9E8C700FFB029 /* Frameworks */, @@ -434,9 +434,9 @@ ); dependencies = ( ); - name = "OS X Example"; + name = "macOS Example"; productName = "OS X Example"; - productReference = 291BFDE71BB9E8C700FFB029 /* OS X Example.app */; + productReference = 291BFDE71BB9E8C700FFB029 /* macOS Example.app */; productType = "com.apple.product-type.application"; }; 291BFE141BB9ECEE00FFB029 /* tvOS Example */ = { @@ -477,9 +477,9 @@ productReference = 29E6F1751BB9DCB500A4466C /* iOS Example.app */; productType = "com.apple.product-type.application"; }; - 29E6F1E51BB9E37200A4466C /* Today Extension Example */ = { + 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */; + buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */; buildPhases = ( 29E6F1E21BB9E37200A4466C /* Sources */, 29E6F1E31BB9E37200A4466C /* Frameworks */, @@ -489,9 +489,9 @@ ); dependencies = ( ); - name = "Today Extension Example"; + name = "iOS Today Extension Example"; productName = "Today Extension Example"; - productReference = 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */; + productReference = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */; productType = "com.apple.product-type.app-extension"; }; /* End PBXNativeTarget section */ @@ -537,10 +537,10 @@ projectRoot = ""; targets = ( 29E6F1741BB9DCB500A4466C /* iOS Example */, - 29E6F1E51BB9E37200A4466C /* Today Extension Example */, + 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */, 291BFDB81BB9E85400FFB029 /* watchOS Example */, 291BFDC41BB9E85500FFB029 /* watchOS Example Extension */, - 291BFDE61BB9E8C700FFB029 /* OS X Example */, + 291BFDE61BB9E8C700FFB029 /* macOS Example */, 291BFE141BB9ECEE00FFB029 /* tvOS Example */, ); }; @@ -668,7 +668,7 @@ }; 29E6F1F31BB9E37200A4466C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 29E6F1E51BB9E37200A4466C /* Today Extension Example */; + target = 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */; targetProxy = 29E6F1F21BB9E37200A4466C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -921,12 +921,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "OS X Example/Info.plist"; + INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -964,11 +964,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "OS X Example/Info.plist"; + INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -1333,7 +1333,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */ = { + 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 291BFDF91BB9E8C700FFB029 /* Debug */, @@ -1369,7 +1369,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */ = { + 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 29E6F1F61BB9E37200A4466C /* Debug */, diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/Today Extension Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Today Extension Example.xcscheme similarity index 97% rename from Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/Today Extension Example.xcscheme rename to Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Today Extension Example.xcscheme index 4956a83..8d190cf 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/Today Extension Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Today Extension Example.xcscheme @@ -30,8 +30,8 @@ diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/macOS Example.xcscheme similarity index 86% rename from Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme rename to Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/macOS Example.xcscheme index 674e9b3..b9b6290 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/OS X Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/macOS Example.xcscheme @@ -15,8 +15,8 @@ @@ -29,8 +29,8 @@ @@ -48,8 +48,8 @@ @@ -58,8 +58,8 @@ @@ -82,8 +82,8 @@ @@ -101,8 +101,8 @@ diff --git a/Example/OS X Example/AppDelegate.h b/Example/macOS Example/AppDelegate.h similarity index 100% rename from Example/OS X Example/AppDelegate.h rename to Example/macOS Example/AppDelegate.h diff --git a/Example/OS X Example/AppDelegate.m b/Example/macOS Example/AppDelegate.m similarity index 100% rename from Example/OS X Example/AppDelegate.m rename to Example/macOS Example/AppDelegate.m diff --git a/Example/OS X Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/macOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/OS X Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Example/macOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/OS X Example/Info.plist b/Example/macOS Example/Info.plist similarity index 100% rename from Example/OS X Example/Info.plist rename to Example/macOS Example/Info.plist diff --git a/Example/OS X Example/MainMenu.xib b/Example/macOS Example/MainMenu.xib similarity index 94% rename from Example/OS X Example/MainMenu.xib rename to Example/macOS Example/MainMenu.xib index 9ec30ca..9b662b4 100644 --- a/Example/OS X Example/MainMenu.xib +++ b/Example/macOS Example/MainMenu.xib @@ -1,7 +1,9 @@ - - + + - + + + @@ -13,10 +15,10 @@ - - + + - + @@ -31,7 +33,7 @@ - + @@ -50,7 +52,7 @@ - + @@ -148,7 +150,7 @@ - + @@ -158,11 +160,11 @@ - - + + - + @@ -176,13 +178,13 @@ - + - + @@ -261,7 +263,6 @@ -