Compare commits
1 Commits
master
...
0xced/debu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
038eee9aa5 |
@ -1,2 +0,0 @@
|
||||
ignore:
|
||||
- "Tests"
|
||||
38
.travis.yml
38
.travis.yml
@ -1,5 +1,5 @@
|
||||
language: objective-c
|
||||
osx_image: xcode11
|
||||
osx_image: xcode7.1
|
||||
sudo: false
|
||||
env:
|
||||
global:
|
||||
@ -9,29 +9,25 @@ env:
|
||||
- FASTLANE_LANE=ci_commit
|
||||
matrix:
|
||||
include:
|
||||
- osx_image: xcode11
|
||||
- osx_image: xcode8
|
||||
env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default
|
||||
- osx_image: xcode11
|
||||
env: FASTLANE_ENV=ios13_xcode11
|
||||
- osx_image: xcode11
|
||||
env: FASTLANE_ENV=tvos13_xcode11
|
||||
- osx_image: xcode11
|
||||
- osx_image: xcode8
|
||||
env: FASTLANE_ENV=ios10_xcode8
|
||||
- osx_image: xcode8
|
||||
env: FASTLANE_ENV=tvos10_xcode8
|
||||
- osx_image: xcode8
|
||||
env: FASTLANE_ENV=osx
|
||||
- osx_image: xcode10
|
||||
env: FASTLANE_ENV=ios12_xcode10
|
||||
- osx_image: xcode9.4
|
||||
env: FASTLANE_ENV=ios11_xcode94
|
||||
- osx_image: xcode9.3
|
||||
env: FASTLANE_ENV=ios11_xcode93
|
||||
- osx_image: xcode9.2
|
||||
env: FASTLANE_ENV=ios11_xcode92
|
||||
- osx_image: xcode9.1
|
||||
env: FASTLANE_ENV=ios11_xcode91
|
||||
- osx_image: xcode9
|
||||
env: FASTLANE_ENV=ios11_xcode9
|
||||
- osx_image: xcode7.3
|
||||
env: FASTLANE_ENV=ios93_xcode73
|
||||
- osx_image: xcode7.3
|
||||
env: FASTLANE_ENV=ios81_xcode73
|
||||
before_install:
|
||||
- gem install fastlane --no-document --quiet
|
||||
- gem install cocoapods --no-document --quiet
|
||||
# Force bundler 1.12.5 because version 1.13 has issues, see https://github.com/fastlane/fastlane/issues/6065#issuecomment-246044617
|
||||
- gem uninstall bundler -v '>1.12.5' --force || echo "bundler >1.12.5 is not installed"
|
||||
- gem install bundler -v 1.12.5 --no-rdoc --no-ri --no-document --quiet
|
||||
- gem install fastlane --no-rdoc --no-ri --no-document --quiet
|
||||
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
script:
|
||||
- set -o pipefail
|
||||
- fastlane $FASTLANE_LANE configuration:Debug --env $FASTLANE_ENV
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'AFNetworking'
|
||||
s.version = '3.2.1'
|
||||
s.version = '3.1.0'
|
||||
s.license = 'MIT'
|
||||
s.summary = 'A delightful iOS and OS X networking framework.'
|
||||
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
|
||||
@ -27,7 +27,7 @@ Pod::Spec.new do |s|
|
||||
EOS
|
||||
s.prefix_header_contents = pch_AF
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.ios.deployment_target = '7.0'
|
||||
s.osx.deployment_target = '10.9'
|
||||
s.watchos.deployment_target = '2.0'
|
||||
s.tvos.deployment_target = '9.0'
|
||||
@ -47,7 +47,7 @@ EOS
|
||||
end
|
||||
|
||||
s.subspec 'Reachability' do |ss|
|
||||
ss.ios.deployment_target = '8.0'
|
||||
ss.ios.deployment_target = '7.0'
|
||||
ss.osx.deployment_target = '10.9'
|
||||
ss.tvos.deployment_target = '9.0'
|
||||
|
||||
@ -64,12 +64,12 @@ EOS
|
||||
ss.tvos.dependency 'AFNetworking/Reachability'
|
||||
ss.dependency 'AFNetworking/Security'
|
||||
|
||||
ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}', 'AFNetworking/AFCompatibilityMacros.h'
|
||||
ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h', 'AFNetworking/AFCompatibilityMacros.h'
|
||||
ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}'
|
||||
ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h'
|
||||
end
|
||||
|
||||
s.subspec 'UIKit' do |ss|
|
||||
ss.ios.deployment_target = '8.0'
|
||||
ss.ios.deployment_target = '7.0'
|
||||
ss.tvos.deployment_target = '9.0'
|
||||
ss.dependency 'AFNetworking/NSURLSession'
|
||||
|
||||
|
||||
@ -3,20 +3,16 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 47;
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
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 */; };
|
||||
1F8482C0220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
|
||||
1F8482C1220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
|
||||
1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
|
||||
1F96D2A4203649560085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
1F96D2A5203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
1F96D2A6203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
1F96D2A7203649580085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
1FE783011C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */; };
|
||||
1FE783021C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */; };
|
||||
1FE783031C5857A200A73B7C /* httpbinorg_01192017.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1FE783001C58579D00A73B7C /* httpbinorg_01192017.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 */; };
|
||||
@ -58,6 +54,9 @@
|
||||
2987B0D51BC40AE900179A4C /* adn_2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 297824A21BC2D69A0041C395 /* adn_2.cer */; };
|
||||
2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */ = {isa = PBXBuildFile; fileRef = 298D7CDF1BC2CB5A00FD3B3E /* ADNNetServerTrustChain */; };
|
||||
2987B0D71BC40AF000179A4C /* HTTPBinOrgServerTrustChain in Resources */ = {isa = PBXBuildFile; fileRef = 298D7CE21BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain */; };
|
||||
2987B0D81BC40AF300179A4C /* AddTrust_External_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */; };
|
||||
2987B0D91BC40AF300179A4C /* COMODO_RSA_Certification_Authority.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */; };
|
||||
2987B0DA1BC40AF300179A4C /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */; };
|
||||
2987B0DC1BC40AF600179A4C /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C771BC2C88F00FD3B3E /* logo.png */; };
|
||||
2987B0DD1BC40AFB00179A4C /* AltName.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C791BC2C88F00FD3B3E /* AltName.cer */; };
|
||||
2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */; };
|
||||
@ -81,6 +80,12 @@
|
||||
298D7CBE1BC2CA9D00FD3B3E /* AltName.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C791BC2C88F00FD3B3E /* AltName.cer */; };
|
||||
298D7CBF1BC2CA9D00FD3B3E /* foobar.com.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */; };
|
||||
298D7CC01BC2CA9D00FD3B3E /* NoDomains.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C7B1BC2C88F00FD3B3E /* NoDomains.cer */; };
|
||||
298D7CC11BC2CAA100FD3B3E /* AddTrust_External_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */; };
|
||||
298D7CC21BC2CAA100FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */; };
|
||||
298D7CC31BC2CAA100FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */; };
|
||||
298D7CC51BC2CAA200FD3B3E /* AddTrust_External_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */; };
|
||||
298D7CC61BC2CAA200FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */; };
|
||||
298D7CC71BC2CAA200FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */; };
|
||||
298D7CD31BC2CAE800FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */; };
|
||||
298D7CD41BC2CAE900FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */; };
|
||||
298D7CD51BC2CAEC00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */; };
|
||||
@ -171,10 +176,6 @@
|
||||
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 */; };
|
||||
@ -196,18 +197,6 @@
|
||||
5F4323DD1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
|
||||
5F4323DE1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
|
||||
5F4323DF1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
|
||||
E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
|
||||
E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
|
||||
E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
|
||||
E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
|
||||
E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
|
||||
E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
|
||||
E2B10D94233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
|
||||
E2B10D95233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
|
||||
E2B10D96233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
|
||||
E91164651DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
|
||||
E91164661DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
|
||||
E91164671DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -236,8 +225,7 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = "<group>"; };
|
||||
1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFCompatibilityMacros.h; sourceTree = "<group>"; };
|
||||
1F8482BF220F386200718111 /* httpbinorg_03172020.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_03172020.cer; sourceTree = "<group>"; };
|
||||
1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_01192017.cer; sourceTree = "<group>"; };
|
||||
2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = "<group>"; };
|
||||
297824A01BC2D69A0041C395 /* adn_0.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_0.cer; path = ADNNetServerTrustChain/adn_0.cer; sourceTree = "<group>"; };
|
||||
297824A11BC2D69A0041C395 /* adn_1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_1.cer; path = ADNNetServerTrustChain/adn_1.cer; sourceTree = "<group>"; };
|
||||
@ -245,7 +233,10 @@
|
||||
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 macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking macOS 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; };
|
||||
298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AddTrust_External_CA_Root.cer; sourceTree = "<group>"; };
|
||||
298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Certification_Authority.cer; sourceTree = "<group>"; };
|
||||
298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Domain_Validation_Secure_Server_CA.cer; sourceTree = "<group>"; };
|
||||
298D7C771BC2C88F00FD3B3E /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
|
||||
298D7C791BC2C88F00FD3B3E /* AltName.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AltName.cer; sourceTree = "<group>"; };
|
||||
298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = foobar.com.cer; sourceTree = "<group>"; };
|
||||
@ -307,8 +298,6 @@
|
||||
2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = "<group>"; };
|
||||
29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCompoundResponseSerializerTests.m; sourceTree = "<group>"; };
|
||||
29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIWebViewTests.m; sourceTree = "<group>"; };
|
||||
2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLParserResponseSerializerTests.m; sourceTree = "<group>"; };
|
||||
2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLDocumentResponseSerializerTests.m; sourceTree = "<group>"; };
|
||||
5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Equifax_Secure_Certificate_Authority_Root.cer; sourceTree = "<group>"; };
|
||||
5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "GeoTrust_Global_CA-cross.cer"; sourceTree = "<group>"; };
|
||||
5F4323B51BF63741003B8749 /* google.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.com.cer; sourceTree = "<group>"; };
|
||||
@ -316,10 +305,6 @@
|
||||
5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath1; sourceTree = "<group>"; };
|
||||
5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath2; sourceTree = "<group>"; };
|
||||
5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GeoTrust_Global_CA_Root.cer; sourceTree = "<group>"; };
|
||||
E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Starfield Services Root Certificate Authority - G2.cer"; sourceTree = "<group>"; };
|
||||
E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Amazon Root CA 1.cer"; sourceTree = "<group>"; };
|
||||
E2B10D8D233035100004E005 /* Amazon.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Amazon.cer; sourceTree = "<group>"; };
|
||||
E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPropertyListRequestSerializerTests.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -413,11 +398,11 @@
|
||||
298D7C6D1BC2C88F00FD3B3E /* HTTPBin.org */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */,
|
||||
E2B10D8D233035100004E005 /* Amazon.cer */,
|
||||
E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */,
|
||||
298D7CE21BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain */,
|
||||
1F8482BF220F386200718111 /* httpbinorg_03172020.cer */,
|
||||
298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */,
|
||||
298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */,
|
||||
298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */,
|
||||
1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */,
|
||||
);
|
||||
path = HTTPBin.org;
|
||||
sourceTree = "<group>";
|
||||
@ -450,10 +435,7 @@
|
||||
298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */,
|
||||
298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */,
|
||||
298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */,
|
||||
2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */,
|
||||
2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */,
|
||||
298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */,
|
||||
E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */,
|
||||
29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */,
|
||||
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */,
|
||||
298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */,
|
||||
@ -499,7 +481,7 @@
|
||||
299522651BBF129200859F49 /* AFNetworking.framework */,
|
||||
299522771BBF136400859F49 /* AFNetworking.framework */,
|
||||
298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */,
|
||||
298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */,
|
||||
298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */,
|
||||
2987B0A51BC408A200179A4C /* AFNetworking.framework */,
|
||||
2987B0AE1BC408A200179A4C /* AFNetworking tvOS Tests.xctest */,
|
||||
);
|
||||
@ -519,7 +501,6 @@
|
||||
299522451BBF125A00859F49 /* AFNetworking */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */,
|
||||
299522461BBF125A00859F49 /* AFHTTPSessionManager.h */,
|
||||
299522471BBF125A00859F49 /* AFHTTPSessionManager.m */,
|
||||
299522491BBF125A00859F49 /* AFNetworkReachabilityManager.h */,
|
||||
@ -592,7 +573,6 @@
|
||||
29D96E8D1BCC3D7D00F571A5 /* AFURLSessionManager.h in Headers */,
|
||||
29D96E941BCC406B00F571A5 /* AFAutoPurgingImageCache.h in Headers */,
|
||||
29D96E951BCC406B00F571A5 /* AFImageDownloader.h in Headers */,
|
||||
1F96D2A7203649580085FC3F /* AFCompatibilityMacros.h in Headers */,
|
||||
29D96E961BCC406B00F571A5 /* UIActivityIndicatorView+AFNetworking.h in Headers */,
|
||||
29D96E971BCC406B00F571A5 /* UIButton+AFNetworking.h in Headers */,
|
||||
29D96E981BCC406B00F571A5 /* UIImage+AFNetworking.h in Headers */,
|
||||
@ -617,7 +597,6 @@
|
||||
2995225E1BBF125A00859F49 /* AFURLSessionManager.h in Headers */,
|
||||
2995225C1BBF125A00859F49 /* AFURLResponseSerialization.h in Headers */,
|
||||
299522A21BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.h in Headers */,
|
||||
1F96D2A4203649560085FC3F /* AFCompatibilityMacros.h in Headers */,
|
||||
2995223D1BBF104D00859F49 /* AFNetworking.h in Headers */,
|
||||
299522B01BBF13C700859F49 /* UIWebView+AFNetworking.h in Headers */,
|
||||
299522AC1BBF13C700859F49 /* UIProgressView+AFNetworking.h in Headers */,
|
||||
@ -633,7 +612,6 @@
|
||||
files = (
|
||||
29D96E7A1BCC3D6000F571A5 /* AFHTTPSessionManager.h in Headers */,
|
||||
29D96E7C1BCC3D6000F571A5 /* AFSecurityPolicy.h in Headers */,
|
||||
1F96D2A5203649570085FC3F /* AFCompatibilityMacros.h in Headers */,
|
||||
29D96E7D1BCC3D6000F571A5 /* AFURLRequestSerialization.h in Headers */,
|
||||
29D96E7E1BCC3D6000F571A5 /* AFURLResponseSerialization.h in Headers */,
|
||||
29D96E7F1BCC3D6000F571A5 /* AFURLSessionManager.h in Headers */,
|
||||
@ -648,7 +626,6 @@
|
||||
29D96E811BCC3D7200F571A5 /* AFHTTPSessionManager.h in Headers */,
|
||||
29D96E821BCC3D7200F571A5 /* AFNetworkReachabilityManager.h in Headers */,
|
||||
29D96E831BCC3D7200F571A5 /* AFSecurityPolicy.h in Headers */,
|
||||
1F96D2A6203649570085FC3F /* AFCompatibilityMacros.h in Headers */,
|
||||
29D96E841BCC3D7200F571A5 /* AFURLRequestSerialization.h in Headers */,
|
||||
29D96E851BCC3D7200F571A5 /* AFURLResponseSerialization.h in Headers */,
|
||||
29D96E861BCC3D7200F571A5 /* AFURLSessionManager.h in Headers */,
|
||||
@ -713,9 +690,9 @@
|
||||
productReference = 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */ = {
|
||||
298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */;
|
||||
buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */;
|
||||
buildPhases = (
|
||||
298D7C461BC2C7B200FD3B3E /* Sources */,
|
||||
298D7C471BC2C7B200FD3B3E /* Frameworks */,
|
||||
@ -726,9 +703,9 @@
|
||||
dependencies = (
|
||||
298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */,
|
||||
);
|
||||
name = "AFNetworking macOS Tests";
|
||||
name = "AFNetworking Mac OS X Tests";
|
||||
productName = "AFNetworking Mac OS X Tests";
|
||||
productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */;
|
||||
productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
299522381BBF104D00859F49 /* AFNetworking iOS */ = {
|
||||
@ -767,9 +744,9 @@
|
||||
productReference = 299522651BBF129200859F49 /* AFNetworking.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
299522761BBF136400859F49 /* AFNetworking macOS */ = {
|
||||
299522761BBF136400859F49 /* AFNetworking OS X */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */;
|
||||
buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */;
|
||||
buildPhases = (
|
||||
299522721BBF136400859F49 /* Sources */,
|
||||
299522731BBF136400859F49 /* Frameworks */,
|
||||
@ -780,7 +757,7 @@
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "AFNetworking macOS";
|
||||
name = "AFNetworking OS X";
|
||||
productName = "AFNetworking OS X";
|
||||
productReference = 299522771BBF136400859F49 /* AFNetworking.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
@ -791,7 +768,7 @@
|
||||
299522301BBF104D00859F49 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0930;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = AFNetworking;
|
||||
TargetAttributes = {
|
||||
2987B0A41BC408A200179A4C = {
|
||||
@ -820,7 +797,7 @@
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 299522331BBF104D00859F49 /* Build configuration list for PBXProject "AFNetworking" */;
|
||||
compatibilityVersion = "Xcode 6.3";
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
@ -833,10 +810,10 @@
|
||||
targets = (
|
||||
299522381BBF104D00859F49 /* AFNetworking iOS */,
|
||||
299522641BBF129200859F49 /* AFNetworking watchOS */,
|
||||
299522761BBF136400859F49 /* AFNetworking macOS */,
|
||||
299522761BBF136400859F49 /* AFNetworking OS X */,
|
||||
2987B0A41BC408A200179A4C /* AFNetworking tvOS */,
|
||||
298D7C3A1BC2C79500FD3B3E /* AFNetworking iOS Tests */,
|
||||
298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */,
|
||||
298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */,
|
||||
2987B0AD1BC408A200179A4C /* AFNetworking tvOS Tests */,
|
||||
);
|
||||
};
|
||||
@ -856,21 +833,21 @@
|
||||
files = (
|
||||
2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */,
|
||||
2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */,
|
||||
E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
|
||||
1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */,
|
||||
2987B0D91BC40AF300179A4C /* COMODO_RSA_Certification_Authority.cer in Resources */,
|
||||
2987B0DF1BC40AFB00179A4C /* NoDomains.cer in Resources */,
|
||||
2987B0D41BC40AE900179A4C /* adn_1.cer in Resources */,
|
||||
2987B0DD1BC40AFB00179A4C /* AltName.cer in Resources */,
|
||||
2987B0D71BC40AF000179A4C /* HTTPBinOrgServerTrustChain in Resources */,
|
||||
2987B0D31BC40AE900179A4C /* adn_0.cer in Resources */,
|
||||
2987B0DC1BC40AF600179A4C /* logo.png in Resources */,
|
||||
2987B0D81BC40AF300179A4C /* AddTrust_External_CA_Root.cer in Resources */,
|
||||
2987B0D51BC40AE900179A4C /* adn_2.cer in Resources */,
|
||||
2987B0DA1BC40AF300179A4C /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */,
|
||||
5F4323D71BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
|
||||
E2B10D96233035100004E005 /* Amazon.cer in Resources */,
|
||||
5F4323DB1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
|
||||
5F4323BD1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
|
||||
5F4323DF1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
|
||||
E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */,
|
||||
1FE783031C5857A200A73B7C /* httpbinorg_01192017.cer in Resources */,
|
||||
5F4323C01BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
|
||||
5F4323CF1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
|
||||
5F4323C31BF63741003B8749 /* google.com.cer in Resources */,
|
||||
@ -881,11 +858,12 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
298D7CC51BC2CAA200FD3B3E /* AddTrust_External_CA_Root.cer in Resources */,
|
||||
298D7CBF1BC2CA9D00FD3B3E /* foobar.com.cer in Resources */,
|
||||
298D7CBA1BC2CA9800FD3B3E /* logo.png in Resources */,
|
||||
E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
|
||||
1F8482C0220F386200718111 /* httpbinorg_03172020.cer in Resources */,
|
||||
298D7CC61BC2CAA200FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */,
|
||||
297824A31BC2D69A0041C395 /* adn_0.cer in Resources */,
|
||||
298D7CC71BC2CAA200FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */,
|
||||
298D7CE31BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */,
|
||||
297824A71BC2D69A0041C395 /* adn_2.cer in Resources */,
|
||||
297824A51BC2D69A0041C395 /* adn_1.cer in Resources */,
|
||||
@ -893,11 +871,10 @@
|
||||
298D7CE01BC2CB5A00FD3B3E /* ADNNetServerTrustChain in Resources */,
|
||||
298D7CBE1BC2CA9D00FD3B3E /* AltName.cer in Resources */,
|
||||
5F4323D51BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
|
||||
E2B10D94233035100004E005 /* Amazon.cer in Resources */,
|
||||
5F4323D91BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
|
||||
5F4323BB1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
|
||||
5F4323DD1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
|
||||
E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */,
|
||||
1FE783011C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */,
|
||||
5F4323BE1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
|
||||
5F4323CD1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
|
||||
5F4323C11BF63741003B8749 /* google.com.cer in Resources */,
|
||||
@ -908,11 +885,12 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
298D7CC11BC2CAA100FD3B3E /* AddTrust_External_CA_Root.cer in Resources */,
|
||||
298D7CBC1BC2CA9C00FD3B3E /* foobar.com.cer in Resources */,
|
||||
298D7CB91BC2CA9800FD3B3E /* logo.png in Resources */,
|
||||
E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
|
||||
1F8482C1220F386200718111 /* httpbinorg_03172020.cer in Resources */,
|
||||
298D7CC21BC2CAA100FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */,
|
||||
297824A41BC2D69A0041C395 /* adn_0.cer in Resources */,
|
||||
298D7CC31BC2CAA100FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */,
|
||||
298D7CE41BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */,
|
||||
297824A81BC2D69A0041C395 /* adn_2.cer in Resources */,
|
||||
297824A61BC2D69A0041C395 /* adn_1.cer in Resources */,
|
||||
@ -920,11 +898,10 @@
|
||||
298D7CE11BC2CB5A00FD3B3E /* ADNNetServerTrustChain in Resources */,
|
||||
298D7CBB1BC2CA9C00FD3B3E /* AltName.cer in Resources */,
|
||||
5F4323D61BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
|
||||
E2B10D95233035100004E005 /* Amazon.cer in Resources */,
|
||||
5F4323DA1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
|
||||
5F4323BC1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
|
||||
5F4323CE1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
|
||||
E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */,
|
||||
1FE783021C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */,
|
||||
5F4323DE1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
|
||||
5F4323BF1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
|
||||
5F4323C21BF63741003B8749 /* google.com.cer in Resources */,
|
||||
@ -993,8 +970,6 @@
|
||||
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;
|
||||
};
|
||||
@ -1005,7 +980,6 @@
|
||||
29D3413F1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */,
|
||||
2960BAC31C1B2F1A00BA02F0 /* AFUIButtonTests.m in Sources */,
|
||||
298D7C961BC2C94400FD3B3E /* AFTestCase.m in Sources */,
|
||||
E91164651DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */,
|
||||
298D7CB11BC2CA6E00FD3B3E /* AFHTTPRequestSerializationTests.m in Sources */,
|
||||
297824AE1BC2DBD80041C395 /* AFUIActivityIndicatorViewTests.m in Sources */,
|
||||
297824AD1BC2DBA40041C395 /* AFNetworkActivityManagerTests.m in Sources */,
|
||||
@ -1019,7 +993,6 @@
|
||||
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 */,
|
||||
@ -1033,15 +1006,12 @@
|
||||
298D7CD41BC2CAE900FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */,
|
||||
29D341401C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */,
|
||||
298D7CB21BC2CA6E00FD3B3E /* AFHTTPRequestSerializationTests.m in Sources */,
|
||||
E91164661DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */,
|
||||
298D7CDE1BC2CAF800FD3B3E /* AFSecurityPolicyTests.m in Sources */,
|
||||
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 */,
|
||||
);
|
||||
@ -1109,7 +1079,7 @@
|
||||
};
|
||||
298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 299522761BBF136400859F49 /* AFNetworking macOS */;
|
||||
target = 299522761BBF136400859F49 /* AFNetworking OS X */;
|
||||
targetProxy = 298D7C501BC2C7B200FD3B3E /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
@ -1118,9 +1088,7 @@
|
||||
2987B0B61BC408A200179A4C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1143,9 +1111,7 @@
|
||||
2987B0B71BC408A200179A4C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1168,7 +1134,6 @@
|
||||
2987B0B81BC408A200179A4C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ./Tests/Info.plist;
|
||||
@ -1183,7 +1148,6 @@
|
||||
2987B0B91BC408A200179A4C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ./Tests/Info.plist;
|
||||
@ -1198,7 +1162,6 @@
|
||||
298D7C431BC2C79500FD3B3E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
|
||||
@ -1213,7 +1176,6 @@
|
||||
298D7C441BC2C79500FD3B3E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
|
||||
@ -1228,7 +1190,6 @@
|
||||
298D7C531BC2C7B200FD3B3E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
|
||||
@ -1244,7 +1205,6 @@
|
||||
298D7C541BC2C7B200FD3B3E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
|
||||
@ -1263,13 +1223,10 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_CODE_COVERAGE = YES;
|
||||
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;
|
||||
@ -1279,14 +1236,10 @@
|
||||
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;
|
||||
@ -1344,13 +1297,10 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_CODE_COVERAGE = NO;
|
||||
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;
|
||||
@ -1360,14 +1310,10 @@
|
||||
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;
|
||||
@ -1416,9 +1362,7 @@
|
||||
299522421BBF104D00859F49 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
@ -1427,6 +1371,7 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = ./Framework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking;
|
||||
PRODUCT_NAME = AFNetworking;
|
||||
@ -1439,9 +1384,7 @@
|
||||
299522431BBF104D00859F49 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
@ -1450,6 +1393,7 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = ./Framework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking;
|
||||
PRODUCT_NAME = AFNetworking;
|
||||
@ -1464,7 +1408,6 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1488,7 +1431,6 @@
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1510,9 +1452,7 @@
|
||||
2995227D1BBF136400859F49 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = marker;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
@ -1537,9 +1477,7 @@
|
||||
2995227E1BBF136400859F49 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
BITCODE_GENERATION_MODE = bitcode;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
@ -1591,7 +1529,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */ = {
|
||||
298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
298D7C531BC2C7B200FD3B3E /* Debug */,
|
||||
@ -1627,7 +1565,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */ = {
|
||||
2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2995227D1BBF136400859F49 /* Debug */,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -16,7 +16,7 @@
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "299522761BBF136400859F49"
|
||||
BuildableName = "AFNetworking.framework"
|
||||
BlueprintName = "AFNetworking macOS"
|
||||
BlueprintName = "AFNetworking OS X"
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
@ -26,16 +26,16 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
|
||||
BuildableName = "AFNetworking macOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking macOS Tests"
|
||||
BuildableName = "AFNetworking Mac OS X Tests.xctest"
|
||||
BlueprintName = "AFNetworking Mac OS X Tests"
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
<SkippedTests>
|
||||
@ -50,17 +50,10 @@
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "299522761BBF136400859F49"
|
||||
BuildableName = "AFNetworking.framework"
|
||||
BlueprintName = "AFNetworking macOS"
|
||||
BlueprintName = "AFNetworking OS X"
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "HTTPBIN_BASE_URL"
|
||||
value = "http://127.0.0.1:5000"
|
||||
isEnabled = "NO">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
@ -79,7 +72,7 @@
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "299522761BBF136400859F49"
|
||||
BuildableName = "AFNetworking.framework"
|
||||
BlueprintName = "AFNetworking macOS"
|
||||
BlueprintName = "AFNetworking OS X"
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
@ -97,7 +90,7 @@
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "299522761BBF136400859F49"
|
||||
BuildableName = "AFNetworking.framework"
|
||||
BlueprintName = "AFNetworking macOS"
|
||||
BlueprintName = "AFNetworking OS X"
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -40,9 +40,9 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableAddressSanitizer = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||
enableAddressSanitizer = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@ -69,18 +69,6 @@
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "OS_ACTIVITY_MODE"
|
||||
value = "disable"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
<EnvironmentVariable
|
||||
key = "HTTPBIN_BASE_URL"
|
||||
value = "http://127.0.0.1:5000"
|
||||
isEnabled = "NO">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -26,8 +26,8 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableAddressSanitizer = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "NO">
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
enableAddressSanitizer = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@ -54,18 +54,6 @@
|
||||
ReferencedContainer = "container:AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "OS_ACTIVITY_MODE"
|
||||
value = "disable"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
<EnvironmentVariable
|
||||
key = "HTTPBIN_BASE_URL"
|
||||
value = "http://127.0.0.1:5000"
|
||||
isEnabled = "NO">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
<AdditionalOption
|
||||
key = "NSZombieEnabled"
|
||||
@ -78,11 +66,11 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableThreadSanitizer = "YES"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
enableThreadSanitizer = "YES"
|
||||
stopOnEveryThreadSanitizerIssue = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
// AFCompatibilityMacros.h
|
||||
// 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.
|
||||
|
||||
#ifndef AFCompatibilityMacros_h
|
||||
#define AFCompatibilityMacros_h
|
||||
|
||||
#ifdef API_UNAVAILABLE
|
||||
#define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
|
||||
#else
|
||||
#define AF_API_UNAVAILABLE(x)
|
||||
#endif // API_UNAVAILABLE
|
||||
|
||||
#if __has_warning("-Wunguarded-availability-new")
|
||||
#define AF_CAN_USE_AT_AVAILABLE 1
|
||||
#else
|
||||
#define AF_CAN_USE_AT_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
|
||||
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
|
||||
#else
|
||||
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
|
||||
#endif
|
||||
|
||||
#endif /* AFCompatibilityMacros_h */
|
||||
@ -167,25 +167,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `GET` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
@ -203,24 +184,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `POST` request.
|
||||
@ -250,25 +214,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `POST` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
@ -304,26 +249,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
|
||||
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
|
||||
@param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
|
||||
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
@ -342,24 +267,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
|
||||
@ -374,24 +282,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
|
||||
@ -406,24 +297,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
|
||||
|
||||
@param URLString The URL string used to create the request URL.
|
||||
@param parameters The parameters to be encoded according to the client request serializer.
|
||||
@param headers The headers appended to the default headers for this request.
|
||||
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
|
||||
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
|
||||
|
||||
@see -dataTaskWithRequest:completionHandler:
|
||||
*/
|
||||
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
|
||||
return [self GET:URLString parameters:parameters headers:nil progress:nil success:success failure:failure];
|
||||
return [self GET:URLString parameters:parameters progress:nil success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)GET:(NSString *)URLString
|
||||
@ -133,28 +133,16 @@
|
||||
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
|
||||
return [self GET:URLString parameters:parameters headers:nil progress:downloadProgress success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)GET:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
progress:(void (^)(NSProgress * _Nonnull))downloadProgress
|
||||
success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
|
||||
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET"
|
||||
URLString:URLString
|
||||
parameters:parameters
|
||||
headers:headers
|
||||
uploadProgress:nil
|
||||
downloadProgress:downloadProgress
|
||||
success:success
|
||||
failure:failure];
|
||||
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
@ -163,23 +151,14 @@
|
||||
success:(void (^)(NSURLSessionDataTask *task))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self HEAD:URLString parameters:parameters headers:nil success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||
success:(void (^)(NSURLSessionDataTask * _Nonnull))success
|
||||
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) {
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) {
|
||||
if (success) {
|
||||
success(task);
|
||||
}
|
||||
} failure:failure];
|
||||
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
@ -188,7 +167,7 @@
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self POST:URLString parameters:parameters headers:nil progress:nil success:success failure:failure];
|
||||
return [self POST:URLString parameters:parameters progress:nil success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
@ -197,20 +176,10 @@
|
||||
success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
|
||||
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
return [self POST:URLString parameters:parameters headers:nil progress:uploadProgress success:success failure:failure];
|
||||
}
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure];
|
||||
|
||||
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(nullable id)parameters
|
||||
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
|
||||
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
|
||||
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure
|
||||
{
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters headers:headers uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure];
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
@ -220,7 +189,7 @@
|
||||
success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
|
||||
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:nil success:success failure:failure];
|
||||
return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
@ -229,32 +198,19 @@
|
||||
progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:uploadProgress success:success failure:failure];
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)POST:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||
constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> _Nonnull))block
|
||||
progress:(void (^)(NSProgress * _Nonnull))uploadProgress
|
||||
success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
|
||||
{
|
||||
NSError *serializationError = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];
|
||||
for (NSString *headerField in headers.keyEnumerator) {
|
||||
[request addValue:headers[headerField] forHTTPHeaderField:headerField];
|
||||
}
|
||||
if (serializationError) {
|
||||
if (failure) {
|
||||
dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
|
||||
failure(nil, serializationError);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
__block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
|
||||
if (error) {
|
||||
if (failure) {
|
||||
@ -266,9 +222,9 @@
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
[task resume];
|
||||
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
@ -277,19 +233,10 @@
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self PUT:URLString parameters:parameters headers:nil success:success failure:failure];
|
||||
}
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
- (NSURLSessionDataTask *)PUT:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
@ -298,19 +245,10 @@
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self PATCH:URLString parameters:parameters headers:nil success:success failure:failure];
|
||||
}
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
@ -319,26 +257,16 @@
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
return [self DELETE:URLString parameters:parameters headers:nil success:success failure:failure];
|
||||
}
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary<NSString *,NSString *> *)headers
|
||||
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
||||
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
||||
{
|
||||
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
|
||||
|
||||
[dataTask resume];
|
||||
|
||||
|
||||
return dataTask;
|
||||
}
|
||||
|
||||
- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
|
||||
URLString:(NSString *)URLString
|
||||
parameters:(id)parameters
|
||||
headers:(NSDictionary <NSString *, NSString *> *)headers
|
||||
uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress
|
||||
downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress
|
||||
success:(void (^)(NSURLSessionDataTask *, id))success
|
||||
@ -346,9 +274,6 @@
|
||||
{
|
||||
NSError *serializationError = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError];
|
||||
for (NSString *headerField in headers.keyEnumerator) {
|
||||
[request addValue:headers[headerField] forHTTPHeaderField:headerField];
|
||||
}
|
||||
if (serializationError) {
|
||||
if (failure) {
|
||||
dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
|
||||
@ -381,7 +306,7 @@
|
||||
#pragma mark - NSObject
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue];
|
||||
return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", [self class], self, [self.baseURL absoluteString], self.session, self.operationQueue];
|
||||
}
|
||||
|
||||
#pragma mark - NSSecureCoding
|
||||
|
||||
@ -108,14 +108,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* Unavailable initializer
|
||||
* Initializes an instance of a network reachability manager
|
||||
*
|
||||
* @return nil as this method is unavailable
|
||||
*/
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* Unavailable initializer
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nullable instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
///--------------------------------------------------
|
||||
/// @name Starting & Stopping Reachability Monitoring
|
||||
|
||||
@ -32,7 +32,6 @@ NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire
|
||||
NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem";
|
||||
|
||||
typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
|
||||
typedef AFNetworkReachabilityManager * (^AFNetworkReachabilityStatusCallback)(AFNetworkReachabilityStatus status);
|
||||
|
||||
NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
|
||||
switch (status) {
|
||||
@ -79,21 +78,20 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork
|
||||
* a queued notification (for an earlier status condition) is processed after
|
||||
* the later update, resulting in the listener being left in the wrong state.
|
||||
*/
|
||||
static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusCallback block) {
|
||||
static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) {
|
||||
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
AFNetworkReachabilityManager *manager = nil;
|
||||
if (block) {
|
||||
manager = block(status);
|
||||
block(status);
|
||||
}
|
||||
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||
NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) };
|
||||
[notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:manager userInfo:userInfo];
|
||||
[notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo];
|
||||
});
|
||||
}
|
||||
|
||||
static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
|
||||
AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusCallback)info);
|
||||
AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info);
|
||||
}
|
||||
|
||||
|
||||
@ -172,11 +170,8 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
- (instancetype)init NS_UNAVAILABLE
|
||||
{
|
||||
@throw [NSException exceptionWithName:NSGenericException
|
||||
reason:@"`-init` unavailable. Use `-initWithReachability:` instead"
|
||||
userInfo:nil];
|
||||
return nil;
|
||||
}
|
||||
|
||||
@ -212,15 +207,14 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||
}
|
||||
|
||||
__weak __typeof(self)weakSelf = self;
|
||||
AFNetworkReachabilityStatusCallback callback = ^(AFNetworkReachabilityStatus status) {
|
||||
AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) {
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
|
||||
strongSelf.networkReachabilityStatus = status;
|
||||
if (strongSelf.networkReachabilityStatusBlock) {
|
||||
strongSelf.networkReachabilityStatusBlock(status);
|
||||
}
|
||||
|
||||
return strongSelf;
|
||||
|
||||
};
|
||||
|
||||
SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
|
||||
|
||||
@ -45,10 +45,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
The certificates used to evaluate server trust according to the SSL pinning mode.
|
||||
|
||||
By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
|
||||
|
||||
Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
|
||||
|
||||
@see policyWithPinningMode:withPinnedCertificates:
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
|
||||
|
||||
@ -90,14 +90,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
Creates and returns a security policy with the specified pinning mode.
|
||||
|
||||
Certificates with the `.cer` extension found in the main bundle will be pinned. If you want more control over which certificates are pinned, please use `policyWithPinningMode:withPinnedCertificates:` instead.
|
||||
|
||||
@param pinningMode The SSL pinning mode.
|
||||
|
||||
@return A new security policy.
|
||||
|
||||
@see -policyWithPinningMode:withPinnedCertificates:
|
||||
*/
|
||||
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
|
||||
|
||||
@ -108,10 +104,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@param pinnedCertificates The certificates to pin against.
|
||||
|
||||
@return A new security policy.
|
||||
|
||||
@see +certificatesInBundle:
|
||||
@see -pinnedCertificates
|
||||
*/
|
||||
*/
|
||||
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
|
||||
|
||||
///------------------------------
|
||||
|
||||
@ -51,6 +51,8 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
|
||||
static id AFPublicKeyForCertificate(NSData *certificate) {
|
||||
id allowedPublicKey = nil;
|
||||
SecCertificateRef allowedCertificate;
|
||||
SecCertificateRef allowedCertificates[1];
|
||||
CFArrayRef tempCertificates = nil;
|
||||
SecPolicyRef policy = nil;
|
||||
SecTrustRef allowedTrust = nil;
|
||||
SecTrustResultType result;
|
||||
@ -58,8 +60,11 @@ static id AFPublicKeyForCertificate(NSData *certificate) {
|
||||
allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
|
||||
__Require_Quiet(allowedCertificate != NULL, _out);
|
||||
|
||||
allowedCertificates[0] = allowedCertificate;
|
||||
tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
|
||||
|
||||
policy = SecPolicyCreateBasicX509();
|
||||
__Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out);
|
||||
__Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
|
||||
__Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
|
||||
|
||||
allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
|
||||
@ -73,6 +78,10 @@ _out:
|
||||
CFRelease(policy);
|
||||
}
|
||||
|
||||
if (tempCertificates) {
|
||||
CFRelease(tempCertificates);
|
||||
}
|
||||
|
||||
if (allowedCertificate) {
|
||||
CFRelease(allowedCertificate);
|
||||
}
|
||||
@ -158,6 +167,17 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
|
||||
return [NSSet setWithSet:certificates];
|
||||
}
|
||||
|
||||
+ (NSSet *)defaultPinnedCertificates {
|
||||
static NSSet *_defaultPinnedCertificates = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
|
||||
_defaultPinnedCertificates = [self certificatesInBundle:bundle];
|
||||
});
|
||||
|
||||
return _defaultPinnedCertificates;
|
||||
}
|
||||
|
||||
+ (instancetype)defaultPolicy {
|
||||
AFSecurityPolicy *securityPolicy = [[self alloc] init];
|
||||
securityPolicy.SSLPinningMode = AFSSLPinningModeNone;
|
||||
@ -166,8 +186,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
|
||||
}
|
||||
|
||||
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
|
||||
NSSet <NSData *> *defaultPinnedCertificates = [self certificatesInBundle:[NSBundle mainBundle]];
|
||||
return [self policyWithPinningMode:pinningMode withPinnedCertificates:defaultPinnedCertificates];
|
||||
return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];
|
||||
}
|
||||
|
||||
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {
|
||||
@ -242,6 +261,9 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
|
||||
}
|
||||
|
||||
switch (self.SSLPinningMode) {
|
||||
case AFSSLPinningModeNone:
|
||||
default:
|
||||
return NO;
|
||||
case AFSSLPinningModeCertificate: {
|
||||
NSMutableArray *pinnedCertificates = [NSMutableArray array];
|
||||
for (NSData *certificateData in self.pinnedCertificates) {
|
||||
@ -277,9 +299,6 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
|
||||
}
|
||||
return trustedPublicKeyCount > 0;
|
||||
}
|
||||
|
||||
default:
|
||||
return NO;
|
||||
}
|
||||
|
||||
return NO;
|
||||
@ -307,7 +326,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
|
||||
self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];
|
||||
self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
|
||||
self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];
|
||||
self.pinnedCertificates = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
|
||||
self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@ -217,13 +217,12 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
|
||||
}];
|
||||
[self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"];
|
||||
|
||||
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
|
||||
NSString *userAgent = nil;
|
||||
#if TARGET_OS_IOS
|
||||
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
|
||||
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
|
||||
#elif TARGET_OS_TV
|
||||
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; tvOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
|
||||
#elif TARGET_OS_WATCH
|
||||
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
|
||||
userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]];
|
||||
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
|
||||
userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
|
||||
@ -313,7 +312,7 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
|
||||
- (void)setValue:(NSString *)value
|
||||
forHTTPHeaderField:(NSString *)field
|
||||
{
|
||||
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{
|
||||
dispatch_barrier_async(self.requestHeaderModificationQueue, ^{
|
||||
[self.mutableHTTPRequestHeaders setValue:value forKey:field];
|
||||
});
|
||||
}
|
||||
@ -335,7 +334,7 @@ forHTTPHeaderField:(NSString *)field
|
||||
}
|
||||
|
||||
- (void)clearAuthorizationHeader {
|
||||
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{
|
||||
dispatch_barrier_async(self.requestHeaderModificationQueue, ^{
|
||||
[self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
|
||||
});
|
||||
}
|
||||
@ -572,7 +571,7 @@ forHTTPHeaderField:(NSString *)field
|
||||
dispatch_sync(self.requestHeaderModificationQueue, ^{
|
||||
[coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
|
||||
});
|
||||
[coder encodeObject:@(self.queryStringSerializationStyle) forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
|
||||
[coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
|
||||
}
|
||||
|
||||
#pragma mark - NSCopying
|
||||
@ -680,11 +679,6 @@ 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
|
||||
@ -1260,21 +1254,7 @@ typedef enum {
|
||||
[mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
|
||||
}
|
||||
|
||||
if (![NSJSONSerialization isValidJSONObject:parameters]) {
|
||||
if (error) {
|
||||
NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"The `parameters` argument is not valid JSON.", @"AFNetworking", nil)};
|
||||
*error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error];
|
||||
|
||||
if (!jsonData) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
[mutableRequest setHTTPBody:jsonData];
|
||||
[mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]];
|
||||
}
|
||||
|
||||
return mutableRequest;
|
||||
@ -1296,7 +1276,7 @@ typedef enum {
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
[super encodeWithCoder:coder];
|
||||
|
||||
[coder encodeObject:@(self.writingOptions) forKey:NSStringFromSelector(@selector(writingOptions))];
|
||||
[coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))];
|
||||
}
|
||||
|
||||
#pragma mark - NSCopying
|
||||
@ -1353,13 +1333,7 @@ typedef enum {
|
||||
[mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"];
|
||||
}
|
||||
|
||||
NSData *plistData = [NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error];
|
||||
|
||||
if (!plistData) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
[mutableRequest setHTTPBody:plistData];
|
||||
[mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]];
|
||||
}
|
||||
|
||||
return mutableRequest;
|
||||
@ -1382,7 +1356,7 @@ typedef enum {
|
||||
- (void)encodeWithCoder:(NSCoder *)coder {
|
||||
[super encodeWithCoder:coder];
|
||||
|
||||
[coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))];
|
||||
[coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))];
|
||||
[coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))];
|
||||
}
|
||||
|
||||
|
||||
@ -24,11 +24,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
Recursively removes `NSNull` values from a JSON object.
|
||||
*/
|
||||
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions);
|
||||
|
||||
/**
|
||||
The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
|
||||
|
||||
@ -62,7 +57,10 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
|
||||
- (instancetype)init;
|
||||
|
||||
@property (nonatomic, assign) NSStringEncoding stringEncoding DEPRECATED_MSG_ATTRIBUTE("The string encoding is never used. AFHTTPResponseSerializer only validates status codes and content types but does not try to decode the received data in any way.");
|
||||
/**
|
||||
The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default.
|
||||
*/
|
||||
@property (nonatomic, assign) NSStringEncoding stringEncoding;
|
||||
|
||||
/**
|
||||
Creates and returns a serializer with default configuration.
|
||||
@ -113,8 +111,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
- `application/json`
|
||||
- `text/json`
|
||||
- `text/javascript`
|
||||
|
||||
In RFC 7159 - Section 8.1, it states that JSON text is required to be encoded in UTF-8, UTF-16, or UTF-32, and the default encoding is UTF-8. NSJSONSerialization provides support for all the encodings listed in the specification, and recommends UTF-8 for efficiency. Using an unsupported encoding will result in serialization error. See the `NSJSONSerialization` documentation for more details.
|
||||
*/
|
||||
@interface AFJSONResponseSerializer : AFHTTPResponseSerializer
|
||||
|
||||
@ -170,7 +166,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
- (instancetype)init;
|
||||
|
||||
/**
|
||||
Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSXMLDocument` documentation section "Input and Output Options". `0` by default.
|
||||
Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger options;
|
||||
|
||||
|
||||
@ -60,13 +60,11 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
|
||||
return NO;
|
||||
}
|
||||
|
||||
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
|
||||
static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
|
||||
if ([JSONObject isKindOfClass:[NSArray class]]) {
|
||||
NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]];
|
||||
for (id value in (NSArray *)JSONObject) {
|
||||
if (![value isEqual:[NSNull null]]) {
|
||||
[mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
|
||||
}
|
||||
[mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
|
||||
}
|
||||
|
||||
return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray];
|
||||
@ -99,6 +97,8 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.stringEncoding = NSUTF8StringEncoding;
|
||||
|
||||
self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
|
||||
self.acceptableContentTypes = nil;
|
||||
|
||||
@ -114,7 +114,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
BOOL responseIsValid = YES;
|
||||
NSError *validationError = nil;
|
||||
|
||||
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
||||
if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
|
||||
if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] &&
|
||||
!([response MIMEType] == nil && [data length] == 0)) {
|
||||
|
||||
@ -182,7 +182,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
}
|
||||
|
||||
self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
|
||||
self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
|
||||
self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
|
||||
|
||||
return self;
|
||||
}
|
||||
@ -242,28 +242,23 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
}
|
||||
}
|
||||
|
||||
id responseObject = nil;
|
||||
NSError *serializationError = nil;
|
||||
// Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization.
|
||||
// See https://github.com/rails/rails/issues/1742
|
||||
BOOL isSpace = [data isEqualToData:[NSData dataWithBytes:" " length:1]];
|
||||
|
||||
if (data.length == 0 || isSpace) {
|
||||
if (data.length > 0 && !isSpace) {
|
||||
responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSError *serializationError = nil;
|
||||
|
||||
id responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
|
||||
|
||||
if (!responseObject)
|
||||
{
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
return nil;
|
||||
if (self.removesKeysWithNullValues && responseObject) {
|
||||
responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
|
||||
}
|
||||
|
||||
if (self.removesKeysWithNullValues) {
|
||||
return AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
|
||||
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
|
||||
return responseObject;
|
||||
@ -383,14 +378,10 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
NSError *serializationError = nil;
|
||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError];
|
||||
|
||||
if (!document)
|
||||
{
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
return nil;
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
@ -467,20 +458,15 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
|
||||
}
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
id responseObject;
|
||||
NSError *serializationError = nil;
|
||||
|
||||
id responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
|
||||
|
||||
if (!responseObject)
|
||||
{
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
return nil;
|
||||
|
||||
if (data) {
|
||||
responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
|
||||
}
|
||||
|
||||
if (error) {
|
||||
*error = AFErrorWithUnderlyingError(serializationError, *error);
|
||||
}
|
||||
|
||||
return responseObject;
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#import "AFURLResponseSerialization.h"
|
||||
#import "AFURLRequestSerialization.h"
|
||||
#import "AFSecurityPolicy.h"
|
||||
#import "AFCompatibilityMacros.h"
|
||||
#if !TARGET_OS_WATCH
|
||||
#import "AFNetworkReachabilityManager.h"
|
||||
#endif
|
||||
@ -65,7 +64,7 @@
|
||||
### `NSURLSessionDownloadDelegate`
|
||||
|
||||
- `URLSession:downloadTask:didFinishDownloadingToURL:`
|
||||
- `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`
|
||||
- `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`
|
||||
- `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`
|
||||
|
||||
If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first.
|
||||
@ -196,15 +195,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@param cancelPendingTasks Whether or not to cancel pending tasks.
|
||||
*/
|
||||
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks DEPRECATED_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
Invalidates the managed session, optionally canceling pending tasks and optionally resets given session.
|
||||
|
||||
@param cancelPendingTasks Whether or not to cancel pending tasks.
|
||||
@param resetSession Whether or not to reset the session of the manager.
|
||||
*/
|
||||
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession;
|
||||
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks;
|
||||
|
||||
///-------------------------
|
||||
/// @name Running Data Tasks
|
||||
@ -363,7 +354,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response.
|
||||
*/
|
||||
- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * _Nullable (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block;
|
||||
- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block;
|
||||
|
||||
/**
|
||||
Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`.
|
||||
@ -386,14 +377,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block;
|
||||
|
||||
/**
|
||||
Sets a block to be executed when metrics are finalized related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didFinishCollectingMetrics:`.
|
||||
|
||||
@param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any metrics that were collected in the process of executing the task.
|
||||
*/
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
- (void)setTaskDidFinishCollectingMetricsBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSURLSessionTaskMetrics * _Nullable metrics))block;
|
||||
#endif
|
||||
///-------------------------------------------
|
||||
/// @name Setting Data Task Delegate Callbacks
|
||||
///-------------------------------------------
|
||||
@ -431,7 +414,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session.
|
||||
*/
|
||||
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block AF_API_UNAVAILABLE(macos);
|
||||
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block;
|
||||
|
||||
///-----------------------------------------------
|
||||
/// @name Setting Download Task Delegate Callbacks
|
||||
@ -445,7 +428,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block;
|
||||
|
||||
/**
|
||||
Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`.
|
||||
Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`.
|
||||
|
||||
@param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue.
|
||||
*/
|
||||
@ -514,9 +497,4 @@ FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey;
|
||||
*/
|
||||
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey;
|
||||
|
||||
/**
|
||||
The session task metrics taken from the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteSessionTaskMetrics`
|
||||
*/
|
||||
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSessionTaskMetrics;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -38,16 +38,14 @@ static dispatch_queue_t url_session_manager_creation_queue() {
|
||||
return af_url_session_manager_creation_queue;
|
||||
}
|
||||
|
||||
static void url_session_manager_create_task_safely(dispatch_block_t _Nonnull block) {
|
||||
if (block != NULL) {
|
||||
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();
|
||||
}
|
||||
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);
|
||||
} else {
|
||||
block();
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +80,6 @@ NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamof
|
||||
NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata";
|
||||
NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error";
|
||||
NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath";
|
||||
NSString * const AFNetworkingTaskDidCompleteSessionTaskMetrics = @"com.alamofire.networking.complete.sessiontaskmetrics";
|
||||
|
||||
static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock";
|
||||
|
||||
@ -98,9 +95,6 @@ typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSes
|
||||
typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task);
|
||||
typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
|
||||
typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error);
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
typedef void (^AFURLSessionTaskDidFinishCollectingMetricsBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLSessionTaskMetrics * metrics);
|
||||
#endif
|
||||
|
||||
typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response);
|
||||
typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask);
|
||||
@ -124,9 +118,6 @@ typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id re
|
||||
@property (nonatomic, strong) NSProgress *uploadProgress;
|
||||
@property (nonatomic, strong) NSProgress *downloadProgress;
|
||||
@property (nonatomic, copy) NSURL *downloadFileURL;
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
@property (nonatomic, strong) NSURLSessionTaskMetrics *sessionTaskMetrics;
|
||||
#endif
|
||||
@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading;
|
||||
@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock;
|
||||
@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock;
|
||||
@ -157,17 +148,11 @@ typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id re
|
||||
progress.pausingHandler = ^{
|
||||
[weakTask suspend];
|
||||
};
|
||||
#if AF_CAN_USE_AT_AVAILABLE
|
||||
if (@available(iOS 9, macOS 10.11, *))
|
||||
#else
|
||||
if ([progress respondsToSelector:@selector(setResumingHandler:)])
|
||||
#endif
|
||||
{
|
||||
if ([progress respondsToSelector:@selector(setResumingHandler:)]) {
|
||||
progress.resumingHandler = ^{
|
||||
[weakTask resume];
|
||||
};
|
||||
}
|
||||
|
||||
[progress addObserver:self
|
||||
forKeyPath:NSStringFromSelector(@selector(fractionCompleted))
|
||||
options:NSKeyValueObservingOptionNew
|
||||
@ -217,14 +202,6 @@ didCompleteWithError:(NSError *)error
|
||||
self.mutableData = nil;
|
||||
}
|
||||
|
||||
#if AF_CAN_USE_AT_AVAILABLE && AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
if (@available(iOS 10, macOS 10.12, watchOS 3, tvOS 10, *)) {
|
||||
if (self.sessionTaskMetrics) {
|
||||
userInfo[AFNetworkingTaskDidCompleteSessionTaskMetrics] = self.sessionTaskMetrics;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (self.downloadFileURL) {
|
||||
userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL;
|
||||
} else if (data) {
|
||||
@ -273,14 +250,6 @@ didCompleteWithError:(NSError *)error
|
||||
}
|
||||
}
|
||||
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
- (void)URLSession:(NSURLSession *)session
|
||||
task:(NSURLSessionTask *)task
|
||||
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics {
|
||||
self.sessionTaskMetrics = metrics;
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - NSURLSessionDataDelegate
|
||||
|
||||
- (void)URLSession:(__unused NSURLSession *)session
|
||||
@ -325,14 +294,15 @@ expectedTotalBytes:(int64_t)expectedTotalBytes{
|
||||
downloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
didFinishDownloadingToURL:(NSURL *)location
|
||||
{
|
||||
NSError *fileManagerError = nil;
|
||||
self.downloadFileURL = nil;
|
||||
|
||||
if (self.downloadTaskDidFinishDownloading) {
|
||||
self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location);
|
||||
if (self.downloadFileURL) {
|
||||
NSError *fileManagerError = nil;
|
||||
[[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError];
|
||||
|
||||
if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]) {
|
||||
if (fileManagerError) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo];
|
||||
}
|
||||
}
|
||||
@ -405,7 +375,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
8) Set the current class to the super class, and repeat steps 3-8
|
||||
*/
|
||||
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
|
||||
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
|
||||
NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration];
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wnonnull"
|
||||
NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil];
|
||||
@ -479,15 +449,12 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
@property (readwrite, nonatomic, strong) NSLock *lock;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession AF_API_UNAVAILABLE(macos);
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete;
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidFinishCollectingMetricsBlock taskDidFinishCollectingMetrics;
|
||||
#endif
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData;
|
||||
@ -518,6 +485,8 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
self.operationQueue = [[NSOperationQueue alloc] init];
|
||||
self.operationQueue.maxConcurrentOperationCount = 1;
|
||||
|
||||
self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue];
|
||||
|
||||
self.responseSerializer = [AFJSONResponseSerializer serializer];
|
||||
|
||||
self.securityPolicy = [AFSecurityPolicy defaultPolicy];
|
||||
@ -554,19 +523,6 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSURLSession *)session {
|
||||
|
||||
@synchronized (self) {
|
||||
if (!_session) {
|
||||
_session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue];
|
||||
}
|
||||
}
|
||||
return _session;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
|
||||
- (NSString *)taskDescriptionForSessionTasks {
|
||||
return [NSString stringWithFormat:@"%p", self];
|
||||
}
|
||||
@ -723,18 +679,11 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
#pragma mark -
|
||||
|
||||
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks {
|
||||
[self invalidateSessionCancelingTasks:cancelPendingTasks resetSession:NO];
|
||||
}
|
||||
|
||||
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession {
|
||||
if (cancelPendingTasks) {
|
||||
[self.session invalidateAndCancel];
|
||||
} else {
|
||||
[self.session finishTasksAndInvalidate];
|
||||
}
|
||||
if (resetSession) {
|
||||
self.session = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -789,21 +738,17 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
__block NSURLSessionUploadTask *uploadTask = nil;
|
||||
url_session_manager_create_task_safely(^{
|
||||
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
|
||||
|
||||
// uploadTask may be nil on iOS7 because uploadTaskWithRequest:fromFile: may return nil despite being documented as nonnull (https://devforums.apple.com/message/926113#926113)
|
||||
if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
|
||||
for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
|
||||
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (uploadTask) {
|
||||
[self addDelegateForUploadTask:uploadTask
|
||||
progress:uploadProgressBlock
|
||||
completionHandler:completionHandler];
|
||||
|
||||
// uploadTask may be nil on iOS7 because uploadTaskWithRequest:fromFile: may return nil despite being documented as nonnull (https://devforums.apple.com/message/926113#926113)
|
||||
if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
|
||||
for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
|
||||
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
|
||||
}
|
||||
}
|
||||
|
||||
[self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler];
|
||||
|
||||
return uploadTask;
|
||||
}
|
||||
|
||||
@ -887,11 +832,9 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
self.sessionDidReceiveAuthenticationChallenge = block;
|
||||
}
|
||||
|
||||
#if !TARGET_OS_OSX
|
||||
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block {
|
||||
self.didFinishEventsForBackgroundURLSession = block;
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@ -915,12 +858,6 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
self.taskDidComplete = block;
|
||||
}
|
||||
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
- (void)setTaskDidFinishCollectingMetricsBlock:(void (^)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLSessionTaskMetrics * _Nullable))block {
|
||||
self.taskDidFinishCollectingMetrics = block;
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block {
|
||||
@ -956,7 +893,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
#pragma mark - NSObject
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, self.session, self.operationQueue];
|
||||
return [NSString stringWithFormat:@"<%@: %p, session: %@, operationQueue: %@>", [self class], self, self.session, self.operationQueue];
|
||||
}
|
||||
|
||||
- (BOOL)respondsToSelector:(SEL)selector {
|
||||
@ -966,12 +903,9 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
return self.dataTaskDidReceiveResponse != nil;
|
||||
} else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) {
|
||||
return self.dataTaskWillCacheResponse != nil;
|
||||
}
|
||||
#if !TARGET_OS_OSX
|
||||
else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) {
|
||||
} else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) {
|
||||
return self.didFinishEventsForBackgroundURLSession != nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
return [[self class] instancesRespondToSelector:selector];
|
||||
}
|
||||
@ -1091,9 +1025,9 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
|
||||
{
|
||||
|
||||
int64_t totalUnitCount = totalBytesExpectedToSend;
|
||||
if (totalUnitCount == NSURLSessionTransferSizeUnknown) {
|
||||
if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
|
||||
NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
|
||||
if (contentLength) {
|
||||
if(contentLength) {
|
||||
totalUnitCount = (int64_t) [contentLength longLongValue];
|
||||
}
|
||||
}
|
||||
@ -1127,23 +1061,6 @@ didCompleteWithError:(NSError *)error
|
||||
}
|
||||
}
|
||||
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
- (void)URLSession:(NSURLSession *)session
|
||||
task:(NSURLSessionTask *)task
|
||||
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
|
||||
{
|
||||
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
|
||||
// Metrics may fire after URLSession:task:didCompleteWithError: is called, delegate may be nil
|
||||
if (delegate) {
|
||||
[delegate URLSession:session task:task didFinishCollectingMetrics:metrics];
|
||||
}
|
||||
|
||||
if (self.taskDidFinishCollectingMetrics) {
|
||||
self.taskDidFinishCollectingMetrics(session, task, metrics);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - NSURLSessionDataDelegate
|
||||
|
||||
- (void)URLSession:(NSURLSession *)session
|
||||
@ -1206,7 +1123,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_OS_OSX
|
||||
- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session {
|
||||
if (self.didFinishEventsForBackgroundURLSession) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@ -1214,7 +1130,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - NSURLSessionDownloadDelegate
|
||||
|
||||
@ -1228,8 +1143,8 @@ didFinishDownloadingToURL:(NSURL *)location
|
||||
if (fileURL) {
|
||||
delegate.downloadFileURL = fileURL;
|
||||
NSError *error = nil;
|
||||
|
||||
if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]) {
|
||||
[[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error];
|
||||
if (error) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo];
|
||||
}
|
||||
|
||||
|
||||
122
CHANGELOG.md
122
CHANGELOG.md
@ -4,96 +4,6 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
---
|
||||
|
||||
## [3.2.1](https://github.com/AFNetworking/AFNetworking/releases/tag/3.2.1) (05/04/2018)
|
||||
Released on Friday, May 04, 2018. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.2.1+is%3Aclosed).
|
||||
|
||||
#### Updated
|
||||
* Xcode 9.3 Support
|
||||
* Implemented by Jeff Kelley in [#4199](https://github.com/AFNetworking/AFNetworking/pull/4199).
|
||||
* Update HTTPBin certificates for April 2018.
|
||||
* Implemented by Jeff Kelley in [#4198](https://github.com/AFNetworking/AFNetworking/pull/4198).
|
||||
|
||||
#### Additional Changes
|
||||
* Remove conflicting nullable specifier on init
|
||||
* Implemented by Nick Brook and Jeff Kelley in [#4182](https://github.com/AFNetworking/AFNetworking/pull/4182).
|
||||
* Use @available if available to silence a warning.
|
||||
* Implemented by Jeff Kelley in [#4138](https://github.com/AFNetworking/AFNetworking/pull/4138).
|
||||
* UIImageView+AFNetworking: Prevent stuck state for malformed urlRequest
|
||||
* Implemented by Adam Duflo and aduflo in [#4131](https://github.com/AFNetworking/AFNetworking/pull/4131).
|
||||
* add the link for LICENSE
|
||||
* Implemented by Liao Malin in [#4125](https://github.com/AFNetworking/AFNetworking/pull/4125).
|
||||
* Fix analyzer warning for upload task creation
|
||||
* Implemented by Jeff Kelley in [#4122](https://github.com/AFNetworking/AFNetworking/pull/4122).
|
||||
|
||||
|
||||
## [3.2.0](https://github.com/AFNetworking/AFNetworking/releases/tag/3.2.0) (12/15/2017)
|
||||
Released on Friday, December 15, 2017. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.2.0+is%3Aclosed).
|
||||
|
||||
#### Added
|
||||
* Config `AFImageDownloader` `NSURLCache` and ask `AFImageRequestCache` implementer if an image should be cached
|
||||
* Implemented by wjehenddher in [#4010](https://github.com/AFNetworking/AFNetworking/pull/4010).
|
||||
* Add `XMLParser`/`XMLDocument` serializer tests
|
||||
* Implemented by skyline75489 in [#3753](https://github.com/AFNetworking/AFNetworking/pull/3753).
|
||||
* Enable custom httpbin URL with `HTTPBIN_BASE_URL` environment variable
|
||||
* Implemented by 0xced in [#3748](https://github.com/AFNetworking/AFNetworking/pull/3748).
|
||||
* `AFHTTPSessionManager` now throws exception if SSL pinning mode is set for non https sessions
|
||||
* Implemented by 0xced in [#3687](https://github.com/AFNetworking/AFNetworking/pull/3687).
|
||||
|
||||
#### Updated
|
||||
* Update security policy test certificates
|
||||
* Implemented by SlaunchaMan in [#4103](https://github.com/AFNetworking/AFNetworking/pull/4103).
|
||||
* Allow return value of HTTP redirection block to be `NULL`
|
||||
* Implemented by TheDom in [#3975](https://github.com/AFNetworking/AFNetworking/pull/3975).
|
||||
* Clarify documentation for supported encodings in `AFJSONResponseSerializer`
|
||||
* Implemented by skyline75489 in [#3750](https://github.com/AFNetworking/AFNetworking/pull/3750).
|
||||
* Handle Error Pointers according to Cocoa Convention
|
||||
* Implemented by tclementdev in [#3653](https://github.com/AFNetworking/AFNetworking/pull/3653).
|
||||
* Updates `AFHTTPSessionManager` documentation to reflect v3.x change
|
||||
* Implemented by ecaselles in [#3476](https://github.com/AFNetworking/AFNetworking/pull/3476).
|
||||
* Improved code base to generate fewer warnings when using stricter compiler settings
|
||||
* Implemented by 0xced in [3431](https://github.com/AFNetworking/AFNetworking/pull/3431).
|
||||
|
||||
#### Changed
|
||||
* Change “Mac OS X” and “OS X” references to “macOS”
|
||||
* Implemented by SlaunchaMan in [#4104](https://github.com/AFNetworking/AFNetworking/pull/4104).
|
||||
|
||||
#### Fixed
|
||||
* Fixed crash around customizing `NSURLCache` size for < iOS 8.2
|
||||
* Implemented by kcharwood in [#3735](https://github.com/AFNetworking/AFNetworking/pull/3735).
|
||||
* Fixed issue where `UIWebView` extension did not preserve all of the request information
|
||||
* Implemented by skyline75489 in [#3733](https://github.com/AFNetworking/AFNetworking/pull/3733).
|
||||
* Fixed bug with webview delegate callback
|
||||
* Implemented by kcharwood in [#3727](https://github.com/AFNetworking/AFNetworking/pull/3727).
|
||||
* Fixed crash when passing invalid JSON to request serialization
|
||||
* Implemented by 0xced in [#3719](https://github.com/AFNetworking/AFNetworking/pull/3719).
|
||||
* Fixed potential KVO crasher for URL Session Task delegates
|
||||
* Implemented by 0xced in [#3718](https://github.com/AFNetworking/AFNetworking/pull/3718).
|
||||
* Removed ambiguous array creation in `AFSecurityPolicy`
|
||||
* Implemented by sgl0v in [#3679](https://github.com/AFNetworking/AFNetworking/pull/3679).
|
||||
* Fixed issue where `NS_UNAVAILABLE` is not reported for `AFNetworkReachabilityManager`
|
||||
* Implemented by Microbee23 in [#3649](https://github.com/AFNetworking/AFNetworking/pull/3649).
|
||||
* Require app extension api only on watchOS
|
||||
* Implemented by ethansinjin in [#3612](https://github.com/AFNetworking/AFNetworking/pull/3612).
|
||||
* Remove KVO of progress in favor of using the NSURLSession delegate APIs
|
||||
* Implemented by coreyfloyd in [#3607](https://github.com/AFNetworking/AFNetworking/pull/3607).
|
||||
* Fixed an issue where registering a `UIProgessView` to a task that was causing a crash
|
||||
* Implemented by Starscream27 in [#3604](https://github.com/AFNetworking/AFNetworking/pull/3604).
|
||||
* Moved `[self didChangeValueForKey:@"currentState"]` into correct scope
|
||||
* Implemented by chenxin0123 in [#3565](https://github.com/AFNetworking/AFNetworking/pull/3565).
|
||||
* Fixed issue where response serializers did not inherit super class copying
|
||||
* Implemented by kcharwood in [#3559](https://github.com/AFNetworking/AFNetworking/pull/3559).
|
||||
* Fixed crashes due to race conditions with `NSMutableDictionary` access in `AFHTTPRequestSerializer`
|
||||
* Implemented by alexbird in [#3526](https://github.com/AFNetworking/AFNetworking/pull/3526).
|
||||
* Updated dash character to improve markdown parsing for license
|
||||
* Implemented by gemmakbarlow in [#3488](https://github.com/AFNetworking/AFNetworking/pull/3488).
|
||||
|
||||
#### Removed
|
||||
* Deprecate the unused stringEncoding property of `AFHTTPResponseSerializer`
|
||||
* Implemented by 0xced in [#3751](https://github.com/AFNetworking/AFNetworking/pull/3751).
|
||||
* Removed unused `AFTaskStateChangedContext`
|
||||
* Implemented by yulingtianxia in [#3432](https://github.com/AFNetworking/AFNetworking/pull/3432).
|
||||
|
||||
|
||||
## [3.1.0](https://github.com/AFNetworking/AFNetworking/releases/tag/3.1.0) (03/31/2016)
|
||||
Released on Thursday, March 31, 2016. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.1.0+is%3Aclosed).
|
||||
|
||||
@ -263,7 +173,7 @@ For detailed information about migrating to AFNetworking 3.0.0, please reference
|
||||
* Implemented by Kevin Harwood in [#3034](https://github.com/AFNetworking/AFNetworking/pull/3034).
|
||||
|
||||
|
||||
## [2.6.3](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.3) (11/11/2015)
|
||||
##[2.6.3](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.3) (11/11/2015)
|
||||
Released on Wednesday, November 11, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A2.6.3+is%3Aclosed).
|
||||
|
||||
#### Fixed
|
||||
@ -273,7 +183,7 @@ Released on Wednesday, November 11, 2015. All issues associated with this milest
|
||||
* Fixed by [jcayzac](https://github.com/jcayzac) in [#3139](https://github.com/AFNetworking/AFNetworking/pull/3139).
|
||||
|
||||
|
||||
## [2.6.2](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.2) (11/06/2015)
|
||||
##[2.6.2](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.2) (11/06/2015)
|
||||
Released on Friday, November 06, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A2.6.2+is%3Aclosed).
|
||||
|
||||
### Important Upgrade Note for Swift
|
||||
@ -315,10 +225,10 @@ Released on Friday, November 06, 2015. All issues associated with this milestone
|
||||
## [2.6.1](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.1) (10-13-2015)
|
||||
Released on Tuesday, October 13th, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A2.6.1+is%3Aclosed).
|
||||
|
||||
### Future Compatibility Note
|
||||
###Future Compatibility Note
|
||||
Note that AFNetworking 3.0 will soon be released, and will drop support for all `NSURLConnection` based API's (`AFHTTPRequestOperationManager`, `AFHTTPRequestOperation`, and `AFURLConnectionOperation`. If you have not already migrated to `NSURLSession` based API's, please do so soon. For more information, please see the [3.0 migration guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide).
|
||||
|
||||
#### Fixed
|
||||
####Fixed
|
||||
* Fixed a bug that prevented empty x-www-form-urlencoded bodies.
|
||||
* Fixed by [Julien Cayzac](https://github.com/jcayzac) in [#2868](https://github.com/AFNetworking/AFNetworking/pull/2868).
|
||||
* Fixed bug that prevented AFNetworking from being installed for watchOS via Cocoapods.
|
||||
@ -343,7 +253,7 @@ Note that AFNetworking 3.0 will soon be released, and will drop support for all
|
||||
## [2.6.0](https://github.com/AFNetworking/AFNetworking/releases/tag/2.6.0) (08-19-2015)
|
||||
Released on Wednesday, August 19th, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A2.6.0+is%3Aclosed).
|
||||
|
||||
### Important Upgrade Notes
|
||||
###Important Upgrade Notes
|
||||
Please note the following API/project changes have been made:
|
||||
|
||||
* iOS 6 and OS X 10.8 support has been dropped from the project to facilitate support for watchOS 2. The final release supporting iOS 6 and OS X 10.8 is 2.5.4.
|
||||
@ -370,7 +280,7 @@ Please note the following API/project changes have been made:
|
||||
|
||||
**Note** that support for `NSURLConnection` based API's will be removed in a future update. If you have not already done so, it is recommended that you transition to the `NSURLSession` APIs in the very near future.
|
||||
|
||||
#### Added
|
||||
####Added
|
||||
* Added watchOS 2.0 support. `AFNetworking` can now be added to watchOS targets using CocoaPods.
|
||||
* Added by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2837](https://github.com/AFNetworking/AFNetworking/issues/2837).
|
||||
* Added nullability annotations to all of the header files to improve Swift interoperability.
|
||||
@ -380,7 +290,7 @@ Please note the following API/project changes have been made:
|
||||
* Improved memory performance when download large objects.
|
||||
* Fixed by [Gabe Zabrino](https://github.com/gfzabarino) and [Kevin Harwood](https://github.com/Kevin Harwood) in [#2672](https://github.com/AFNetworking/AFNetworking/pull/2672).
|
||||
|
||||
#### Fixed
|
||||
####Fixed
|
||||
* Fixed a crash related for objects that observe notifications but don't properly unregister.
|
||||
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) and [bnickle](https://github.com/bnickel) in [#2741](https://github.com/AFNetworking/AFNetworking/pull/2741).
|
||||
* Fixed a race condition crash that occured with `AFImageResponseSerialization`.
|
||||
@ -396,7 +306,7 @@ Please note the following API/project changes have been made:
|
||||
* Fixed potential memory leak in `AFNetworkReachabilityManager`.
|
||||
* Fixed by [Julien Cayzac](https://github.com/jcayzac) in [#2867](https://github.com/AFNetworking/AFNetworking/pull/2867).
|
||||
|
||||
#### Documentation Improvements
|
||||
####Documentation Improvements
|
||||
* Clarified best practices for Reachability per Apple recommendations.
|
||||
* Fixed by [Steven Fisher](https://github.com/tewha) in [#2704](https://github.com/AFNetworking/AFNetworking/pull/2704).
|
||||
* Added `startMonitoring` call to the Reachability section of the README
|
||||
@ -409,11 +319,11 @@ Please note the following API/project changes have been made:
|
||||
## [2.5.4](https://github.com/AFNetworking/AFNetworking/releases/tag/2.5.4) (2015-05-14)
|
||||
Released on 2015-05-14. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A2.5.4+is%3Aclosed).
|
||||
|
||||
#### Updated
|
||||
####Updated
|
||||
* Updated the CI test script to run iOS tests on all versions of iOS that are installed on the build machine.
|
||||
* Updated by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2716](https://github.com/AFNetworking/AFNetworking/pull/2716).
|
||||
|
||||
#### Fixed
|
||||
####Fixed
|
||||
|
||||
* Fixed an issue where `AFNSURLSessionTaskDidResumeNotification` and `AFNSURLSessionTaskDidSuspendNotification` were not being properly called due to implementation differences in `NSURLSessionTask` in iOS 7 and iOS 8, which also affects the `AFNetworkActivityIndicatorManager`.
|
||||
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2702](https://github.com/AFNetworking/AFNetworking/pull/2702).
|
||||
@ -1155,7 +1065,7 @@ calls (Mindaugas Vaičiūnas)
|
||||
|
||||
* Update files to remove executable privilege (Kyle Fuller)
|
||||
|
||||
## [2.0.1](https://github.com/AFNetworking/AFNetworking/releases/tag/2.0.1) (2013-10-10)
|
||||
## 2.0.1 (2013-10-10)
|
||||
|
||||
* Fix iOS 6 compatibility (Matt Baker, Mattt Thompson)
|
||||
|
||||
@ -1859,7 +1769,7 @@ Steven Fisher)
|
||||
renamed to `numberOfFinishedOperations` (Mattt Thompson)
|
||||
|
||||
|
||||
## [0.10.0](https://github.com/AFNetworking/AFNetworking/releases/tag/0.10.0) / 2012-06-26
|
||||
## 0.10.0 / 2012-06-26
|
||||
|
||||
* Add Twitter Mac Example application (Mattt Thompson)
|
||||
|
||||
@ -1924,7 +1834,7 @@ renamed to `numberOfFinishedOperations` (Mattt Thompson)
|
||||
* Fix AFHTTPClient to not add unnecessary data when constructing multipart form
|
||||
request with nil parameters (Taeho Kim)
|
||||
|
||||
## [1.0RC1](https://github.com/AFNetworking/AFNetworking/releases/tag/1.0RC1) / 2012-04-25
|
||||
## 1.0RC1 / 2012-04-25
|
||||
|
||||
* Add `AFHTTPRequestOperation +addAcceptableStatusCodes /
|
||||
+addAcceptableContentTypes` to dynamically add acceptable status codes and
|
||||
@ -1944,7 +1854,7 @@ Mattt Thompson)
|
||||
distinction between WWan and WiFi reachability (Kevin Harwood, Mattt Thompson)
|
||||
|
||||
|
||||
## [0.9.2](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.2) / 2012-04-25
|
||||
## 0.9.2 / 2012-04-25
|
||||
|
||||
* Add thread safety to `AFNetworkActivityIndicator` (Peter Steinberger, Mattt
|
||||
Thompson)
|
||||
@ -1989,7 +1899,7 @@ Mattt Thompson)
|
||||
* Remove @try-@catch block wrapping network thread entry point (Charles T. Ahn)
|
||||
|
||||
|
||||
## [0.9.1](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.1) / 2012-03-19
|
||||
## 0.9.1 / 2012-03-19
|
||||
|
||||
* Create Twitter example application (Mattt Thompson)
|
||||
|
||||
@ -2047,7 +1957,7 @@ where % is used as a literal rather than as part of a percent escape code
|
||||
`AFImageRequestOperation` (Michael Schneider)
|
||||
|
||||
|
||||
## [0.9.0](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.0) / 2012-01-23
|
||||
## 0.9.0 / 2012-01-23
|
||||
|
||||
* Add thread-safe behavior to `AFURLConnectionOperation` (Mattt Thompson)
|
||||
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
# 贡献指南
|
||||
本文档包含有关为此项目做出贡献的信息和指南。
|
||||
请在开始参加之前阅读。
|
||||
|
||||
**主题**
|
||||
|
||||
* [提问](#提问)
|
||||
* [报告安全问题](#报告安全问题)
|
||||
* [报告其他问题](#报告其他问题)
|
||||
* [提交拉取请求](#提交拉取请求)
|
||||
* [开发人员原产地证书](#开发人员原产地证书-1.1)
|
||||
* [行为守则](#行为守则)
|
||||
|
||||
## 提问
|
||||
|
||||
我们不使用GitHub的论坛发表问题
|
||||
对于任何非特定于项目本身的使用问题,
|
||||
请直接在[Stack Overflow](https://stackoverflow.com)上询问。
|
||||
通过此方法,你可以快速解决您的问题,
|
||||
并且任何有相同问题的人可以找到答案。
|
||||
这也使维护人员能够专注于为其他人改进项目。
|
||||
|
||||
## 报告安全问题
|
||||
|
||||
Alamofire Software Foundation 认真对待安全问题。
|
||||
如果您发现任何关于安全的问题,请立即通知我们!
|
||||
|
||||
请**不要**公然公开发布问题,
|
||||
而是将您的问题私下发送到<security@alamofire.org>。
|
||||
这将有于帮助确保发现的任何漏洞
|
||||
可以[披露制度](http://en.wikipedia.org/wiki/Responsible_disclosure)
|
||||
对任何受影响的各方
|
||||
|
||||
## 报告其他问题
|
||||
|
||||
为此项目贡献的方法
|
||||
是当遇到问题时,请发送一篇详细的错误报告。
|
||||
我们会感谢您写出的一份精心编写的详尽错误报告。
|
||||
|
||||
在提交问题之前,请检查项目里的问题数据库是否已存在此问题。
|
||||
如果您找到匹配项,请添加“+1”或“我也遇到此问题”。
|
||||
这样做有助于确定最常见问题和请求的优先级。
|
||||
|
||||
报告问题时,请包含以下内容:
|
||||
|
||||
* 您正在使用的Xcode版本
|
||||
* 您的iOS或OS X版本
|
||||
* 任何堆栈轨迹或编译器错误的完整输出
|
||||
* 如果代码段可再现所描述的行为
|
||||
* 任何其他有助于理解问题的细节
|
||||
|
||||
此信息有助于我们更快地查看和修复您的问题。
|
||||
|
||||
## 提交拉取请求
|
||||
|
||||
大力鼓励和欢迎拉取请求。在提交拉取请求时,请创建适当的测试用例,说明修复的问题或新功能。
|
||||
|
||||
## 开发人员原产地证书 1.1
|
||||
|
||||
为了项目做出贡献,我保证:
|
||||
|
||||
- (a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
- (b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
- (c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
- (d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
|
||||
## 行为守则
|
||||
|
||||
该项目采取贡献者公约为准则。
|
||||
|
||||
这项目的成果将会被我们的行为或行动影响。
|
||||
|
||||
我们期望每个为此项目做出贡献的人都会对此表示敬意。
|
||||
|
||||
详情请阅读 [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md)。
|
||||
|
||||
----
|
||||
|
||||
*上述陈述的一些想法和措辞是基于 [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) 和 [Linux](http://elinux.org/Developer_Certificate_Of_Origin) 社区.
|
||||
我们表彰和感激他们为促进项目合作所做的付出。*
|
||||
@ -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 /* iOS Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
29E6F1F41BB9E37200A4466C /* Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* 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 /* iOS Today Extension Example.appex in Embed App Extensions */,
|
||||
29E6F1F41BB9E37200A4466C /* 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 /* macOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "macOS Example.app"; 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; };
|
||||
291BFDED1BB9E8C700FFB029 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
291BFDF21BB9E8C700FFB029 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
291BFDF71BB9E8C700FFB029 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@ -137,7 +137,7 @@
|
||||
29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAppDotNetAPIClient.m; sourceTree = "<group>"; };
|
||||
29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
29E6F1E01BB9E03600A4466C /* Launchscreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Launchscreen.storyboard; path = "iOS Example/Launchscreen.storyboard"; sourceTree = SOURCE_ROOT; };
|
||||
29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "iOS Today Extension Example.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "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 = "<group>"; };
|
||||
29E6F1EC1BB9E37200A4466C /* TodayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TodayViewController.m; sourceTree = "<group>"; };
|
||||
@ -205,7 +205,7 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
291BFDE81BB9E8C700FFB029 /* macOS Example */ = {
|
||||
291BFDE81BB9E8C700FFB029 /* OS X Example */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C2BFE0231C11870800BB258D /* AppDelegate.h */,
|
||||
@ -215,7 +215,7 @@
|
||||
291BFDF71BB9E8C700FFB029 /* Info.plist */,
|
||||
291BFDEC1BB9E8C700FFB029 /* Supporting Files */,
|
||||
);
|
||||
path = "macOS Example";
|
||||
path = "OS X Example";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
291BFDEC1BB9E8C700FFB029 /* Supporting Files */ = {
|
||||
@ -267,7 +267,7 @@
|
||||
29E6F1EA1BB9E37200A4466C /* Today Extension Example */,
|
||||
29E6F20F1BB9E76A00A4466C /* watchOS Example */,
|
||||
29E6F21E1BB9E76A00A4466C /* watchOS Example Extension */,
|
||||
291BFDE81BB9E8C700FFB029 /* macOS Example */,
|
||||
291BFDE81BB9E8C700FFB029 /* OS X Example */,
|
||||
291BFE161BB9ECEE00FFB029 /* tvOS Example */,
|
||||
29E6F1E71BB9E37200A4466C /* Frameworks */,
|
||||
29E6F1761BB9DCB500A4466C /* Products */,
|
||||
@ -281,10 +281,10 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29E6F1751BB9DCB500A4466C /* iOS Example.app */,
|
||||
29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */,
|
||||
29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */,
|
||||
291BFDB91BB9E85400FFB029 /* watchOS Example.app */,
|
||||
291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */,
|
||||
291BFDE71BB9E8C700FFB029 /* macOS Example.app */,
|
||||
291BFDE71BB9E8C700FFB029 /* OS X 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 /* macOS Example */ = {
|
||||
291BFDE61BB9E8C700FFB029 /* OS X Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */;
|
||||
buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */;
|
||||
buildPhases = (
|
||||
291BFDE31BB9E8C700FFB029 /* Sources */,
|
||||
291BFDE41BB9E8C700FFB029 /* Frameworks */,
|
||||
@ -434,9 +434,9 @@
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "macOS Example";
|
||||
name = "OS X Example";
|
||||
productName = "OS X Example";
|
||||
productReference = 291BFDE71BB9E8C700FFB029 /* macOS Example.app */;
|
||||
productReference = 291BFDE71BB9E8C700FFB029 /* OS X 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 /* iOS Today Extension Example */ = {
|
||||
29E6F1E51BB9E37200A4466C /* Today Extension Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */;
|
||||
buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */;
|
||||
buildPhases = (
|
||||
29E6F1E21BB9E37200A4466C /* Sources */,
|
||||
29E6F1E31BB9E37200A4466C /* Frameworks */,
|
||||
@ -489,9 +489,9 @@
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "iOS Today Extension Example";
|
||||
name = "Today Extension Example";
|
||||
productName = "Today Extension Example";
|
||||
productReference = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */;
|
||||
productReference = 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */;
|
||||
productType = "com.apple.product-type.app-extension";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@ -500,7 +500,7 @@
|
||||
29E6F16B1BB9DA2E00A4466C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0930;
|
||||
LastUpgradeCheck = 0710;
|
||||
TargetAttributes = {
|
||||
291BFDB81BB9E85400FFB029 = {
|
||||
CreatedOnToolsVersion = 7.1;
|
||||
@ -528,7 +528,6 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
@ -538,10 +537,10 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
29E6F1741BB9DCB500A4466C /* iOS Example */,
|
||||
29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */,
|
||||
29E6F1E51BB9E37200A4466C /* Today Extension Example */,
|
||||
291BFDB81BB9E85400FFB029 /* watchOS Example */,
|
||||
291BFDC41BB9E85500FFB029 /* watchOS Example Extension */,
|
||||
291BFDE61BB9E8C700FFB029 /* macOS Example */,
|
||||
291BFDE61BB9E8C700FFB029 /* OS X Example */,
|
||||
291BFE141BB9ECEE00FFB029 /* tvOS Example */,
|
||||
);
|
||||
};
|
||||
@ -669,7 +668,7 @@
|
||||
};
|
||||
29E6F1F31BB9E37200A4466C /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */;
|
||||
target = 29E6F1E51BB9E37200A4466C /* Today Extension Example */;
|
||||
targetProxy = 29E6F1F21BB9E37200A4466C /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
@ -710,7 +709,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -759,7 +757,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -803,7 +800,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -853,7 +849,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -897,7 +892,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -927,12 +921,12 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "macOS Example/Info.plist";
|
||||
INFOPLIST_FILE = "OS X 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.macOS-Example";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
@ -947,7 +941,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -971,11 +964,11 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "macOS Example/Info.plist";
|
||||
INFOPLIST_FILE = "OS X 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.macOS-Example";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
@ -991,7 +984,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1028,7 +1020,7 @@
|
||||
SDKROOT = appletvos;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
};
|
||||
@ -1044,7 +1036,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1073,7 +1064,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
@ -1083,66 +1074,12 @@
|
||||
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@ -1155,7 +1092,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1204,7 +1140,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1246,7 +1181,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1295,7 +1229,6 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
@ -1351,7 +1284,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */ = {
|
||||
291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
291BFDF91BB9E8C700FFB029 /* Debug */,
|
||||
@ -1387,7 +1320,7 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */ = {
|
||||
29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
29E6F1F61BB9E37200A4466C /* Debug */,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -15,8 +15,8 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
|
||||
BuildableName = "AFNetworking macOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking macOS Tests"
|
||||
BuildableName = "AFNetworking Mac OS X Tests.xctest"
|
||||
BlueprintName = "AFNetworking Mac OS X Tests"
|
||||
ReferencedContainer = "container:../AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
@ -29,8 +29,8 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
|
||||
BuildableName = "macOS Example.app"
|
||||
BlueprintName = "macOS Example"
|
||||
BuildableName = "OS X Example.app"
|
||||
BlueprintName = "OS X Example"
|
||||
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
@ -42,23 +42,13 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
|
||||
BuildableName = "AFNetworking macOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking macOS Tests"
|
||||
ReferencedContainer = "container:../AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
|
||||
BuildableName = "macOS Example.app"
|
||||
BlueprintName = "macOS Example"
|
||||
BuildableName = "OS X Example.app"
|
||||
BlueprintName = "OS X Example"
|
||||
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
@ -80,8 +70,8 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
|
||||
BuildableName = "macOS Example.app"
|
||||
BlueprintName = "macOS Example"
|
||||
BuildableName = "OS X Example.app"
|
||||
BlueprintName = "OS X Example"
|
||||
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
@ -99,8 +89,8 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
|
||||
BuildableName = "macOS Example.app"
|
||||
BlueprintName = "macOS Example"
|
||||
BuildableName = "OS X Example.app"
|
||||
BlueprintName = "OS X Example"
|
||||
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
wasCreatedForAppExtension = "YES"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
@ -30,8 +30,8 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "29E6F1E51BB9E37200A4466C"
|
||||
BuildableName = "iOS Today Extension Example.appex"
|
||||
BlueprintName = "iOS Today Extension Example"
|
||||
BuildableName = "Today Extension Example.appex"
|
||||
BlueprintName = "Today Extension Example"
|
||||
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
@ -57,16 +57,6 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
|
||||
BuildableName = "AFNetworking iOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking iOS Tests"
|
||||
ReferencedContainer = "container:../AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -42,16 +42,6 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
|
||||
BuildableName = "AFNetworking iOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking iOS Tests"
|
||||
ReferencedContainer = "container:../AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@ -42,16 +42,6 @@
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2987B0AD1BC408A200179A4C"
|
||||
BuildableName = "AFNetworking tvOS Tests.xctest"
|
||||
BlueprintName = "AFNetworking tvOS Tests"
|
||||
ReferencedContainer = "container:../AFNetworking.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0930"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@ -237,7 +237,6 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
@ -391,7 +390,6 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -407,7 +405,6 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-tvOS-Example";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@ -2,109 +2,79 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-Small@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-Small@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"filename" : "Icon-Small@3x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-40@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-40@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"filename" : "Icon-40@3x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-60@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"filename" : "Icon-60@3x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"filename" : "Icon-Small.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-Small@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-Small@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"filename" : "Icon-40.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-40@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"filename" : "Icon-76.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
"scale" : "2x",
|
||||
"filename" : "Icon-76@2x.png"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "makeappicon"
|
||||
}
|
||||
}
|
||||
@ -46,10 +46,8 @@
|
||||
self.postsArrayController.content = posts;
|
||||
}];
|
||||
|
||||
__weak __typeof(self)weakSelf = self;
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf.tableView reloadData];
|
||||
[self.tableView reloadData];
|
||||
}];
|
||||
}
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9052" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9052"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@ -15,10 +13,10 @@
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="AFNetworking macOS Example" id="56">
|
||||
<menu key="submenu" title="AFNetworking macOS Example" systemMenu="apple" id="57">
|
||||
<menuItem title="AFNetworking OS X Example" id="56">
|
||||
<menu key="submenu" title="AFNetworking OS X Example" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About AFNetworking macOS Example" id="58">
|
||||
<menuItem title="About AFNetworking OS X Example" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
@ -33,7 +31,7 @@
|
||||
<menuItem isSeparatorItem="YES" id="144">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide AFNetworking macOS Example" keyEquivalent="h" id="134">
|
||||
<menuItem title="Hide AFNetworking OS X Example" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="367"/>
|
||||
</connections>
|
||||
@ -52,7 +50,7 @@
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit AFNetworking macOS Example" keyEquivalent="q" id="136">
|
||||
<menuItem title="Quit AFNetworking OS X Example" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-3" id="449"/>
|
||||
</connections>
|
||||
@ -150,7 +148,7 @@
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="491">
|
||||
<items>
|
||||
<menuItem title="AFNetworking macOS Example Help" keyEquivalent="?" id="492">
|
||||
<menuItem title="AFNetworking OS X Example Help" keyEquivalent="?" id="492">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="493"/>
|
||||
</connections>
|
||||
@ -160,11 +158,11 @@
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<window title="AFNetworking macOS Example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<window title="AFNetworking OS X Example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" unifiedTitleAndToolbar="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="60" y="295" width="331" height="500"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
|
||||
<value key="minSize" type="size" width="375" height="200"/>
|
||||
<value key="maxSize" type="size" width="375" height="1280"/>
|
||||
<view key="contentView" id="372">
|
||||
@ -178,13 +176,13 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="85" rowSizeStyle="automatic" viewBased="YES" id="541">
|
||||
<rect key="frame" x="0.0" y="0.0" width="331" height="498"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="331" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="10" height="10"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn identifier="" width="321" minWidth="70" maxWidth="10000" id="542">
|
||||
<tableColumn width="321" minWidth="70" maxWidth="10000" id="542">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -263,6 +261,7 @@
|
||||
</tableColumns>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="540">
|
||||
<rect key="frame" x="1" y="484" width="373" height="15"/>
|
||||
@ -50,6 +50,7 @@
|
||||
- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler {
|
||||
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
|
||||
if (!error) {
|
||||
|
||||
self.post = posts.firstObject;
|
||||
[self savePost:self.post];
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -12,12 +12,6 @@
|
||||
"filename" : "App Icon - Small.imagestack",
|
||||
"role" : "primary-app-icon"
|
||||
},
|
||||
{
|
||||
"size" : "2320x720",
|
||||
"idiom" : "tv",
|
||||
"filename" : "Top Shelf Image Wide.imageset",
|
||||
"role" : "top-shelf-image-wide"
|
||||
},
|
||||
{
|
||||
"size" : "1920x720",
|
||||
"idiom" : "tv",
|
||||
@ -29,4 +23,4 @@
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@ -3,10 +3,6 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -1,12 +1,5 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "tv",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "11.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "tv",
|
||||
|
||||
@ -39,7 +39,7 @@ private extension String {
|
||||
hash += String(format: "%02x", result[i])
|
||||
}
|
||||
|
||||
result.deallocate()
|
||||
result.deallocate(capacity: digestLength)
|
||||
|
||||
return String(format: hash)
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@ FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
|
||||
#import <AFNetworking/AFURLRequestSerialization.h>
|
||||
#import <AFNetworking/AFURLResponseSerialization.h>
|
||||
#import <AFNetworking/AFSecurityPolicy.h>
|
||||
#import <AFNetworking/AFCompatibilityMacros.h>
|
||||
|
||||
#if !TARGET_OS_WATCH
|
||||
#import <AFNetworking/AFNetworkReachabilityManager.h>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
@ -15,11 +15,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.1.0</string>
|
||||
<string>3.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.2.1</string>
|
||||
<string>3.1.0</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
|
||||
10
README.md
10
README.md
@ -9,7 +9,7 @@
|
||||
[](http://cocoadocs.org/docsets/AFNetworking)
|
||||
[](http://twitter.com/AFNetworking)
|
||||
|
||||
AFNetworking is a delightful networking library for iOS, macOS, watchOS, and tvOS. It's built on top of the [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
|
||||
AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
|
||||
|
||||
Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac.
|
||||
|
||||
@ -83,7 +83,7 @@ Run `carthage` to build the framework and drag the built `AFNetworking.framework
|
||||
|
||||
## Requirements
|
||||
|
||||
| AFNetworking Version | Minimum iOS Target | Minimum macOS Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
|
||||
| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
|
||||
|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:|
|
||||
| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. |
|
||||
| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. |
|
||||
@ -91,7 +91,7 @@ Run `carthage` to build the framework and drag the built `AFNetworking.framework
|
||||
| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a |
|
||||
| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a |
|
||||
|
||||
(macOS projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
|
||||
(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
|
||||
|
||||
> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs.
|
||||
|
||||
@ -112,7 +112,7 @@ Run `carthage` to build the framework and drag the built `AFNetworking.framework
|
||||
- `AFHTTPResponseSerializer`
|
||||
- `AFJSONResponseSerializer`
|
||||
- `AFXMLParserResponseSerializer`
|
||||
- `AFXMLDocumentResponseSerializer` _(macOS)_
|
||||
- `AFXMLDocumentResponseSerializer` _(Mac OS X)_
|
||||
- `AFPropertyListResponseSerializer`
|
||||
- `AFImageResponseSerializer`
|
||||
- `AFCompoundResponseSerializer`
|
||||
@ -319,4 +319,4 @@ If you believe you have identified a security vulnerability with AFNetworking, y
|
||||
|
||||
## License
|
||||
|
||||
AFNetworking is released under the MIT license. See [LICENSE](https://github.com/AFNetworking/AFNetworking/blob/master/LICENSE) for details.
|
||||
AFNetworking is released under the MIT license. See LICENSE for details.
|
||||
|
||||
BIN
Tests/Resources/HTTPBin.org/AddTrust_External_CA_Root.cer
Normal file
BIN
Tests/Resources/HTTPBin.org/AddTrust_External_CA_Root.cer
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tests/Resources/HTTPBin.org/httpbinorg_01192017.cer
Normal file
BIN
Tests/Resources/HTTPBin.org/httpbinorg_01192017.cer
Normal file
Binary file not shown.
Binary file not shown.
@ -219,7 +219,7 @@
|
||||
UInt64 postPurgeMemoryUsage = self.cache.memoryUsage;
|
||||
XCTAssertTrue(postPurgeMemoryUsage < prePurgeMemoryUsage);
|
||||
|
||||
for (NSUInteger index = 0; index <= numberOfImages; index++) {
|
||||
for (NSUInteger index = 0; index <= numberOfImages ; index++) {
|
||||
NSString * identifier = [NSString stringWithFormat:@"image-%ld",(long)index];
|
||||
UIImage *cachedImage = [self.cache imageWithIdentifier:identifier];
|
||||
if (index == 0 || index >= 6) {
|
||||
@ -230,12 +230,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
@ -71,8 +71,8 @@
|
||||
XCTAssertNotNil(copiedSerializer);
|
||||
XCTAssertNotEqual(compoundSerializer, copiedSerializer);
|
||||
XCTAssertTrue(compoundSerializer.responseSerializers.count == copiedSerializer.responseSerializers.count);
|
||||
XCTAssertTrue([NSStringFromClass([copiedSerializer.responseSerializers[0] class]) isEqualToString:NSStringFromClass([AFImageResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([copiedSerializer.responseSerializers[1] class]) isEqualToString:NSStringFromClass([AFJSONResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([[copiedSerializer.responseSerializers objectAtIndex:0] class]) isEqualToString:NSStringFromClass([AFImageResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([[copiedSerializer.responseSerializers objectAtIndex:1] class]) isEqualToString:NSStringFromClass([AFJSONResponseSerializer class])]);
|
||||
XCTAssertEqual(compoundSerializer.acceptableStatusCodes, copiedSerializer.acceptableStatusCodes);
|
||||
XCTAssertEqual(compoundSerializer.acceptableContentTypes, copiedSerializer.acceptableContentTypes);
|
||||
}
|
||||
@ -87,8 +87,8 @@
|
||||
XCTAssertNotNil(unarchivedSerializer);
|
||||
XCTAssertNotEqual(unarchivedSerializer, compoundSerializer);
|
||||
XCTAssertTrue(compoundSerializer.responseSerializers.count == compoundSerializer.responseSerializers.count);
|
||||
XCTAssertTrue([NSStringFromClass([unarchivedSerializer.responseSerializers[0] class]) isEqualToString:NSStringFromClass([AFImageResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([unarchivedSerializer.responseSerializers[1] class]) isEqualToString:NSStringFromClass([AFJSONResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([[unarchivedSerializer.responseSerializers objectAtIndex:0] class]) isEqualToString:NSStringFromClass([AFImageResponseSerializer class])]);
|
||||
XCTAssertTrue([NSStringFromClass([[unarchivedSerializer.responseSerializers objectAtIndex:1] class]) isEqualToString:NSStringFromClass([AFJSONResponseSerializer class])]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -169,9 +169,7 @@
|
||||
NSError *serializerError = [NSError errorWithDomain:@"TestDomain" code:0 userInfo:nil];
|
||||
|
||||
[serializer setQueryStringSerializationWithBlock:^NSString *(NSURLRequest *request, NSDictionary *parameters, NSError *__autoreleasing *error) {
|
||||
if (error != NULL) {
|
||||
*error = serializerError;
|
||||
}
|
||||
*error = serializerError;
|
||||
return nil;
|
||||
}];
|
||||
|
||||
|
||||
@ -25,25 +25,24 @@
|
||||
#import "AFSecurityPolicy.h"
|
||||
|
||||
@interface AFHTTPSessionManagerTests : AFTestCase
|
||||
@property (readwrite, nonatomic, strong) AFHTTPSessionManager *sessionManager;
|
||||
@property (readwrite, nonatomic, strong) AFHTTPSessionManager *manager;
|
||||
@end
|
||||
|
||||
@implementation AFHTTPSessionManagerTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
self.sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:self.baseURL];
|
||||
self.manager = [[AFHTTPSessionManager alloc] initWithBaseURL:self.baseURL];
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
self.sessionManager = nil;
|
||||
[self.manager invalidateSessionCancelingTasks:YES];
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
#pragma mark - init
|
||||
- (void)testSharedManagerIsNotEqualToInitedManager {
|
||||
XCTAssertFalse([[AFHTTPSessionManager manager] isEqual:self.sessionManager]);
|
||||
- (void)testSharedManagerIsNotEqualToInitdManager {
|
||||
XCTAssertFalse([[AFHTTPSessionManager manager] isEqual:self.manager]);
|
||||
}
|
||||
|
||||
#pragma mark - misc
|
||||
@ -55,7 +54,7 @@
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/get" relativeToURL:self.baseURL]];
|
||||
NSURLSessionDataTask *task = [self.sessionManager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil
|
||||
NSURLSessionDataTask *task = [self.manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil
|
||||
completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
blockResponseObject = responseObject;
|
||||
blockError = error;
|
||||
@ -77,7 +76,7 @@
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
|
||||
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/status/404" relativeToURL:self.baseURL]];
|
||||
NSURLSessionDataTask *task = [self.sessionManager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil
|
||||
NSURLSessionDataTask *task = [self.manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil
|
||||
completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
blockError = error;
|
||||
[expectation fulfill];
|
||||
@ -98,13 +97,13 @@
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
|
||||
NSURLRequest *redirectRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/redirect/1" relativeToURL:self.baseURL]];
|
||||
NSURLSessionDataTask *redirectTask = [self.sessionManager dataTaskWithRequest:redirectRequest uploadProgress:nil downloadProgress:nil
|
||||
NSURLSessionDataTask *redirectTask = [self.manager dataTaskWithRequest:redirectRequest uploadProgress:nil downloadProgress:nil
|
||||
completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
|
||||
blockError = error;
|
||||
[expectation fulfill];
|
||||
}];
|
||||
|
||||
[self.sessionManager setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest *(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request) {
|
||||
[self.manager setTaskWillPerformHTTPRedirectionBlock:^NSURLRequest *(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request) {
|
||||
if (response) {
|
||||
success = YES;
|
||||
}
|
||||
@ -127,14 +126,14 @@
|
||||
__block NSURL *downloadFilePath = nil;
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
|
||||
[self.sessionManager setDownloadTaskDidFinishDownloadingBlock:^NSURL *(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location) {
|
||||
[self.manager setDownloadTaskDidFinishDownloadingBlock:^NSURL *(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location) {
|
||||
managerDownloadFinishedBlockExecuted = YES;
|
||||
NSURL *dirURL = [[[NSFileManager defaultManager] URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
|
||||
return [dirURL URLByAppendingPathComponent:@"t1.file"];
|
||||
}];
|
||||
|
||||
NSURLSessionDownloadTask *downloadTask;
|
||||
downloadTask = [self.sessionManager
|
||||
downloadTask = [self.manager
|
||||
downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
|
||||
progress:nil
|
||||
destination:nil
|
||||
@ -156,7 +155,7 @@
|
||||
__block NSURL *downloadFilePath = nil;
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
|
||||
NSURLSessionDownloadTask *downloadTask = [self.sessionManager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
|
||||
NSURLSessionDownloadTask *downloadTask = [self.manager downloadTaskWithRequest:[NSURLRequest requestWithURL:self.baseURL]
|
||||
progress:nil
|
||||
destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {
|
||||
destinationBlockExecuted = YES;
|
||||
@ -178,18 +177,15 @@
|
||||
- (void)testThatSerializationErrorGeneratesErrorAndNullTaskForGET {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Serialization should fail"];
|
||||
|
||||
[self.sessionManager.requestSerializer setQueryStringSerializationWithBlock:^NSString * _Nonnull(NSURLRequest * _Nonnull request, id _Nonnull parameters, NSError * _Nullable __autoreleasing * _Nullable error) {
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:@"Custom" code:-1 userInfo:nil];
|
||||
}
|
||||
[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];
|
||||
return @"";
|
||||
}];
|
||||
|
||||
NSURLSessionTask *nilTask;
|
||||
nilTask = [self.sessionManager
|
||||
nilTask = [self.manager
|
||||
GET:@"test"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:nil
|
||||
failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
@ -207,12 +203,12 @@
|
||||
}
|
||||
|
||||
- (void)testCanBeEncoded {
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.sessionManager];
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.manager];
|
||||
XCTAssertNotNil(data);
|
||||
}
|
||||
|
||||
- (void)testCanBeDecoded {
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.sessionManager];
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.manager];
|
||||
AFHTTPSessionManager *newManager = [NSKeyedUnarchiver unarchiveObjectWithData:data];
|
||||
XCTAssertNotNil(newManager.securityPolicy);
|
||||
XCTAssertNotNil(newManager.requestSerializer);
|
||||
@ -225,7 +221,7 @@
|
||||
#pragma mark - NSCopying
|
||||
|
||||
- (void)testCanBeCopied {
|
||||
AFHTTPSessionManager *copyManager = [self.sessionManager copy];
|
||||
AFHTTPSessionManager *copyManager = [self.manager copy];
|
||||
XCTAssertNotNil(copyManager);
|
||||
}
|
||||
|
||||
@ -233,10 +229,9 @@
|
||||
|
||||
- (void)testDownloadProgressIsReportedForGET {
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"image"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
if (downloadProgress.fractionCompleted == 1.0) {
|
||||
[expectation fulfill];
|
||||
@ -244,7 +239,7 @@
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testUploadProgressIsReportedForPOST {
|
||||
@ -255,10 +250,9 @@
|
||||
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:payload
|
||||
headers:nil
|
||||
progress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
if (uploadProgress.fractionCompleted == 1.0) {
|
||||
[expectation fulfill];
|
||||
@ -266,7 +260,7 @@
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testUploadProgressIsReportedForStreamingPost {
|
||||
@ -277,76 +271,7 @@
|
||||
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
|
||||
[self.sessionManager
|
||||
POST:@"post"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
[formData appendPartWithFileData:[payload dataUsingEncoding:NSUTF8StringEncoding] name:@"AFNetworking" fileName:@"AFNetworking" mimeType:@"text/html"];
|
||||
}
|
||||
progress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
if (uploadProgress.fractionCompleted == 1.0) {
|
||||
[expectation fulfill];
|
||||
}
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
# pragma mark - Deprecated Progress
|
||||
|
||||
- (void)testDownloadProgressIsReportedForDeprecatedGET {
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
GET:@"image"
|
||||
parameters:nil
|
||||
progress:^(NSProgress * _Nonnull downloadProgress) {
|
||||
if (downloadProgress.fractionCompleted == 1.0) {
|
||||
[expectation fulfill];
|
||||
}
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testUploadProgressIsReportedForDeprecatedPOST {
|
||||
NSMutableString *payload = [NSMutableString stringWithString:@"AFNetworking"];
|
||||
while ([payload lengthOfBytesUsingEncoding:NSUTF8StringEncoding] < 20000) {
|
||||
[payload appendString:@"AFNetworking"];
|
||||
}
|
||||
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
POST:@"post"
|
||||
parameters:payload
|
||||
progress:^(NSProgress * _Nonnull uploadProgress) {
|
||||
if (uploadProgress.fractionCompleted == 1.0) {
|
||||
[expectation fulfill];
|
||||
}
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testUploadProgressIsReportedForStreamingDeprecatedPost {
|
||||
NSMutableString *payload = [NSMutableString stringWithString:@"AFNetworking"];
|
||||
while ([payload lengthOfBytesUsingEncoding:NSUTF8StringEncoding] < 20000) {
|
||||
[payload appendString:@"AFNetworking"];
|
||||
}
|
||||
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:nil
|
||||
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
@ -359,54 +284,50 @@
|
||||
}
|
||||
success:nil
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
# pragma mark - HTTP Status Codes
|
||||
|
||||
- (void)testThatSuccessBlockIsCalledFor200 {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"status/200"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatFailureBlockIsCalledFor404 {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"status/404"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:nil
|
||||
failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nullable error) {
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatResponseObjectIsEmptyFor204 {
|
||||
__block id urlResponseObject = nil;
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"status/204"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
urlResponseObject = responseObject;
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNil(urlResponseObject);
|
||||
}
|
||||
|
||||
@ -414,55 +335,50 @@
|
||||
|
||||
- (void)testGET {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"get"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertNotNil(responseObject);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testHEAD {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
HEAD:@"get"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task) {
|
||||
XCTAssertNotNil(task);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testPOST {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:@{@"field":@"value"}
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([task.originalRequest.allHTTPHeaderFields[@"field"] isEqualToString:@"value"]);
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testPOSTWithConstructingBody {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:@{@"field":@"value"}
|
||||
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
[formData appendPartWithFileData:[@"Data" dataUsingEncoding:NSUTF8StringEncoding]
|
||||
name:@"DataName"
|
||||
@ -471,68 +387,61 @@
|
||||
}
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([task.originalRequest.allHTTPHeaderFields[@"field"] isEqualToString:@"value"]);
|
||||
XCTAssertTrue([responseObject[@"files"][@"DataName"] isEqualToString:@"Data"]);
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testPUT {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
PUT:@"put"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:@{@"field":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([task.originalRequest.allHTTPHeaderFields[@"field"] isEqualToString:@"value"]);
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testDELETE {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
DELETE:@"delete"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:@{@"field":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([task.originalRequest.allHTTPHeaderFields[@"field"] isEqualToString:@"value"]);
|
||||
XCTAssertTrue([responseObject[@"args"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testPATCH {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
PATCH:@"patch"
|
||||
parameters:@{@"key":@"value"}
|
||||
headers:@{@"field":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([task.originalRequest.allHTTPHeaderFields[@"field"] isEqualToString:@"value"]);
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Deprecated Rest Interface
|
||||
|
||||
- (void)testDeprecatedGETWithoutProgress {
|
||||
- (void)testDeprecatedGET {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
GET:@"get"
|
||||
parameters:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
@ -541,14 +450,14 @@
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPOSTWithoutProgress {
|
||||
- (void)testDeprecatedPOST {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
@ -557,14 +466,14 @@
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPOSTWithoutProgressWithConstructingBody {
|
||||
- (void)testDeprecatedPOSTWithConstructingBody {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
[self.manager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
@ -580,141 +489,17 @@
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
|
||||
- (void)testDeprecatedGETWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
GET:@"get"
|
||||
parameters:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertNotNil(responseObject);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedHEADWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
HEAD:@"get"
|
||||
parameters:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task) {
|
||||
XCTAssertNotNil(task);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPOSTWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPOSTWithoutHeadersWithConstructingBody {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
POST:@"post"
|
||||
parameters:@{@"key":@"value"}
|
||||
constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
[formData appendPartWithFileData:[@"Data" dataUsingEncoding:NSUTF8StringEncoding]
|
||||
name:@"DataName"
|
||||
fileName:@"DataFileName"
|
||||
mimeType:@"data"];
|
||||
}
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([responseObject[@"files"][@"DataName"] isEqualToString:@"Data"]);
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPUTWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
PUT:@"put"
|
||||
parameters:@{@"key":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedDELETEWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
DELETE:@"delete"
|
||||
parameters:@{@"key":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([responseObject[@"args"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testDeprecatedPATCHWithoutHeaders {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.sessionManager
|
||||
PATCH:@"patch"
|
||||
parameters:@{@"key":@"value"}
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]);
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
#pragma clang diagnostic pop
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Auth
|
||||
|
||||
- (void)testHiddenBasicAuthentication {
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Request should finish"];
|
||||
[self.sessionManager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"user" password:@"password"];
|
||||
[self.sessionManager
|
||||
[self.manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"user" password:@"password"];
|
||||
[self.manager
|
||||
GET:@"hidden-basic-auth/user/password"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
[expectation fulfill];
|
||||
@ -722,7 +507,7 @@
|
||||
XCTFail(@"Request should succeed");
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
# pragma mark - Security Policy
|
||||
@ -787,7 +572,6 @@
|
||||
[manager
|
||||
GET:@""
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTFail(@"Request should fail");
|
||||
@ -798,8 +582,8 @@
|
||||
XCTAssertEqual(error.code, NSURLErrorCancelled);
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[manager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[manager invalidateSessionCancelingTasks:YES];
|
||||
}
|
||||
|
||||
- (void)testInvalidServerTrustProducesCorrectErrorForPublicKeyPinning {
|
||||
@ -812,7 +596,6 @@
|
||||
[manager
|
||||
GET:@""
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||
XCTFail(@"Request should fail");
|
||||
@ -823,8 +606,8 @@
|
||||
XCTAssertEqual(error.code, NSURLErrorCancelled);
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[manager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[manager invalidateSessionCancelingTasks:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -22,11 +22,6 @@
|
||||
#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;
|
||||
@ -45,7 +40,7 @@
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
[self.downloader.sessionManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self.downloader.sessionManager invalidateSessionCancelingTasks:YES];
|
||||
self.downloader = nil;
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
@ -85,7 +80,7 @@
|
||||
XCTAssertTrue(error.code == NSURLErrorBadURL);
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNil(downloadReceipt, @"downloadReceipt should be nil");
|
||||
}
|
||||
|
||||
@ -104,7 +99,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertNotNil(urlResponse, @"HTTPURLResponse should not be nil");
|
||||
XCTAssertNotNil(responseImage, @"Response image should not be nil");
|
||||
@ -137,7 +132,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertNotNil(urlResponse1, @"HTTPURLResponse should not be nil");
|
||||
XCTAssertNotNil(responseImage1, @"Respone image should not be nil");
|
||||
@ -173,7 +168,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertEqual(urlResponse1, urlResponse2, @"responses should be equal");
|
||||
XCTAssertEqual(responseImage2, responseImage2, @"responses should be equal");
|
||||
@ -195,7 +190,7 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNotNil(urlResponse);
|
||||
XCTAssertNotNil(responseImage);
|
||||
|
||||
@ -216,7 +211,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
||||
__block NSHTTPURLResponse *urlResponse2 = nil;
|
||||
@ -231,7 +226,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertNotNil(urlResponse1);
|
||||
XCTAssertNotNil(responseImage1);
|
||||
@ -239,112 +234,6 @@
|
||||
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"];
|
||||
|
||||
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;
|
||||
@ -355,7 +244,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
||||
|
||||
@ -367,7 +256,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertNotNil(receipt1);
|
||||
XCTAssertNil(receipt2);
|
||||
@ -388,7 +277,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
||||
NSMutableURLRequest *alteredRequest = [self.pngRequest mutableCopy];
|
||||
@ -406,7 +295,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertNotNil(receipt1);
|
||||
XCTAssertNotNil(receipt2);
|
||||
@ -435,7 +324,7 @@
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self.downloader cancelTaskForImageDownloadReceipt:receipt];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertTrue(responseError.code == NSURLErrorCancelled);
|
||||
XCTAssertTrue([responseError.domain isEqualToString:NSURLErrorDomain]);
|
||||
@ -466,7 +355,7 @@
|
||||
[expectation2 fulfill];
|
||||
}];
|
||||
[self.downloader cancelTaskForImageDownloadReceipt:receipt];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
XCTAssertTrue(responseError.code == NSURLErrorCancelled);
|
||||
XCTAssertTrue([responseError.domain isEqualToString:NSURLErrorDomain]);
|
||||
@ -509,7 +398,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Threading
|
||||
@ -523,7 +412,7 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertTrue(successIsOnMainThread);
|
||||
}
|
||||
|
||||
@ -538,7 +427,7 @@
|
||||
failureIsOnMainThread = [[NSThread currentThread] isMainThread];
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertTrue(failureIsOnMainThread);
|
||||
}
|
||||
|
||||
@ -556,24 +445,3 @@
|
||||
}
|
||||
|
||||
@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
|
||||
|
||||
@ -45,7 +45,7 @@ static NSData * AFJSONTestData() {
|
||||
- (void)testThatJSONRequestSerializationHandlesParametersDictionary {
|
||||
NSDictionary *parameters = @{@"key":@"value"};
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:AFNetworkingTestsBaseURLString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNil(error, @"Serialization error should be nil");
|
||||
|
||||
@ -57,7 +57,7 @@ static NSData * AFJSONTestData() {
|
||||
- (void)testThatJSONRequestSerializationHandlesParametersArray {
|
||||
NSArray *parameters = @[@{@"key":@"value"}];
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:AFNetworkingTestsBaseURLString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNil(error, @"Serialization error should be nil");
|
||||
|
||||
@ -66,29 +66,6 @@ static NSData * AFJSONTestData() {
|
||||
XCTAssertTrue([@"[{\"key\":\"value\"}]" isEqualToString:body], @"Parameters were not encoded correctly");
|
||||
}
|
||||
|
||||
- (void)testThatJSONRequestSerializationHandlesInvalidParameters {
|
||||
NSString *string = [[NSString alloc] initWithBytes:"\xd8\x00" length:2 encoding:NSUTF16StringEncoding];
|
||||
|
||||
NSDictionary *parameters = @{@"key":string};
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNil(request, @"Expected nil request.");
|
||||
XCTAssertNotNil(error, @"Expected non-nil error.");
|
||||
}
|
||||
|
||||
- (void)testThatJSONRequestSerializationErrorsWithInvalidJSON {
|
||||
NSDictionary *parameters = @{@"key":[NSSet setWithObject:@"value"]};
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNil(request, @"Request should be nil");
|
||||
XCTAssertNotNil(error, @"Serialization error should be not nil");
|
||||
XCTAssertEqualObjects(error.domain, AFURLRequestSerializationErrorDomain);
|
||||
XCTAssertEqual(error.code, NSURLErrorCannotDecodeContentData);
|
||||
XCTAssertEqualObjects(error.localizedFailureReason, @"The `parameters` argument is not valid JSON.");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
@ -177,7 +154,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]}], @"arrayWithNulls": @[[NSNull null]]}
|
||||
NSData *data = [NSJSONSerialization dataWithJSONObject:@{@"key":@"value",@"nullkey":[NSNull null],@"array":@[@{@"subnullkey":[NSNull null]}]}
|
||||
options:(NSJSONWritingOptions)0
|
||||
error:nil];
|
||||
|
||||
@ -189,7 +166,6 @@ static NSData * AFJSONTestData() {
|
||||
XCTAssertNotNil(responseObject[@"key"]);
|
||||
XCTAssertNil(responseObject[@"nullkey"]);
|
||||
XCTAssertNil(responseObject[@"array"][0][@"subnullkey"]);
|
||||
XCTAssertEqualObjects(responseObject[@"arrayWithNulls"], @[]);
|
||||
}
|
||||
|
||||
- (void)testThatJSONResponseSerializerCanBeCopied {
|
||||
|
||||
@ -46,8 +46,7 @@
|
||||
[super tearDown];
|
||||
self.networkActivityIndicatorManager = nil;
|
||||
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
self.sessionManager = nil;
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -70,13 +69,12 @@
|
||||
[self.sessionManager
|
||||
GET:@"/delay/1"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
|
||||
[requestExpectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatNetworkActivityIndicatorTurnsOnAndOffIndicatorWhenRequestFails {
|
||||
@ -97,13 +95,12 @@
|
||||
[self.sessionManager
|
||||
GET:@"/status/404"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:nil
|
||||
failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
[requestExpectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatVisibilityDelaysAreApplied {
|
||||
@ -131,14 +128,13 @@
|
||||
[self.sessionManager
|
||||
GET:@"/delay/2"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
|
||||
requestEndTime = CACurrentMediaTime();
|
||||
[requestExpectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertTrue((indicatorVisbleTime - requestStartTime) > self.networkActivityIndicatorManager.activationDelay);
|
||||
XCTAssertTrue((indicatorHiddenTime - requestEndTime) > self.networkActivityIndicatorManager.completionDelay);
|
||||
}
|
||||
@ -161,7 +157,6 @@
|
||||
[self.sessionManager
|
||||
GET:@"/delay/4"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
|
||||
[requestExpectation fulfill];
|
||||
@ -172,7 +167,6 @@
|
||||
[self.sessionManager
|
||||
GET:@"/delay/2"
|
||||
parameters:nil
|
||||
headers:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
|
||||
|
||||
@ -180,7 +174,7 @@
|
||||
}
|
||||
failure:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
|
||||
#import "AFNetworkReachabilityManager.h"
|
||||
#import <netinet/in.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
@interface AFNetworkReachabilityManagerTests : AFTestCase
|
||||
@property (nonatomic, strong) AFNetworkReachabilityManager *addressReachability;
|
||||
@ -48,20 +47,6 @@
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testInitializerThrowsExceptionWhenCalled {
|
||||
AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager alloc];
|
||||
id (*custom_msgSend)(id, SEL) = (id(*)(id, SEL))objc_msgSend;
|
||||
|
||||
XCTAssertThrows(custom_msgSend(manager, @selector(init)));
|
||||
}
|
||||
|
||||
- (void)testNewThrowsExceptionWhenCalled {
|
||||
id (*custom_msgSend)(id, SEL) = (id(*)(id, SEL))objc_msgSend;
|
||||
|
||||
XCTAssertThrows(custom_msgSend([AFNetworkReachabilityManager class],
|
||||
@selector(new)));
|
||||
}
|
||||
|
||||
- (void)testAddressReachabilityStartsInUnknownState {
|
||||
XCTAssertEqual(self.addressReachability.networkReachabilityStatus, AFNetworkReachabilityStatusUnknown,
|
||||
@"Reachability should start in an unknown state");
|
||||
@ -79,40 +64,51 @@
|
||||
handler:^BOOL(NSNotification *note) {
|
||||
AFNetworkReachabilityStatus status;
|
||||
status = [note.userInfo[AFNetworkingReachabilityNotificationStatusItem] integerValue];
|
||||
BOOL isReachable = (status == AFNetworkReachabilityStatusReachableViaWiFi
|
||||
|| status == AFNetworkReachabilityStatusReachableViaWWAN);
|
||||
return isReachable;
|
||||
BOOL reachable = (status == AFNetworkReachabilityStatusReachableViaWiFi
|
||||
|| status == AFNetworkReachabilityStatusReachableViaWWAN);
|
||||
|
||||
if (reachable) {
|
||||
XCTAssert(reachable,
|
||||
@"Expected network to be reachable but got '%@'",
|
||||
AFStringFromNetworkReachabilityStatus(status));
|
||||
XCTAssertEqual(reachable, manager.isReachable, @"Expected status to match 'isReachable'");
|
||||
}
|
||||
|
||||
return reachable;
|
||||
}];
|
||||
|
||||
[manager startMonitoring];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testAddressReachabilityNotification {
|
||||
[self verifyReachabilityNotificationGetsPostedWithManager:self.addressReachability];
|
||||
}
|
||||
|
||||
- (void)testDomainReachabilityNotification {
|
||||
[self verifyReachabilityNotificationGetsPostedWithManager:self.domainReachability];
|
||||
}
|
||||
//Commenting out for Travis Stability
|
||||
//- (void)testDomainReachabilityNotification {
|
||||
// [self verifyReachabilityNotificationGetsPostedWithManager:self.domainReachability];
|
||||
//}
|
||||
|
||||
- (void)verifyReachabilityStatusBlockGetsCalledWithManager:(AFNetworkReachabilityManager *)manager
|
||||
{
|
||||
__weak __block XCTestExpectation *expectation = [self expectationWithDescription:@"reachability status change block gets called"];
|
||||
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"reachability status change block gets called"];
|
||||
|
||||
typeof(manager) __weak weakManager = manager;
|
||||
[manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
||||
BOOL isReachable = (status == AFNetworkReachabilityStatusReachableViaWiFi
|
||||
|| status == AFNetworkReachabilityStatusReachableViaWWAN);
|
||||
if (isReachable) {
|
||||
[expectation fulfill];
|
||||
expectation = nil;
|
||||
}
|
||||
BOOL reachable = (status == AFNetworkReachabilityStatusReachableViaWiFi
|
||||
|| status == AFNetworkReachabilityStatusReachableViaWWAN);
|
||||
|
||||
XCTAssert(reachable, @"Expected network to be reachable but got '%@'", AFStringFromNetworkReachabilityStatus(status));
|
||||
XCTAssertEqual(reachable, weakManager.isReachable, @"Expected status to match 'isReachable'");
|
||||
|
||||
[expectation fulfill];
|
||||
}];
|
||||
|
||||
[manager startMonitoring];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[manager setReachabilityStatusChangeBlock:nil];
|
||||
|
||||
}
|
||||
@ -121,21 +117,9 @@
|
||||
[self verifyReachabilityStatusBlockGetsCalledWithManager:self.addressReachability];
|
||||
}
|
||||
|
||||
- (void)testDomainReachabilityBlock {
|
||||
[self verifyReachabilityStatusBlockGetsCalledWithManager:self.domainReachability];
|
||||
}
|
||||
|
||||
- (void)testObjectPostingReachabilityManagerNotification {
|
||||
[self expectationForNotification:AFNetworkingReachabilityDidChangeNotification
|
||||
object:self.domainReachability
|
||||
handler:^BOOL(NSNotification *notification) {
|
||||
BOOL isObjectPostingNotification = [notification.object isEqual:self.domainReachability];
|
||||
return isObjectPostingNotification;
|
||||
}];
|
||||
|
||||
[self.domainReachability startMonitoring];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
//Commenting out for Travis Stability
|
||||
//- (void)testDomainReachabilityBlock {
|
||||
// [self verifyReachabilityStatusBlockGetsCalledWithManager:self.domainReachability];
|
||||
//}
|
||||
|
||||
@end
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
// AFPropertyListRequestSerializerTests.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"
|
||||
|
||||
@interface AFPropertyListRequestSerializerTests : AFTestCase
|
||||
@property (nonatomic, strong) AFPropertyListRequestSerializer *requestSerializer;
|
||||
@end
|
||||
|
||||
@implementation AFPropertyListRequestSerializerTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
self.requestSerializer = [AFPropertyListRequestSerializer serializer];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)testThatPropertyListRequestSerializerAcceptsPlist {
|
||||
NSDictionary *parameters = @{@"key":@"value"};
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNotNil(request, @"Expected non-nil request.");
|
||||
}
|
||||
|
||||
- (void)testThatPropertyListRequestSerializerHandlesInvalidPlist {
|
||||
NSDictionary *parameters = @{@42:@"value"};
|
||||
NSError *error = nil;
|
||||
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"POST" URLString:self.baseURL.absoluteString parameters:parameters error:&error];
|
||||
|
||||
XCTAssertNil(request, @"Expected nil request.");
|
||||
XCTAssertNotNil(error, @"Expected non-nil error.");
|
||||
}
|
||||
|
||||
@end
|
||||
@ -36,27 +36,6 @@
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)testThatPropertyListResponseSerializerAcceptsPlistData {
|
||||
NSData *data = [NSPropertyListSerialization dataWithPropertyList:@{@"foo": @"bar"} format:NSPropertyListXMLFormat_v1_0 options:0 error:NULL];
|
||||
|
||||
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/x-plist"}];
|
||||
NSError *error = nil;
|
||||
id responseObject = [self.responseSerializer responseObjectForResponse:response data:data error:&error];
|
||||
|
||||
XCTAssertTrue([responseObject isKindOfClass:[NSDictionary class]], @"Expected valid dictionary.");
|
||||
}
|
||||
|
||||
- (void)testThatPropertyListResponseSerializerHandlesInvalidPlistData {
|
||||
NSData *data = [NSJSONSerialization dataWithJSONObject:@{@"foo": @"bar"} options:(NSJSONWritingOptions)0 error:nil];
|
||||
|
||||
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/x-plist"}];
|
||||
NSError *error = nil;
|
||||
id responseObject = [self.responseSerializer responseObjectForResponse:response data:data error:&error];
|
||||
|
||||
XCTAssertNil(responseObject, @"Expected nil responseObject.");
|
||||
XCTAssertNotNil(error, @"Expected non-nil error.");
|
||||
}
|
||||
|
||||
- (void)testThatPropertyListResponseSerializerHandles204 {
|
||||
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:self.baseURL statusCode:204 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/x-plist"}];
|
||||
NSError *error;
|
||||
|
||||
@ -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_transfer id)(cert)];
|
||||
[certs addObject:(__bridge id)(cert)];
|
||||
}
|
||||
|
||||
SecPolicyRef policy = SecPolicyCreateBasicX509();
|
||||
@ -57,38 +57,68 @@ static SecTrustRef AFUTADNNetServerTrust() {
|
||||
return AFUTTrustChainForCertsInDirectory(serverCertDirectoryPath);
|
||||
}
|
||||
|
||||
//static SecTrustRef AFUTGoogleComServerTrustPath1() {
|
||||
// NSString *bundlePath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] resourcePath];
|
||||
// NSString *serverCertDirectoryPath = [bundlePath stringByAppendingPathComponent:@"GoogleComServerTrustChainPath1"];
|
||||
//
|
||||
// return AFUTTrustChainForCertsInDirectory(serverCertDirectoryPath);
|
||||
//}
|
||||
//
|
||||
//static SecTrustRef AFUTGoogleComServerTrustPath2() {
|
||||
// NSString *bundlePath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] resourcePath];
|
||||
// NSString *serverCertDirectoryPath = [bundlePath stringByAppendingPathComponent:@"GoogleComServerTrustChainPath2"];
|
||||
//
|
||||
// return AFUTTrustChainForCertsInDirectory(serverCertDirectoryPath);
|
||||
//}
|
||||
|
||||
static SecCertificateRef AFUTHTTPBinOrgCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_03172020" ofType:@"cer"];
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_01192017" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
|
||||
return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
}
|
||||
|
||||
static SecCertificateRef AFUTAmazonAuthorityCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:NSClassFromString(@"AFSecurityPolicyTests")] pathForResource:@"Amazon" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
|
||||
return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
}
|
||||
|
||||
static SecCertificateRef AFUTAmazonRootAuthorityCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:NSClassFromString(@"AFSecurityPolicyTests")] pathForResource:@"Amazon Root CA 1" ofType:@"cer"];
|
||||
static SecCertificateRef AFUTCOMODORSADomainValidationSecureServerCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"COMODO_RSA_Domain_Validation_Secure_Server_CA" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
|
||||
return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
}
|
||||
|
||||
static SecCertificateRef AFUTStarfieldServicesRootCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:NSClassFromString(@"AFSecurityPolicyTests")] pathForResource:@"Starfield Services Root Certificate Authority - G2" ofType:@"cer"];
|
||||
static SecCertificateRef AFUTCOMODORSACertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"COMODO_RSA_Certification_Authority" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
|
||||
|
||||
return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
}
|
||||
|
||||
static SecCertificateRef AFUTAddTrustExternalRootCertificate() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"AddTrust_External_CA_Root" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
|
||||
return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
}
|
||||
|
||||
//static SecCertificateRef AFUTGoogleComEquifaxSecureCARootCertificate() {
|
||||
// NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"Equifax_Secure_Certificate_Authority_Root" ofType:@"cer"];
|
||||
// NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
// NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
//
|
||||
// return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
//}
|
||||
//
|
||||
//static SecCertificateRef AFUTGoogleComGeoTrustGlobalCARootCertificate() {
|
||||
// NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"GeoTrust_Global_CA_Root" ofType:@"cer"];
|
||||
// NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
// NSData *certData = [NSData dataWithContentsOfFile:certPath];
|
||||
//
|
||||
// return SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
|
||||
//}
|
||||
|
||||
static SecCertificateRef AFUTSelfSignedCertificateWithoutDomain() {
|
||||
NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"NoDomains" ofType:@"cer"];
|
||||
NSCAssert(certPath != nil, @"Path for certificate should not be nil");
|
||||
@ -209,50 +239,58 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediateCertificatePinned {
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediate1CertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
SecCertificateRef certificate = AFUTAmazonAuthorityCertificate();
|
||||
|
||||
SecCertificateRef certificate = AFUTCOMODORSADomainValidationSecureServerCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediate2CertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
SecCertificateRef certificate = AFUTCOMODORSACertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgRootCertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
SecCertificateRef certificate = AFUTAmazonRootAuthorityCertificate();
|
||||
|
||||
SecCertificateRef certificate = AFUTAddTrustExternalRootCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithEntireCertificateChainPinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
|
||||
SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
|
||||
SecCertificateRef intermediateCertificate = AFUTAmazonAuthorityCertificate();
|
||||
SecCertificateRef intermediateCertificate2 = AFUTAmazonRootAuthorityCertificate();
|
||||
SecCertificateRef rootCertificate = AFUTStarfieldServicesRootCertificate();
|
||||
SecCertificateRef intermedaite1Certificate = AFUTCOMODORSADomainValidationSecureServerCertificate();
|
||||
SecCertificateRef intermedaite2Certificate = AFUTCOMODORSACertificate();
|
||||
SecCertificateRef rootCertificate = AFUTAddTrustExternalRootCertificate();
|
||||
[policy setPinnedCertificates:[NSSet setWithObjects:(__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermediateCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermediateCertificate2),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(rootCertificate), nil]];
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermedaite1Certificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermedaite2Certificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(rootCertificate), nil]];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow HTTPBinOrg server trust because at least one of the pinned certificates is valid");
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBirnOrgServerTrustWithHTTPbinOrgPinnedCertificateAndAdditionalPinnedCertificates {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
|
||||
SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
|
||||
SecCertificateRef selfSignedCertificate = AFUTSelfSignedCertificateWithCommonNameDomain();
|
||||
[policy setPinnedCertificates:[NSSet setWithObjects:(__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(selfSignedCertificate), nil]];
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(selfSignedCertificate), nil]];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow HTTPBinOrg server trust because at least one of the pinned certificates is valid");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithPublicKeyPinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgLeafCertificatePinnedAndValidDomainName {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
|
||||
SecCertificateRef certificate = AFUTHTTPBinOrgCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:@"httpbin.org"], @"Policy should allow server trust");
|
||||
@ -323,55 +361,96 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediateCertificatePinned {
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediate1CertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
SecCertificateRef certificate = AFUTAmazonAuthorityCertificate();
|
||||
|
||||
SecCertificateRef certificate = AFUTCOMODORSADomainValidationSecureServerCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgIntermediate2CertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
SecCertificateRef certificate = AFUTCOMODORSACertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgRootCertificatePinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
SecCertificateRef certificate = AFUTAmazonRootAuthorityCertificate();
|
||||
|
||||
SecCertificateRef certificate = AFUTAddTrustExternalRootCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithEntireCertificateChainPinned {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
|
||||
SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
|
||||
SecCertificateRef intermediateCertificate = AFUTAmazonAuthorityCertificate();
|
||||
SecCertificateRef intermediateCertificate2 = AFUTAmazonRootAuthorityCertificate();
|
||||
SecCertificateRef rootCertificate = AFUTStarfieldServicesRootCertificate();
|
||||
SecCertificateRef intermedaite1Certificate = AFUTCOMODORSADomainValidationSecureServerCertificate();
|
||||
SecCertificateRef intermedaite2Certificate = AFUTCOMODORSACertificate();
|
||||
SecCertificateRef rootCertificate = AFUTAddTrustExternalRootCertificate();
|
||||
[policy setPinnedCertificates:[NSSet setWithObjects:(__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermediateCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermediateCertificate2),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(rootCertificate), nil]];
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermedaite1Certificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(intermedaite2Certificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(rootCertificate), nil]];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow HTTPBinOrg server trust because at least one of the pinned certificates is valid");
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBirnOrgServerTrustWithHTTPbinOrgPinnedCertificateAndAdditionalPinnedCertificates {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
|
||||
SecCertificateRef httpBinCertificate = AFUTHTTPBinOrgCertificate();
|
||||
SecCertificateRef selfSignedCertificate = AFUTSelfSignedCertificateWithCommonNameDomain();
|
||||
[policy setPinnedCertificates:[NSSet setWithObjects:(__bridge_transfer NSData *)SecCertificateCopyData(httpBinCertificate),
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(selfSignedCertificate), nil]];
|
||||
(__bridge_transfer NSData *)SecCertificateCopyData(selfSignedCertificate), nil]];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:nil], @"Policy should allow HTTPBinOrg server trust because at least one of the pinned certificates is valid");
|
||||
}
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAllowsHTTPBinOrgServerTrustWithHTTPBinOrgLeafCertificatePinnedAndValidDomainName {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
|
||||
|
||||
SecCertificateRef certificate = AFUTHTTPBinOrgCertificate();
|
||||
policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:@"httpbin.org"], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
//- (void)testPolicyWithCertificatePinningAllowsGoogleComServerTrustIncompleteChainWithRootCertificatePinnedAndValidDomainName {
|
||||
// //TODO THIS TEST HAS BEEN DISABLED UNTIL CERTS HAVE BEEN UPDATED.
|
||||
// //Please see conversation here: https://github.com/AFNetworking/AFNetworking/pull/3159#issuecomment-178647437
|
||||
// //
|
||||
// // Fix certificate validation for servers providing incomplete chains (#3159) - test case
|
||||
// //
|
||||
// // google.com has two certification paths and both send incomplete certificate chains, i.e. don't include the Root CA
|
||||
// // (this can be validated in https://www.ssllabs.com/ssltest/analyze.html?d=google.com)
|
||||
// //
|
||||
// // The two certification paths are:
|
||||
// // - Path 1: *.google.com, Google Internet Authority G2 (with GeoTrust Global CA Root)
|
||||
// // - Path 2: *.google.com, Google Internet Authority G2, GeoTrust Global CA (cross signed) (with Equifax Secure CA Root)
|
||||
// //
|
||||
// // The common goal of using certificate pinning is to prevent MiTM (man-in-the-middle) attacks, so the Root CA's should be pinned to protect the entire chains.
|
||||
// // Since there's no Root CA being sent, when `-evaluateServerTrust:` invokes `AFCertificateTrustChainForServerTrust(serverTrust)`, the Root CA isn't present
|
||||
// // Therefore, even though `AFServerTrustIsValid(serverTrust)` succeeds, the next validation fails since no pinned certificate matches the `pinnedCertificates`.
|
||||
// // By fetching the `AFCertificateTrustChainForServerTrust(serverTrust)` *after* the `AFServerTrustIsValid(serverTrust)` validation, the complete chain is obtained and the Root CA's match.
|
||||
//
|
||||
// AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
|
||||
//
|
||||
// // certification path 1
|
||||
// SecCertificateRef certificate = AFUTGoogleComGeoTrustGlobalCARootCertificate();
|
||||
// policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
//
|
||||
// XCTAssertTrue([policy evaluateServerTrust:AFUTGoogleComServerTrustPath1() forDomain:@"google.com"], @"Policy should allow server trust");
|
||||
//
|
||||
// // certification path 2
|
||||
// certificate = AFUTGoogleComEquifaxSecureCARootCertificate();
|
||||
// policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(certificate)];
|
||||
//
|
||||
// XCTAssertTrue([policy evaluateServerTrust:AFUTGoogleComServerTrustPath2() forDomain:@"google.com"], @"Policy should allow server trust");
|
||||
//}
|
||||
|
||||
#pragma mark Negative Server Trust Evaluation Tests
|
||||
|
||||
- (void)testPolicyWithCertificatePinningAndNoPinnedCertificatesDoesNotAllowHTTPBinOrgServerTrust {
|
||||
@ -415,6 +494,11 @@ static SecTrustRef AFUTTrustWithCertificate(SecCertificateRef certificate) {
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:@"invalid.org"], @"Policy should allow server trust because domain name validation is disabled");
|
||||
}
|
||||
|
||||
- (void)testThatPolicyWithDomainNameValidationAllowsServerTrustWithValidWildcardDomainName {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy defaultPolicy];
|
||||
XCTAssertTrue([policy evaluateServerTrust:AFUTHTTPBinOrgServerTrust() forDomain:@"test.httpbin.org"], @"Policy should allow server trust");
|
||||
}
|
||||
|
||||
- (void)testThatPolicyWithDomainNameValidationAndSelfSignedCommonNameCertificateAllowsServerTrust {
|
||||
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey];
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
extern NSString * const AFNetworkingTestsBaseURLString;
|
||||
|
||||
@interface AFTestCase : XCTestCase
|
||||
|
||||
@property (nonatomic, strong, readonly) NSURL *baseURL;
|
||||
@ -31,7 +33,6 @@
|
||||
|
||||
@property (nonatomic, assign) NSTimeInterval networkTimeout;
|
||||
|
||||
- (void)waitForExpectationsWithCommonTimeout;
|
||||
- (void)waitForExpectationsWithCommonTimeoutUsingHandler:(XCWaitCompletionHandler)handler;
|
||||
|
||||
@end
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
#import "AFTestCase.h"
|
||||
|
||||
NSString * const AFNetworkingTestsBaseURLString = @"https://httpbin.org/";
|
||||
|
||||
@implementation AFTestCase
|
||||
|
||||
- (void)setUp {
|
||||
@ -35,8 +37,7 @@
|
||||
#pragma mark -
|
||||
|
||||
- (NSURL *)baseURL {
|
||||
NSDictionary *environment = [[NSProcessInfo processInfo] environment];
|
||||
return [NSURL URLWithString:environment[@"HTTPBIN_BASE_URL"] ?: @"https://httpbin.org"];
|
||||
return [NSURL URLWithString:AFNetworkingTestsBaseURLString];
|
||||
}
|
||||
|
||||
- (NSURL *)pngURL {
|
||||
@ -55,10 +56,6 @@
|
||||
return [self.baseURL URLByAppendingPathComponent:[NSString stringWithFormat:@"status/%@", @(statusCode)]];
|
||||
}
|
||||
|
||||
- (void)waitForExpectationsWithCommonTimeout {
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)waitForExpectationsWithCommonTimeoutUsingHandler:(XCWaitCompletionHandler)handler {
|
||||
[self waitForExpectationsWithTimeout:self.networkTimeout handler:handler];
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
- (void)tearDown {
|
||||
[super tearDown];
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES];
|
||||
self.sessionManager = nil;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
self.activityIndicatorView = nil;
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
self.activityIndicatorView = nil;
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
[task resume];
|
||||
[task suspend];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
evaluatedWithObject:self.button
|
||||
handler:nil];
|
||||
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatForegroundImageCanBeCancelledAndDownloadedImmediately {
|
||||
@ -84,7 +84,7 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNotNil(responseImage);
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNotNil(responseImage);
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
[self expectationForPredicate:[NSPredicate predicateWithFormat:@"image != nil"]
|
||||
evaluatedWithObject:self.imageView
|
||||
handler:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatImageDownloadSucceedsWhenDuplicateRequestIsSentToImageView {
|
||||
@ -71,7 +71,7 @@
|
||||
[self expectationForPredicate:[NSPredicate predicateWithFormat:@"image != nil"]
|
||||
evaluatedWithObject:self.imageView
|
||||
handler:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testThatPlaceholderImageIsSetIfRequestFails {
|
||||
@ -84,7 +84,7 @@
|
||||
failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertEqual(self.imageView.image, placeholder);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
[cacheExpectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
|
||||
__block UIImage *cachedImage = nil;
|
||||
__block NSHTTPURLResponse *urlResponse;
|
||||
@ -113,7 +113,7 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNil(urlResponse);
|
||||
XCTAssertNotNil(cachedImage);
|
||||
XCTAssertEqual(cachedImage, downloadImage);
|
||||
@ -133,34 +133,10 @@
|
||||
[expectation fulfill];
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
XCTAssertNotNil(responseImage);
|
||||
}
|
||||
|
||||
- (void)testThatImageDownloadFailsWhenUsingMalformedURLRequest {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should fail"];
|
||||
UIImage *placeholder = [UIImage imageNamed:@"logo"];
|
||||
__block NSURLRequest *failureRequest;
|
||||
__block NSHTTPURLResponse *failureResponse;
|
||||
__block NSError *failureError;
|
||||
NSString *nilString;
|
||||
NSURLRequest *malformedRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:nilString]];
|
||||
[self.imageView setImageWithURLRequest:malformedRequest
|
||||
placeholderImage:placeholder
|
||||
success:nil
|
||||
failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
|
||||
failureRequest = request;
|
||||
failureResponse = response;
|
||||
failureError = error;
|
||||
[expectation fulfill];
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
XCTAssertEqual(self.imageView.image, placeholder);
|
||||
XCTAssertEqual(failureRequest, malformedRequest);
|
||||
XCTAssertNil(failureResponse);
|
||||
XCTAssertNotNil(failureError);
|
||||
}
|
||||
|
||||
- (void)testThatNilURLDoesntCrash {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wnonnull"
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
- (void)tearDown {
|
||||
[super tearDown];
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self.sessionManager invalidateSessionCancelingTasks:YES];
|
||||
self.sessionManager = nil;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
self.refreshControl = nil;
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
self.refreshControl = nil;
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
[task resume];
|
||||
[task suspend];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
[task cancel];
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
#import "UIWebView+AFNetworking.h"
|
||||
|
||||
@interface AFUIWebViewTests : AFTestCase
|
||||
|
||||
@property (nonatomic, strong) UIWebView *webView;
|
||||
@property (nonatomic, strong) NSURLRequest *HTMLRequest;
|
||||
|
||||
@ -48,7 +47,7 @@
|
||||
return HTML;
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testNULLProgressDoesNotCauseCrash {
|
||||
@ -61,44 +60,26 @@
|
||||
return HTML;
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
//- (void)testProgressIsSet {
|
||||
// NSProgress* progress = nil;
|
||||
// XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
// [self.webView
|
||||
// loadRequest:self.HTMLRequest
|
||||
// progress:&progress
|
||||
// success:^NSString * _Nonnull(NSHTTPURLResponse * _Nonnull response, NSString * _Nonnull HTML) {
|
||||
// [expectation fulfill];
|
||||
// return HTML;
|
||||
// }
|
||||
// failure:nil];
|
||||
// [self keyValueObservingExpectationForObject:progress
|
||||
// keyPath:@"fractionCompleted"
|
||||
// expectedValue:@(1.0)];
|
||||
// [self waitForExpectationsWithCommonTimeout];
|
||||
//}
|
||||
|
||||
- (void)testRequestWithCustomHeaders {
|
||||
NSMutableURLRequest *customHeaderRequest = [NSMutableURLRequest requestWithURL:[self.baseURL URLByAppendingPathComponent:@"headers"]];
|
||||
[customHeaderRequest setValue:@"Custom-Header-Value" forHTTPHeaderField:@"Custom-Header-Field"];
|
||||
- (void)testProgressIsSet {
|
||||
NSProgress* progress = nil;
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"];
|
||||
[self.webView
|
||||
loadRequest:customHeaderRequest
|
||||
progress:NULL
|
||||
success:^NSString * _Nonnull(NSHTTPURLResponse * _Nonnull response, NSString * _Nonnull string) {
|
||||
// Here string is actually JSON.
|
||||
NSDictionary<NSString *, NSDictionary *> *responseObject = [NSJSONSerialization JSONObjectWithData:[string dataUsingEncoding:NSUTF8StringEncoding] options:(NSJSONReadingOptions)0 error:nil];
|
||||
|
||||
NSDictionary<NSString *, NSString *> *headers = responseObject[@"headers"];
|
||||
XCTAssertTrue([headers[@"Custom-Header-Field"] isEqualToString:@"Custom-Header-Value"]);
|
||||
loadRequest:self.HTMLRequest
|
||||
progress:&progress
|
||||
success:^NSString * _Nonnull(NSHTTPURLResponse * _Nonnull response, NSString * _Nonnull HTML) {
|
||||
[expectation fulfill];
|
||||
return string;
|
||||
return HTML;
|
||||
}
|
||||
failure:nil];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self keyValueObservingExpectationForObject:progress
|
||||
keyPath:@"fractionCompleted"
|
||||
expectedValue:@(1.0)];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
@property (readwrite, nonatomic, strong) AFURLSessionManager *backgroundManager;
|
||||
@end
|
||||
|
||||
|
||||
@implementation AFURLSessionManagerTests
|
||||
|
||||
- (NSURLRequest *)bigImageURLRequest {
|
||||
@ -70,10 +71,10 @@
|
||||
- (void)tearDown {
|
||||
[super tearDown];
|
||||
[self.localManager.session.configuration.URLCache removeAllCachedResponses];
|
||||
[self.localManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self.localManager invalidateSessionCancelingTasks:YES];
|
||||
self.localManager = nil;
|
||||
|
||||
[self.backgroundManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
[self.backgroundManager invalidateSessionCancelingTasks:YES];
|
||||
self.backgroundManager = nil;
|
||||
}
|
||||
|
||||
@ -94,7 +95,7 @@
|
||||
completionHandler:nil];
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testDataTaskDownloadProgressCanBeKVOd {
|
||||
@ -114,7 +115,7 @@
|
||||
return new == 1.0 && old != 0.0;
|
||||
}];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testDownloadTaskDoesReportProgress {
|
||||
@ -130,47 +131,7 @@
|
||||
destination:nil
|
||||
completionHandler:nil];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testSessionTaskDoesReportMetrics {
|
||||
[self expectationForNotification:AFNetworkingTaskDidCompleteNotification object:nil handler:^BOOL(NSNotification * _Nonnull notification) {
|
||||
#if AF_CAN_USE_AT_AVAILABLE && AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
if (@available(iOS 10, macOS 10.12, watchOS 3, tvOS 10, *)) {
|
||||
return [notification userInfo][AFNetworkingTaskDidCompleteSessionTaskMetrics] != nil;
|
||||
}
|
||||
#endif
|
||||
return YES;
|
||||
}];
|
||||
|
||||
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
|
||||
__weak XCTestExpectation *metricsBlock = [self expectationWithDescription:@"Metrics completion block is called"];
|
||||
[self.localManager setTaskDidFinishCollectingMetricsBlock:^(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLSessionTaskMetrics * _Nullable metrics) {
|
||||
[metricsBlock fulfill];
|
||||
}];
|
||||
#endif
|
||||
|
||||
NSURLSessionTask *task = [self.localManager downloadTaskWithRequest:[self bigImageURLRequest]
|
||||
progress:nil
|
||||
destination:nil
|
||||
completionHandler:nil];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)testSessionIsStillValid {
|
||||
|
||||
NSURLSession *session = self.localManager.session;
|
||||
[self.localManager invalidateSessionCancelingTasks:YES resetSession:NO];
|
||||
|
||||
XCTAssertEqual(session, self.localManager.session);
|
||||
}
|
||||
|
||||
- (void)testSessionRecreatesAgain {
|
||||
|
||||
[self.localManager invalidateSessionCancelingTasks:YES resetSession:YES];
|
||||
|
||||
XCTAssertNotNil(self.localManager.session);
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testUploadTaskDoesReportProgress {
|
||||
@ -197,7 +158,7 @@
|
||||
}
|
||||
completionHandler:nil];
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
- (void)testUploadProgressCanBeKVOd {
|
||||
@ -221,7 +182,7 @@
|
||||
[self keyValueObservingExpectationForObject:uploadProgress keyPath:NSStringFromSelector(@selector(fractionCompleted)) expectedValue:@(1.0)];
|
||||
|
||||
[task resume];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - rdar://17029580
|
||||
@ -249,7 +210,7 @@
|
||||
[expectation fulfill];
|
||||
});
|
||||
}
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
[self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Issue #2702 Tests
|
||||
@ -498,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];
|
||||
}
|
||||
|
||||
|
||||
@ -1,101 +0,0 @@
|
||||
// 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 <XCTest/XCTest.h>
|
||||
|
||||
static NSData * AFXMLTestData() {
|
||||
return [@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo attr1=\"1\" attr2=\"2\"><bar>someValue</bar></foo>" 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)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];
|
||||
|
||||
XCTAssertNil(error, @"Error handling application/xml");
|
||||
}
|
||||
|
||||
- (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];
|
||||
|
||||
XCTAssertNil(error, @"Error handling text/xml");
|
||||
}
|
||||
|
||||
- (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];
|
||||
|
||||
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:[@"<foo" dataUsingEncoding:NSUTF8StringEncoding] error:&error];
|
||||
|
||||
XCTAssertNotNil(error, @"Serialization error should not be nil");
|
||||
}
|
||||
|
||||
- (void)testThatXMLDocumentResponseSerializerCanBeCopied {
|
||||
[self.responseSerializer setAcceptableStatusCodes:[NSIndexSet indexSetWithIndex:100]];
|
||||
[self.responseSerializer setAcceptableContentTypes:[NSSet setWithObject:@"test/type"]];
|
||||
|
||||
[self.responseSerializer setOptions:1];
|
||||
AFXMLDocumentResponseSerializer *copiedSerializer = [self.responseSerializer copy];
|
||||
XCTAssertNotEqual(copiedSerializer, self.responseSerializer);
|
||||
XCTAssertEqual(copiedSerializer.acceptableStatusCodes, self.responseSerializer.acceptableStatusCodes);
|
||||
XCTAssertEqual(copiedSerializer.acceptableContentTypes, self.responseSerializer.acceptableContentTypes);
|
||||
XCTAssertEqual(copiedSerializer.options, self.responseSerializer.options);
|
||||
}
|
||||
|
||||
@end
|
||||
@ -1,89 +0,0 @@
|
||||
// AFXMLParserResponseSerializerTests.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"
|
||||
|
||||
static NSData * AFXMLTestData() {
|
||||
return [@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo attr1=\"1\" attr2=\"2\"><bar>someValue</bar></foo>" 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)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];
|
||||
|
||||
XCTAssertNil(error, @"Error handling application/xml");
|
||||
}
|
||||
|
||||
- (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];
|
||||
|
||||
XCTAssertNil(error, @"Error handling text/xml");
|
||||
}
|
||||
|
||||
- (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];
|
||||
|
||||
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
|
||||
@ -72,17 +72,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@protocol AFImageRequestCache <AFImageCache>
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
@interface AFCachedImage : NSObject
|
||||
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
@property (nonatomic, copy) NSString *identifier;
|
||||
@property (nonatomic, strong) NSString *identifier;
|
||||
@property (nonatomic, assign) UInt64 totalBytes;
|
||||
@property (nonatomic, strong) NSDate *lastAccessDate;
|
||||
@property (nonatomic, assign) UInt64 currentMemoryUsage;
|
||||
@ -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;
|
||||
@ -51,7 +51,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (UIImage *)accessImage {
|
||||
- (UIImage*)accessImage {
|
||||
self.lastAccessDate = [NSDate date];
|
||||
return self.image;
|
||||
}
|
||||
@ -134,7 +134,7 @@
|
||||
[self.cachedImages removeObjectForKey:cachedImage.identifier];
|
||||
bytesPurged += cachedImage.totalBytes;
|
||||
if (bytesPurged >= bytesToPurge) {
|
||||
break;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
self.currentMemoryUsage -= bytesPurged;
|
||||
@ -196,10 +196,6 @@
|
||||
return key;
|
||||
}
|
||||
|
||||
- (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
@ -81,11 +81,6 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) {
|
||||
*/
|
||||
+ (NSURLCache *)defaultURLCache;
|
||||
|
||||
/**
|
||||
The default `NSURLSessionConfiguration` with common usage parameter values.
|
||||
*/
|
||||
+ (NSURLSessionConfiguration *)defaultURLSessionConfiguration;
|
||||
|
||||
/**
|
||||
Default initializer
|
||||
|
||||
@ -93,15 +88,6 @@ 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.
|
||||
|
||||
|
||||
@ -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];
|
||||
}
|
||||
|
||||
@ -106,20 +106,10 @@
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation AFImageDownloader
|
||||
|
||||
+ (NSURLCache *)defaultURLCache {
|
||||
|
||||
// It's been discovered that a crash will occur on certain versions
|
||||
// of iOS if you customize the cache.
|
||||
//
|
||||
// More info can be found here: https://devforums.apple.com/message/1102182#1102182
|
||||
//
|
||||
// When iOS 7 support is dropped, this should be modified to use
|
||||
// NSProcessInfo methods instead.
|
||||
if ([[[UIDevice currentDevice] systemVersion] compare:@"8.2" options:NSNumericSearch] == NSOrderedAscending) {
|
||||
return [NSURLCache sharedURLCache];
|
||||
}
|
||||
return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
|
||||
diskCapacity:150 * 1024 * 1024
|
||||
diskPath:@"com.alamofire.imagedownloader"];
|
||||
@ -143,11 +133,7 @@
|
||||
|
||||
- (instancetype)init {
|
||||
NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration];
|
||||
return [self initWithSessionConfiguration:defaultConfiguration];
|
||||
}
|
||||
|
||||
- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration {
|
||||
AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration];
|
||||
AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration];
|
||||
sessionManager.responseSerializer = [AFImageResponseSerializer serializer];
|
||||
|
||||
return [self initWithSessionManager:sessionManager
|
||||
@ -254,26 +240,24 @@
|
||||
completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
|
||||
dispatch_async(self.responseQueue, ^{
|
||||
__strong __typeof__(weakSelf) strongSelf = weakSelf;
|
||||
AFImageDownloaderMergedTask *mergedTask = [strongSelf safelyGetMergedTask:URLIdentifier];
|
||||
AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier];
|
||||
if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) {
|
||||
mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier];
|
||||
if (error) {
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ([strongSelf.imageCache shouldCacheImage:responseObject forRequest:request withAdditionalIdentifier:nil]) {
|
||||
[strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil];
|
||||
}
|
||||
[strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil];
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -340,7 +324,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (AFImageDownloaderMergedTask *)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier {
|
||||
- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier {
|
||||
__block AFImageDownloaderMergedTask *mergedTask = nil;
|
||||
dispatch_sync(self.synchronizationQueue, ^{
|
||||
mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier];
|
||||
@ -404,14 +388,6 @@
|
||||
return self.activeRequestCount < self.maximumActiveDownloads;
|
||||
}
|
||||
|
||||
- (AFImageDownloaderMergedTask *)safelyGetMergedTask:(NSString *)URLIdentifier {
|
||||
__block AFImageDownloaderMergedTask *mergedTask;
|
||||
dispatch_sync(self.synchronizationQueue, ^(){
|
||||
mergedTask = self.mergedTasks[URLIdentifier];
|
||||
});
|
||||
return mergedTask;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
@ -103,11 +103,11 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
|
||||
|
||||
+ (AFImageDownloader *)sharedImageDownloader {
|
||||
|
||||
return objc_getAssociatedObject([UIButton class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
|
||||
return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
|
||||
}
|
||||
|
||||
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
|
||||
objc_setAssociatedObject([UIButton class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -168,7 +168,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
|
||||
if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
|
||||
if (success) {
|
||||
success(request, response, responseObject);
|
||||
} else if (responseObject) {
|
||||
} else if(responseObject) {
|
||||
[strongSelf setImage:responseObject forState:state];
|
||||
}
|
||||
[strongSelf af_setImageDownloadReceipt:nil forState:state];
|
||||
@ -247,7 +247,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
|
||||
if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
|
||||
if (success) {
|
||||
success(request, response, responseObject);
|
||||
} else if (responseObject) {
|
||||
} else if(responseObject) {
|
||||
[strongSelf setBackgroundImage:responseObject forState:state];
|
||||
}
|
||||
[strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
@interface UIImage (AFNetworking)
|
||||
|
||||
+ (UIImage *)safeImageWithData:(NSData *)data;
|
||||
+ (UIImage*) safeImageWithData:(NSData*)data;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -48,11 +48,11 @@
|
||||
@implementation UIImageView (AFNetworking)
|
||||
|
||||
+ (AFImageDownloader *)sharedImageDownloader {
|
||||
return objc_getAssociatedObject([UIImageView class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
|
||||
return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
|
||||
}
|
||||
|
||||
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
|
||||
objc_setAssociatedObject([UIImageView class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
@ -75,19 +75,17 @@
|
||||
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
|
||||
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
|
||||
{
|
||||
|
||||
if ([urlRequest URL] == nil) {
|
||||
[self cancelImageDownloadTask];
|
||||
self.image = placeholderImage;
|
||||
if (failure) {
|
||||
NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil];
|
||||
failure(urlRequest, nil, error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self isActiveTaskURLEqualToURLRequest:urlRequest]) {
|
||||
|
||||
if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self cancelImageDownloadTask];
|
||||
|
||||
AFImageDownloader *downloader = [[self class] sharedImageDownloader];
|
||||
@ -118,7 +116,7 @@
|
||||
if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
|
||||
if (success) {
|
||||
success(request, response, responseObject);
|
||||
} else if (responseObject) {
|
||||
} else if(responseObject) {
|
||||
strongSelf.image = responseObject;
|
||||
}
|
||||
[strongSelf clearActiveDownloadInformation];
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
@implementation UIWebView (AFNetworking)
|
||||
|
||||
- (AFHTTPSessionManager *)sessionManager {
|
||||
- (AFHTTPSessionManager *)sessionManager {
|
||||
static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
@ -119,28 +119,27 @@
|
||||
self.af_URLSessionTask = nil;
|
||||
|
||||
__weak __typeof(self)weakSelf = self;
|
||||
__block NSURLSessionDataTask *dataTask;
|
||||
NSURLSessionDataTask *dataTask;
|
||||
dataTask = [self.sessionManager
|
||||
dataTaskWithRequest:request
|
||||
uploadProgress:nil
|
||||
downloadProgress:nil
|
||||
completionHandler:^(NSURLResponse * _Nonnull response, id _Nonnull responseObject, NSError * _Nullable error) {
|
||||
__strong __typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (error) {
|
||||
if (failure) {
|
||||
failure(error);
|
||||
}
|
||||
} else {
|
||||
if (success) {
|
||||
success((NSHTTPURLResponse *)response, responseObject);
|
||||
}
|
||||
[strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]];
|
||||
GET:request.URL.absoluteString
|
||||
parameters:nil
|
||||
progress:nil
|
||||
success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) {
|
||||
__strong __typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (success) {
|
||||
success((NSHTTPURLResponse *)task.response, responseObject);
|
||||
}
|
||||
[strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[task.currentRequest URL]];
|
||||
|
||||
if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
|
||||
[strongSelf.delegate webViewDidFinishLoad:strongSelf];
|
||||
}
|
||||
}
|
||||
}];
|
||||
if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
|
||||
[strongSelf.delegate webViewDidFinishLoad:strongSelf];
|
||||
}
|
||||
}
|
||||
failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
|
||||
if (failure) {
|
||||
failure(error);
|
||||
}
|
||||
}];
|
||||
self.af_URLSessionTask = dataTask;
|
||||
if (progress != nil) {
|
||||
*progress = [self.sessionManager downloadProgressForTask:dataTask];
|
||||
|
||||
@ -2,10 +2,10 @@ AF_WORKSPACE="AFNetworking.xcworkspace"
|
||||
|
||||
AF_IOS_FRAMEWORK_SCHEME="AFNetworking iOS"
|
||||
AF_TVOS_FRAMEWORK_SCHEME="AFNetworking tvOS"
|
||||
AF_OSX_FRAMEWORK_SCHEME="AFNetworking macOS"
|
||||
AF_OSX_FRAMEWORK_SCHEME="AFNetworking OS X"
|
||||
|
||||
AF_IOS_EXAMPLE_SCHEME="iOS Example"
|
||||
AF_TVOS_EXAMPLE_SCHEME="tvOS Example"
|
||||
AF_OSX_EXAMPLE_SCHEME="macOS Example"
|
||||
AF_OSX_EXAMPLE_SCHEME="OS X Example"
|
||||
|
||||
FASTLANE_EXPLICIT_OPEN_SIMULATOR=1
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
AF_IOS_SDK=iphonesimulator13.0
|
||||
AF_MAC_SDK=macosx10.15
|
||||
AF_TVOS_SDK=appletvsimulator13.0
|
||||
AF_IOS_SDK=iphonesimulator10.0
|
||||
AF_MAC_SDK=macosx10.11
|
||||
AF_TVOS_SDK=appletvsimulator10.0
|
||||
|
||||
AF_CONFIGURATION=Release
|
||||
|
||||
SCAN_WORKSPACE=$AF_WORKSPACE
|
||||
SCAN_SCHEME=$AF_IOS_FRAMEWORK_SCHEME
|
||||
SCAN_DEVICE="iPhone 7"
|
||||
SCAN_SDK=$AF_IOS_SDK
|
||||
SCAN_OUTPUT_DIRECTORY=fastlane/test-output
|
||||
|
||||
EXAMPLE_WORKSPACE=$AF_WORKSPACE
|
||||
EXAMPLE_SCHEME=$AF_IOS_EXAMPLE_SCHEME
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 7"
|
||||
|
||||
3
fastlane/.env.ios10_xcode8
Normal file
3
fastlane/.env.ios10_xcode8
Normal file
@ -0,0 +1,3 @@
|
||||
SCAN_DEVICE="iPhone 7"
|
||||
SCAN_SDK=$AF_IOS_SDK
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 7"
|
||||
@ -1,3 +0,0 @@
|
||||
SCAN_DEVICE="iPhone 8"
|
||||
SCAN_SDK=iphonesimulator11.0
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
|
||||
@ -1,3 +0,0 @@
|
||||
SCAN_DEVICE="iPhone 8"
|
||||
SCAN_SDK=iphonesimulator11.1
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
|
||||
@ -1,3 +0,0 @@
|
||||
SCAN_DEVICE="iPhone 8"
|
||||
SCAN_SDK=iphonesimulator11.2
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
|
||||
@ -1,3 +0,0 @@
|
||||
SCAN_DEVICE="iPhone 8"
|
||||
SCAN_SDK=iphonesimulator11.3
|
||||
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user