diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..951b97b9d6 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "Tests" diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000000..7d2ed51c3c --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,33 @@ +> ℹ Please fill out this template when filing an issue. +> All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info. +> +> Per our [*CONTRIBUTING guidelines](https://github.com/AFNetworking/AFNetworking/blob/master/CONTRIBUTING.md), we use GitHub for +> bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag `afnetworking`. +> +> Please remove this line and everything above it before submitting. + +* [ ] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/AFNetworking/AFNetworking/blob/master/CONTRIBUTING.md). + +## What did you do? + +ℹ Please replace this with what you did. + +## What did you expect to happen? + +ℹ Please replace this with what you expected to happen. + +## What happened instead? + +ℹ Please replace this with of what happened instead. + +## AFNetworking Environment + +**AFNetworking version:** +**Xcode version:** +**Swift version:** +**Platform(s) running AFNetworking:** +**macOS version running Xcode:** + +## Demo Project + +ℹ Please link to or upload a project we can download that reproduces the issue. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..6e04c37480 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +### Issue Link :link: + + +### Goals :soccer: + + + +### Implementation Details :construction: + + + +### Testing Details :mag: + diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000000..97dfa19284 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,34 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 14 + +# Number of days of inactivity before a stale Issue or Pull Request is closed +daysUntilClose: 7 + +# Issues or Pull Requests with these labels will never be considered stale + exemptLabels: + - "support" + - "bug" + - "security" + - "needs investigation" + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This issue has been marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + +# Comment to post when removing the stale label. Set to `false` to disable +unmarkComment: false + +# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable +closeComment: > + This issue has been auto-closed because there hasn't been any activity for at least 21 days. + However, we really appreciate your contribution, so thank you for that! 🙏 + Also, feel free to [open a new issue](https://github.com/AFNetworking/AFNetworking/issues/new) if you still experience this problem 👍. + +# Limit to only `issues` +only: issues diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..ec939bbbbd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: "AFNetworking CI" + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + macOS: + name: Test macOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: macOS + run: fastlane ci_commit configuration:Debug --env macos + iOS: + name: Test iOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: iOS + run: fastlane ci_commit configuration:Debug --env ios13_xcode11 + Catalyst: + name: Test Catalyst + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: Catalyst + run: fastlane ci_commit configuration:Debug --env catalyst + tvOS: + name: Test tvOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: tvOS + run: fastlane ci_commit configuration:Debug --env tvos13_xcode11 + watchOS: + name: Build watchOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + strategy: + matrix: + destination: ["OS=6.1.1,name=Apple Watch Series 5 - 44mm"] #, "OS=4.2,name=Apple Watch Series 3 - 42mm", "OS=3.2,name=Apple Watch Series 2 - 42mm"] + steps: + - uses: actions/checkout@v2 + - name: watchOS - ${{ matrix.destination }} + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "AFNetworking.xcodeproj" -scheme "AFNetworking watchOS" -destination "${{ matrix.destination }}" clean build | xcpretty + SPM: + name: Build with SPM + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: SPM Build + run: swift build diff --git a/.gitignore b/.gitignore index f33bce3b46..cddadc3052 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ fastlane/test-output/* Carthage/Build fastlane/README.md +.build diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 0000000000..0edabf3396 --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +afnetworking diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..944880fa15 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4525b503da..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: objective-c -osx_image: xcode7.1 -sudo: false -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - - FASTLANE_LANE=ci_commit -matrix: - include: - - osx_image: xcode8 - env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default - - 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: xcode7.3 - env: FASTLANE_ENV=ios93_xcode73 - - osx_image: xcode7.3 - env: FASTLANE_ENV=ios81_xcode73 -before_install: - # 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 -script: - - set -o pipefail - - fastlane $FASTLANE_LANE configuration:Debug --env $FASTLANE_ENV - - fastlane $FASTLANE_LANE configuration:Release --env $FASTLANE_ENV -after_success: - - if [ "$FASTLANE_LANE" == "code_coverage" ]; then - bash <(curl -s https://codecov.io/bash); - fi -after_failure: - - cat -n ~/Library/Logs/scan/* - - cat -n $TMPDIR/com.apple.dt.XCTest-status/Session*.log - - cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash -# deploy: -# provider: script -# script: fastlane complete_framework_release --env deploy -# on: -# tags: true diff --git a/AFNetworking.podspec b/AFNetworking.podspec index 8a87e42134..ef110340b5 100644 --- a/AFNetworking.podspec +++ b/AFNetworking.podspec @@ -1,60 +1,39 @@ Pod::Spec.new do |s| s.name = 'AFNetworking' - s.version = '3.1.0' + s.version = '4.0.1' s.license = 'MIT' - s.summary = 'A delightful iOS and OS X networking framework.' + s.summary = 'A delightful networking framework for Apple platforms.' s.homepage = 'https://github.com/AFNetworking/AFNetworking' s.social_media_url = 'https://twitter.com/AFNetworking' s.authors = { 'Mattt Thompson' => 'm@mattt.me' } - s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => s.version, :submodules => true } - s.requires_arc = true - - s.public_header_files = 'AFNetworking/AFNetworking.h' - s.source_files = 'AFNetworking/AFNetworking.h' - - pch_AF = <<-EOS -#ifndef TARGET_OS_IOS - #define TARGET_OS_IOS TARGET_OS_IPHONE -#endif - -#ifndef TARGET_OS_WATCH - #define TARGET_OS_WATCH 0 -#endif + s.source = { :git => 'https://github.com/AFNetworking/AFNetworking.git', :tag => s.version } -#ifndef TARGET_OS_TV - #define TARGET_OS_TV 0 -#endif -EOS - s.prefix_header_contents = pch_AF - - s.ios.deployment_target = '7.0' - s.osx.deployment_target = '10.9' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.10' s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' - + + s.ios.pod_target_xcconfig = { 'PRODUCT_BUNDLE_IDENTIFIER' => 'com.alamofire.AFNetworking' } + s.osx.pod_target_xcconfig = { 'PRODUCT_BUNDLE_IDENTIFIER' => 'com.alamofire.AFNetworking' } + s.watchos.pod_target_xcconfig = { 'PRODUCT_BUNDLE_IDENTIFIER' => 'com.alamofire.AFNetworking-watchOS' } + s.tvos.pod_target_xcconfig = { 'PRODUCT_BUNDLE_IDENTIFIER' => 'com.alamofire.AFNetworking' } + + s.source_files = 'AFNetworking/AFNetworking.h' + s.subspec 'Serialization' do |ss| ss.source_files = 'AFNetworking/AFURL{Request,Response}Serialization.{h,m}' - ss.public_header_files = 'AFNetworking/AFURL{Request,Response}Serialization.h' - ss.watchos.frameworks = 'MobileCoreServices', 'CoreGraphics' - ss.ios.frameworks = 'MobileCoreServices', 'CoreGraphics' - ss.osx.frameworks = 'CoreServices' end s.subspec 'Security' do |ss| ss.source_files = 'AFNetworking/AFSecurityPolicy.{h,m}' - ss.public_header_files = 'AFNetworking/AFSecurityPolicy.h' - ss.frameworks = 'Security' end s.subspec 'Reachability' do |ss| - ss.ios.deployment_target = '7.0' - ss.osx.deployment_target = '10.9' + ss.ios.deployment_target = '9.0' + ss.osx.deployment_target = '10.10' ss.tvos.deployment_target = '9.0' ss.source_files = 'AFNetworking/AFNetworkReachabilityManager.{h,m}' - ss.public_header_files = 'AFNetworking/AFNetworkReachabilityManager.h' - - ss.frameworks = 'SystemConfiguration' end s.subspec 'NSURLSession' do |ss| @@ -64,16 +43,14 @@ EOS ss.tvos.dependency 'AFNetworking/Reachability' ss.dependency 'AFNetworking/Security' - ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}' - ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h' + ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}', 'AFNetworking/AFCompatibilityMacros.h' end s.subspec 'UIKit' do |ss| - ss.ios.deployment_target = '7.0' + ss.ios.deployment_target = '9.0' ss.tvos.deployment_target = '9.0' ss.dependency 'AFNetworking/NSURLSession' - ss.public_header_files = 'UIKit+AFNetworking/*.h' ss.source_files = 'UIKit+AFNetworking' end end diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index df8f045ef8..dcc063410e 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -3,16 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; 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 */; }; - 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 */; }; + 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, ); }; }; 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 */; }; @@ -54,9 +55,6 @@ 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 */; }; @@ -80,12 +78,6 @@ 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 */; }; @@ -136,15 +128,12 @@ 299522A31BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2995228D1BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.m */; }; 299522A61BBF13C700859F49 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522901BBF13C700859F49 /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 299522A71BBF13C700859F49 /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 299522911BBF13C700859F49 /* UIButton+AFNetworking.m */; }; - 299522A81BBF13C700859F49 /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522921BBF13C700859F49 /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 299522A91BBF13C700859F49 /* UIImageView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522931BBF13C700859F49 /* UIImageView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 299522AA1BBF13C700859F49 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 299522941BBF13C700859F49 /* UIImageView+AFNetworking.m */; }; 299522AC1BBF13C700859F49 /* UIProgressView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522961BBF13C700859F49 /* UIProgressView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 299522AD1BBF13C700859F49 /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 299522971BBF13C700859F49 /* UIProgressView+AFNetworking.m */; }; 299522AE1BBF13C700859F49 /* UIRefreshControl+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522981BBF13C700859F49 /* UIRefreshControl+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 299522AF1BBF13C700859F49 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 299522991BBF13C700859F49 /* UIRefreshControl+AFNetworking.m */; }; - 299522B01BBF13C700859F49 /* UIWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2995229A1BBF13C700859F49 /* UIWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 299522B11BBF13C700859F49 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */; }; 29D3413F1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */; }; 29D341401C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */; }; 29D341411C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */; }; @@ -172,10 +161,18 @@ 29D96E951BCC406B00F571A5 /* AFImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522881BBF13C700859F49 /* AFImageDownloader.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29D96E961BCC406B00F571A5 /* UIActivityIndicatorView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 2995228C1BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29D96E971BCC406B00F571A5 /* UIButton+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522901BBF13C700859F49 /* UIButton+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 29D96E981BCC406B00F571A5 /* UIImage+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522921BBF13C700859F49 /* UIImage+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 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 */; }; + 31CBC007242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; + 31CBC008242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; + 31CBC009242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; + 323D83E2231D185400C5BFC6 /* WKWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 323D83E0231D185400C5BFC6 /* WKWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 323D83E3231D185400C5BFC6 /* WKWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 323D83E1231D185400C5BFC6 /* WKWebView+AFNetworking.m */; }; + 323D83E5231D188400C5BFC6 /* AFWKWebViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.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 */; }; @@ -197,6 +194,15 @@ 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 */; }; @@ -228,7 +234,7 @@ /* Begin PBXFileReference section */ 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = ""; }; - 1FE783001C58579D00A73B7C /* httpbinorg_01192017.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_01192017.cer; sourceTree = ""; }; + 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFCompatibilityMacros.h; sourceTree = ""; }; 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = ""; }; 297824A01BC2D69A0041C395 /* adn_0.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_0.cer; path = ADNNetServerTrustChain/adn_0.cer; sourceTree = ""; }; 297824A11BC2D69A0041C395 /* adn_1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_1.cer; path = ADNNetServerTrustChain/adn_1.cer; sourceTree = ""; }; @@ -236,10 +242,7 @@ 2987B0A51BC408A200179A4C /* AFNetworking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AFNetworking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2987B0AE1BC408A200179A4C /* AFNetworking tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking Mac OS X Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 298D7C6E1BC2C88F00FD3B3E /* AddTrust_External_CA_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AddTrust_External_CA_Root.cer; sourceTree = ""; }; - 298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Certification_Authority.cer; sourceTree = ""; }; - 298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Domain_Validation_Secure_Server_CA.cer; sourceTree = ""; }; + 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFNetworking macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 298D7C771BC2C88F00FD3B3E /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; 298D7C791BC2C88F00FD3B3E /* AltName.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AltName.cer; sourceTree = ""; }; 298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = foobar.com.cer; sourceTree = ""; }; @@ -289,7 +292,6 @@ 2995228D1BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActivityIndicatorView+AFNetworking.m"; sourceTree = ""; }; 299522901BBF13C700859F49 /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+AFNetworking.h"; sourceTree = ""; }; 299522911BBF13C700859F49 /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+AFNetworking.m"; sourceTree = ""; }; - 299522921BBF13C700859F49 /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+AFNetworking.h"; sourceTree = ""; }; 299522931BBF13C700859F49 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+AFNetworking.h"; sourceTree = ""; }; 299522941BBF13C700859F49 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+AFNetworking.m"; sourceTree = ""; }; 299522951BBF13C700859F49 /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIKit+AFNetworking.h"; sourceTree = ""; }; @@ -297,10 +299,22 @@ 299522971BBF13C700859F49 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIProgressView+AFNetworking.m"; sourceTree = ""; }; 299522981BBF13C700859F49 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; 299522991BBF13C700859F49 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+AFNetworking.m"; sourceTree = ""; }; - 2995229A1BBF13C700859F49 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+AFNetworking.h"; sourceTree = ""; }; - 2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = ""; }; 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCompoundResponseSerializerTests.m; sourceTree = ""; }; - 29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIWebViewTests.m; sourceTree = ""; }; + 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLParserResponseSerializerTests.m; sourceTree = ""; }; + 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLDocumentResponseSerializerTests.m; sourceTree = ""; }; + 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = httpbinorg_02182021.cer; sourceTree = ""; }; + 323D83E0231D185400C5BFC6 /* WKWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKWebView+AFNetworking.h"; sourceTree = ""; }; + 323D83E1231D185400C5BFC6 /* WKWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+AFNetworking.m"; sourceTree = ""; }; + 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFWKWebViewTests.m; sourceTree = ""; }; + 439E280C247E16DE004467ED /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; }; + 439E280D247E16DE004467ED /* Gemfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = Gemfile; sourceTree = SOURCE_ROOT; tabWidth = 2; }; + 439E280E247E16DE004467ED /* Gemfile.lock */ = {isa = PBXFileReference; explicitFileType = text.yaml; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = Gemfile.lock; sourceTree = SOURCE_ROOT; tabWidth = 2; }; + 439E280F247E16DE004467ED /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = SOURCE_ROOT; }; + 439E2810247E16DE004467ED /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; + 439E2811247E16DE004467ED /* AFNetworking.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; indentWidth = 2; lineEnding = 0; path = AFNetworking.podspec; sourceTree = SOURCE_ROOT; tabWidth = 2; }; + 439E2812247E16DE004467ED /* CONTRIBUTING_CH.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING_CH.md; sourceTree = SOURCE_ROOT; }; + 439E2813247E16DE004467ED /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; }; + 439E2814247E16DF004467ED /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = SOURCE_ROOT; }; 5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Equifax_Secure_Certificate_Authority_Root.cer; sourceTree = ""; }; 5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "GeoTrust_Global_CA-cross.cer"; sourceTree = ""; }; 5F4323B51BF63741003B8749 /* google.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.com.cer; sourceTree = ""; }; @@ -308,6 +322,9 @@ 5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath1; sourceTree = ""; }; 5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath2; sourceTree = ""; }; 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GeoTrust_Global_CA_Root.cer; sourceTree = ""; }; + E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Starfield Services Root Certificate Authority - G2.cer"; sourceTree = ""; }; + E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Amazon Root CA 1.cer"; sourceTree = ""; }; + E2B10D8D233035100004E005 /* Amazon.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Amazon.cer; sourceTree = ""; }; E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPropertyListRequestSerializerTests.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -402,11 +419,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 */, - 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 */, + 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */, ); path = HTTPBin.org; sourceTree = ""; @@ -435,17 +452,19 @@ 298D7CD11BC2CABE00FD3B3E /* AFNetworking Tests */ = { isa = PBXGroup; children = ( + 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */, 298D7C811BC2C88F00FD3B3E /* AFHTTPRequestSerializationTests.m */, 298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */, 298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */, - 298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */, - 298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */, - E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */, - 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */, 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */, + 298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */, 298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */, + E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */, + 298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */, 298D7C891BC2C88F00FD3B3E /* AFSecurityPolicyTests.m */, 298D7C8F1BC2C88F00FD3B3E /* AFURLSessionManagerTests.m */, + 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */, + 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */, ); name = "AFNetworking Tests"; sourceTree = ""; @@ -457,10 +476,10 @@ 298D7C841BC2C88F00FD3B3E /* AFImageDownloaderTests.m */, 298D7C861BC2C88F00FD3B3E /* AFNetworkActivityManagerTests.m */, 298D7C8C1BC2C88F00FD3B3E /* AFUIActivityIndicatorViewTests.m */, + 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */, 298D7C8D1BC2C88F00FD3B3E /* AFUIImageViewTests.m */, 298D7C8E1BC2C88F00FD3B3E /* AFUIRefreshControlTests.m */, - 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */, - 29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */, + 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.m */, ); name = "AFNetworking UIKit Tests"; sourceTree = ""; @@ -486,7 +505,7 @@ 299522651BBF129200859F49 /* AFNetworking.framework */, 299522771BBF136400859F49 /* AFNetworking.framework */, 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */, - 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */, + 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */, 2987B0A51BC408A200179A4C /* AFNetworking.framework */, 2987B0AE1BC408A200179A4C /* AFNetworking tvOS Tests.xctest */, ); @@ -498,6 +517,15 @@ children = ( 2995223C1BBF104D00859F49 /* AFNetworking.h */, 2995223E1BBF104D00859F49 /* Info.plist */, + 439E2811247E16DE004467ED /* AFNetworking.podspec */, + 439E2814247E16DF004467ED /* CHANGELOG.md */, + 439E2812247E16DE004467ED /* CONTRIBUTING_CH.md */, + 439E280F247E16DE004467ED /* CONTRIBUTING.md */, + 439E280D247E16DE004467ED /* Gemfile */, + 439E280E247E16DE004467ED /* Gemfile.lock */, + 439E280C247E16DE004467ED /* LICENSE */, + 439E2813247E16DE004467ED /* Package.swift */, + 439E2810247E16DE004467ED /* README.md */, ); name = "Supporting Files"; path = AFNetworking; @@ -506,6 +534,7 @@ 299522451BBF125A00859F49 /* AFNetworking */ = { isa = PBXGroup; children = ( + 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */, 299522461BBF125A00859F49 /* AFHTTPSessionManager.h */, 299522471BBF125A00859F49 /* AFHTTPSessionManager.m */, 299522491BBF125A00859F49 /* AFNetworkReachabilityManager.h */, @@ -535,7 +564,6 @@ 2995228D1BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.m */, 299522901BBF13C700859F49 /* UIButton+AFNetworking.h */, 299522911BBF13C700859F49 /* UIButton+AFNetworking.m */, - 299522921BBF13C700859F49 /* UIImage+AFNetworking.h */, 299522931BBF13C700859F49 /* UIImageView+AFNetworking.h */, 299522941BBF13C700859F49 /* UIImageView+AFNetworking.m */, 299522951BBF13C700859F49 /* UIKit+AFNetworking.h */, @@ -543,8 +571,8 @@ 299522971BBF13C700859F49 /* UIProgressView+AFNetworking.m */, 299522981BBF13C700859F49 /* UIRefreshControl+AFNetworking.h */, 299522991BBF13C700859F49 /* UIRefreshControl+AFNetworking.m */, - 2995229A1BBF13C700859F49 /* UIWebView+AFNetworking.h */, - 2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */, + 323D83E0231D185400C5BFC6 /* WKWebView+AFNetworking.h */, + 323D83E1231D185400C5BFC6 /* WKWebView+AFNetworking.m */, ); path = "UIKit+AFNetworking"; sourceTree = ""; @@ -578,9 +606,9 @@ 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 */, 29D96E991BCC406B00F571A5 /* UIImageView+AFNetworking.h in Headers */, 29D96E9A1BCC406B00F571A5 /* UIProgressView+AFNetworking.h in Headers */, 29D96E8E1BCC3D7D00F571A5 /* AFNetworking.h in Headers */, @@ -592,7 +620,6 @@ buildActionMask = 2147483647; files = ( 2995225A1BBF125A00859F49 /* AFURLRequestSerialization.h in Headers */, - 299522A81BBF13C700859F49 /* UIImage+AFNetworking.h in Headers */, 299522531BBF125A00859F49 /* AFHTTPSessionManager.h in Headers */, 2995229C1BBF13C700859F49 /* AFAutoPurgingImageCache.h in Headers */, 299522581BBF125A00859F49 /* AFSecurityPolicy.h in Headers */, @@ -600,10 +627,11 @@ 299522A91BBF13C700859F49 /* UIImageView+AFNetworking.h in Headers */, 2995229E1BBF13C700859F49 /* AFImageDownloader.h in Headers */, 2995225E1BBF125A00859F49 /* AFURLSessionManager.h in Headers */, + 323D83E2231D185400C5BFC6 /* WKWebView+AFNetworking.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 */, 299522A61BBF13C700859F49 /* UIButton+AFNetworking.h in Headers */, 299522A01BBF13C700859F49 /* AFNetworkActivityIndicatorManager.h in Headers */, @@ -617,6 +645,7 @@ 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 */, @@ -631,6 +660,7 @@ 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 */, @@ -695,9 +725,9 @@ productReference = 298D7C3B1BC2C79500FD3B3E /* AFNetworking iOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */ = { + 298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */; + buildConfigurationList = 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */; buildPhases = ( 298D7C461BC2C7B200FD3B3E /* Sources */, 298D7C471BC2C7B200FD3B3E /* Frameworks */, @@ -708,9 +738,9 @@ dependencies = ( 298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */, ); - name = "AFNetworking Mac OS X Tests"; + name = "AFNetworking macOS Tests"; productName = "AFNetworking Mac OS X Tests"; - productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests.xctest */; + productReference = 298D7C4A1BC2C7B200FD3B3E /* AFNetworking macOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 299522381BBF104D00859F49 /* AFNetworking iOS */ = { @@ -749,9 +779,9 @@ productReference = 299522651BBF129200859F49 /* AFNetworking.framework */; productType = "com.apple.product-type.framework"; }; - 299522761BBF136400859F49 /* AFNetworking OS X */ = { + 299522761BBF136400859F49 /* AFNetworking macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */; + buildConfigurationList = 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */; buildPhases = ( 299522721BBF136400859F49 /* Sources */, 299522731BBF136400859F49 /* Frameworks */, @@ -762,7 +792,7 @@ ); dependencies = ( ); - name = "AFNetworking OS X"; + name = "AFNetworking macOS"; productName = "AFNetworking OS X"; productReference = 299522771BBF136400859F49 /* AFNetworking.framework */; productType = "com.apple.product-type.framework"; @@ -773,40 +803,46 @@ 299522301BBF104D00859F49 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1140; ORGANIZATIONNAME = AFNetworking; TargetAttributes = { 2987B0A41BC408A200179A4C = { CreatedOnToolsVersion = 7.1; + ProvisioningStyle = Automatic; }; 2987B0AD1BC408A200179A4C = { CreatedOnToolsVersion = 7.1; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 298D7C3A1BC2C79500FD3B3E = { CreatedOnToolsVersion = 7.0.1; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 298D7C491BC2C7B200FD3B3E = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522381BBF104D00859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522641BBF129200859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522761BBF136400859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 299522331BBF104D00859F49 /* Build configuration list for PBXProject "AFNetworking" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 2995222F1BBF104D00859F49; productRefGroup = 2995223A1BBF104D00859F49 /* Products */; @@ -815,10 +851,10 @@ targets = ( 299522381BBF104D00859F49 /* AFNetworking iOS */, 299522641BBF129200859F49 /* AFNetworking watchOS */, - 299522761BBF136400859F49 /* AFNetworking OS X */, + 299522761BBF136400859F49 /* AFNetworking macOS */, 2987B0A41BC408A200179A4C /* AFNetworking tvOS */, 298D7C3A1BC2C79500FD3B3E /* AFNetworking iOS Tests */, - 298D7C491BC2C7B200FD3B3E /* AFNetworking Mac OS X Tests */, + 298D7C491BC2C7B200FD3B3E /* AFNetworking macOS Tests */, 2987B0AD1BC408A200179A4C /* AFNetworking tvOS Tests */, ); }; @@ -838,21 +874,21 @@ files = ( 2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */, 2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */, - 2987B0D91BC40AF300179A4C /* COMODO_RSA_Certification_Authority.cer in Resources */, + E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.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 */, - 1FE783031C5857A200A73B7C /* httpbinorg_01192017.cer in Resources */, + E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC009242D8DF200934333 /* httpbinorg_02182021.cer in Resources */, 5F4323C01BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */, 5F4323CF1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */, 5F4323C31BF63741003B8749 /* google.com.cer in Resources */, @@ -863,12 +899,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 298D7CC51BC2CAA200FD3B3E /* AddTrust_External_CA_Root.cer in Resources */, 298D7CBF1BC2CA9D00FD3B3E /* foobar.com.cer in Resources */, 298D7CBA1BC2CA9800FD3B3E /* logo.png in Resources */, - 298D7CC61BC2CAA200FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */, + E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.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 */, @@ -876,10 +910,12 @@ 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 */, - 1FE783011C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */, + E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC007242D8DF200934333 /* httpbinorg_02182021.cer in Resources */, 5F4323BE1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */, 5F4323CD1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */, 5F4323C11BF63741003B8749 /* google.com.cer in Resources */, @@ -890,12 +926,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 298D7CC11BC2CAA100FD3B3E /* AddTrust_External_CA_Root.cer in Resources */, 298D7CBC1BC2CA9C00FD3B3E /* foobar.com.cer in Resources */, 298D7CB91BC2CA9800FD3B3E /* logo.png in Resources */, - 298D7CC21BC2CAA100FD3B3E /* COMODO_RSA_Certification_Authority.cer in Resources */, + E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.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 */, @@ -903,10 +937,12 @@ 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 */, - 1FE783021C5857A100A73B7C /* httpbinorg_01192017.cer in Resources */, + E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC008242D8DF200934333 /* httpbinorg_02182021.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 */, @@ -975,6 +1011,7 @@ 2987B0CF1BC40A7600179A4C /* AFPropertyListResponseSerializerTests.m in Sources */, 2987B0D21BC40AD800179A4C /* AFTestCase.m in Sources */, 2987B0CD1BC40A7600179A4C /* AFJSONSerializationTests.m in Sources */, + 2D4563921DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */, E91164671DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -998,8 +1035,9 @@ 298D7CD91BC2CAF200FD3B3E /* AFNetworkReachabilityManagerTests.m in Sources */, 297824AA1BC2DAD80041C395 /* AFAutoPurgingImageCacheTests.m in Sources */, 298D7C981BC2CA2500FD3B3E /* AFURLSessionManagerTests.m in Sources */, + 323D83E5231D188400C5BFC6 /* AFWKWebViewTests.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 */, @@ -1018,8 +1056,10 @@ 1BF9F9611C87843200F1F35A /* AFImageResponseSerializerTests.m in Sources */, 298D7C971BC2C94500FD3B3E /* AFTestCase.m in Sources */, 298D7CD81BC2CAF000FD3B3E /* AFJSONSerializationTests.m in Sources */, + 2D4563941DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m in Sources */, 298D7CDC1BC2CAF500FD3B3E /* AFPropertyListResponseSerializerTests.m in Sources */, 298D7CD61BC2CAED00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */, + 2D4563911DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */, 298D7CDA1BC2CAF300FD3B3E /* AFNetworkReachabilityManagerTests.m in Sources */, 298D7C991BC2CA2600FD3B3E /* AFURLSessionManagerTests.m in Sources */, ); @@ -1033,10 +1073,10 @@ 299522571BBF125A00859F49 /* AFNetworkReachabilityManager.m in Sources */, 299522AF1BBF13C700859F49 /* UIRefreshControl+AFNetworking.m in Sources */, 299522AA1BBF13C700859F49 /* UIImageView+AFNetworking.m in Sources */, - 299522B11BBF13C700859F49 /* UIWebView+AFNetworking.m in Sources */, 299522591BBF125A00859F49 /* AFSecurityPolicy.m in Sources */, 299522A71BBF13C700859F49 /* UIButton+AFNetworking.m in Sources */, 299522541BBF125A00859F49 /* AFHTTPSessionManager.m in Sources */, + 323D83E3231D185400C5BFC6 /* WKWebView+AFNetworking.m in Sources */, 2995225F1BBF125A00859F49 /* AFURLSessionManager.m in Sources */, 2995225B1BBF125A00859F49 /* AFURLRequestSerialization.m in Sources */, 2995229D1BBF13C700859F49 /* AFAutoPurgingImageCache.m in Sources */, @@ -1087,7 +1127,7 @@ }; 298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 299522761BBF136400859F49 /* AFNetworking OS X */; + target = 299522761BBF136400859F49 /* AFNetworking macOS */; targetProxy = 298D7C501BC2C7B200FD3B3E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -1096,116 +1136,140 @@ 2987B0B61BC408A200179A4C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; 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; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; 2987B0B71BC408A200179A4C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; 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; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; 2987B0B81BC408A200179A4C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TARGETED_DEVICE_FAMILY = 3; }; name = Debug; }; 2987B0B91BC408A200179A4C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TARGETED_DEVICE_FAMILY = 3; }; name = Release; }; 298D7C431BC2C79500FD3B3E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-iOS-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; }; name = Debug; }; 298D7C441BC2C79500FD3B3E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-iOS-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; }; name = Release; }; 298D7C531BC2C7B200FD3B3E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-Mac-OS-X-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; }; name = Debug; @@ -1213,14 +1277,18 @@ 298D7C541BC2C7B200FD3B3E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-Mac-OS-X-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; }; name = Release; @@ -1229,12 +1297,16 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; + 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; @@ -1244,10 +1316,14 @@ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; @@ -1258,7 +1334,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1266,7 +1342,7 @@ "DEBUG=1", "$(inherited)", ); - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -1285,8 +1361,9 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.0.1; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1295,6 +1372,11 @@ TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wno-unused-parameter", + ); WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; @@ -1303,12 +1385,16 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; + 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; @@ -1318,10 +1404,14 @@ CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; @@ -1332,9 +1422,9 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_NO_COMMON_BLOCKS = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -1353,8 +1443,9 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.0.1; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; @@ -1363,6 +1454,11 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wno-unused-parameter", + ); WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; @@ -1370,44 +1466,54 @@ 299522421BBF104D00859F49 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; 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; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; 299522431BBF104D00859F49 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; 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; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1416,8 +1522,12 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1426,11 +1536,10 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS"; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -1439,8 +1548,12 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1449,61 +1562,64 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS"; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; 2995227D1BBF136400859F49 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; 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"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; 2995227E1BBF136400859F49 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; 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"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1537,7 +1653,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking Mac OS X Tests" */ = { + 298D7C521BC2C7B200FD3B3E /* Build configuration list for PBXNativeTarget "AFNetworking macOS Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 298D7C531BC2C7B200FD3B3E /* Debug */, @@ -1573,7 +1689,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking OS X" */ = { + 2995227C1BBF136400859F49 /* Build configuration list for PBXNativeTarget "AFNetworking macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 2995227D1BBF136400859F49 /* Debug */, diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme index e4fb0852b7..49d21b1db3 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES" + codeCoverageEnabled = "YES"> + + + + + + + + + + + + + allowLocationSimulation = "YES" + consoleMode = "1"> - - @@ -27,30 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "NO" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES" codeCoverageEnabled = "YES"> - - - - - - - - - - @@ -62,7 +47,29 @@ + + + + + + + + + + + + - - diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme index dca989fffe..7f88028922 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking tvOS.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES"> + + + + + + + + + + @@ -102,13 +102,6 @@ isEnabled = "YES"> - - - - - - - - +#ifndef AFCompatibilityMacros_h +#define AFCompatibilityMacros_h -@interface UIImage (AFNetworking) +#ifdef API_AVAILABLE + #define AF_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__) +#else + #define AF_API_AVAILABLE(...) +#endif // API_AVAILABLE -+ (UIImage*) safeImageWithData:(NSData*)data; +#ifdef API_UNAVAILABLE + #define AF_API_UNAVAILABLE(...) API_UNAVAILABLE(__VA_ARGS__) +#else + #define AF_API_UNAVAILABLE(...) +#endif // API_UNAVAILABLE -@end +#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 */ diff --git a/AFNetworking/AFHTTPSessionManager.h b/AFNetworking/AFHTTPSessionManager.h index 64ee5a814b..943fc22df0 100644 --- a/AFNetworking/AFHTTPSessionManager.h +++ b/AFNetworking/AFHTTPSessionManager.h @@ -25,12 +25,6 @@ #endif #import -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV -#import -#else -#import -#endif - #import "AFURLSessionManager.h" /** @@ -40,8 +34,6 @@ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. - For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. - ## Methods to Override To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`. @@ -140,115 +132,75 @@ NS_ASSUME_NONNULL_BEGIN /** 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 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 *)GET:(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 `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 *)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; /** 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 - success:(nullable void (^)(NSURLSessionDataTask *task))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; - -/** - 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 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 *)POST:(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; + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; /** 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 *)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; /** 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 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 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 *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - 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 *)headers constructingBodyWithBlock:(nullable void (^)(id formData))block progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success @@ -256,48 +208,77 @@ NS_ASSUME_NONNULL_BEGIN /** 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 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; /** 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 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; /** 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 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates an `NSURLSessionDataTask` with a custom `HTTPMethod` request. + + @param method The HTTPMethod string used to create the 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 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 *)dataTaskWithHTTPMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress + downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; @end diff --git a/AFNetworking/AFHTTPSessionManager.m b/AFNetworking/AFHTTPSessionManager.m index cab11c28f4..b4ab5915c3 100644 --- a/AFNetworking/AFHTTPSessionManager.m +++ b/AFNetworking/AFHTTPSessionManager.m @@ -118,99 +118,80 @@ - (void)setSecurityPolicy:(AFSecurityPolicy *)securityPolicy { #pragma mark - - (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + progress:(nullable void (^)(NSProgress * _Nonnull))downloadProgress + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure { - - return [self GET:URLString parameters:parameters progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - 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; } - (NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure { - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { if (success) { success(task); } } failure:failure]; - + [dataTask resume]; - + return dataTask; } -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)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 { - return [self POST:URLString parameters:parameters progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - progress:(void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; - + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters headers:headers uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; + [dataTask resume]; - + return dataTask; } - (NSURLSessionDataTask *)POST:(NSString *)URLString parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers constructingBodyWithBlock:(nullable void (^)(id _Nonnull))block - success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - constructingBodyWithBlock:(void (^)(id formData))block progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + success:(nullable 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 setValue: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) { @@ -222,58 +203,66 @@ - (NSURLSessionDataTask *)POST:(NSString *)URLString } } }]; - + [task resume]; - + return task; } - (NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; - + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure]; + [dataTask resume]; - + return dataTask; } - (NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; - + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure]; + [dataTask resume]; - + return dataTask; } - (NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure: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 + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress - success:(void (^)(NSURLSessionDataTask *, id))success - failure:(void (^)(NSURLSessionDataTask *, NSError *))failure + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure { 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 setValue:headers[headerField] forHTTPHeaderField:headerField]; + } if (serializationError) { if (failure) { dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ @@ -321,11 +310,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { if (!configuration) { NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"]; if (configurationIdentifier) { -#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100) configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier]; -#else - configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier]; -#endif } } diff --git a/AFNetworking/AFNetworkReachabilityManager.h b/AFNetworking/AFNetworkReachabilityManager.h index 72296d496a..21982a0e3c 100644 --- a/AFNetworking/AFNetworkReachabilityManager.h +++ b/AFNetworking/AFNetworkReachabilityManager.h @@ -108,11 +108,14 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; /** - * Initializes an instance of a network reachability manager - * - * @return nil as this method is unavailable + * Unavailable initializer */ -- (nullable instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/** + * Unavailable initializer + */ +- (instancetype)init NS_UNAVAILABLE; ///-------------------------------------------------- /// @name Starting & Stopping Reachability Monitoring diff --git a/AFNetworking/AFNetworkReachabilityManager.m b/AFNetworking/AFNetworkReachabilityManager.m index d45836485d..45aeb2f7f7 100644 --- a/AFNetworking/AFNetworkReachabilityManager.m +++ b/AFNetworking/AFNetworkReachabilityManager.m @@ -32,6 +32,7 @@ NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem"; typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); +typedef AFNetworkReachabilityManager * (^AFNetworkReachabilityStatusCallback)(AFNetworkReachabilityStatus status); NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { switch (status) { @@ -78,20 +79,21 @@ 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, AFNetworkReachabilityStatusBlock block) { +static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusCallback block) { AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); dispatch_async(dispatch_get_main_queue(), ^{ + AFNetworkReachabilityManager *manager = nil; if (block) { - block(status); + manager = block(status); } NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; - [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo]; + [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:manager userInfo:userInfo]; }); } static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) { - AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info); + AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusCallback)info); } @@ -170,8 +172,11 @@ - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability { return self; } -- (instancetype)init NS_UNAVAILABLE +- (instancetype)init { + @throw [NSException exceptionWithName:NSGenericException + reason:@"`-init` unavailable. Use `-initWithReachability:` instead" + userInfo:nil]; return nil; } @@ -207,21 +212,22 @@ - (void)startMonitoring { } __weak __typeof(self)weakSelf = self; - AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) { + AFNetworkReachabilityStatusCallback 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}; SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context); SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0),^{ SCNetworkReachabilityFlags flags; if (SCNetworkReachabilityGetFlags(self.networkReachability, &flags)) { AFPostReachabilityStatusChange(flags, callback); diff --git a/AFNetworking/AFSecurityPolicy.h b/AFNetworking/AFSecurityPolicy.h index c005efa81b..9b966a5766 100644 --- a/AFNetworking/AFSecurityPolicy.h +++ b/AFNetworking/AFSecurityPolicy.h @@ -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 *pinnedCertificates; @@ -90,10 +90,14 @@ 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; @@ -104,7 +108,10 @@ 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 *)pinnedCertificates; ///------------------------------ diff --git a/AFNetworking/AFSecurityPolicy.m b/AFNetworking/AFSecurityPolicy.m index 043441a03b..da199aa3b7 100644 --- a/AFNetworking/AFSecurityPolicy.m +++ b/AFNetworking/AFSecurityPolicy.m @@ -60,7 +60,10 @@ static id AFPublicKeyForCertificate(NSData *certificate) { policy = SecPolicyCreateBasicX509(); __Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); +#pragma clang diagnostic pop allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); @@ -83,7 +86,10 @@ static id AFPublicKeyForCertificate(NSData *certificate) { static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { BOOL isValid = NO; SecTrustResultType result; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); +#pragma clang diagnostic pop isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); @@ -115,10 +121,11 @@ static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { SecTrustRef trust; __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); - SecTrustResultType result; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); - +#pragma clang diagnostic pop [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; _out: @@ -158,17 +165,6 @@ + (NSSet *)certificatesInBundle:(NSBundle *)bundle { 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; @@ -177,7 +173,8 @@ + (instancetype)defaultPolicy { } + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { - return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]]; + NSSet *defaultPinnedCertificates = [self certificatesInBundle:[NSBundle mainBundle]]; + return [self policyWithPinningMode:pinningMode withPinnedCertificates:defaultPinnedCertificates]; } + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates { @@ -247,14 +244,11 @@ - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust if (self.SSLPinningMode == AFSSLPinningModeNone) { return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); - } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { + } else if (!self.allowInvalidCertificates && !AFServerTrustIsValid(serverTrust)) { return NO; } switch (self.SSLPinningMode) { - case AFSSLPinningModeNone: - default: - return NO; case AFSSLPinningModeCertificate: { NSMutableArray *pinnedCertificates = [NSMutableArray array]; for (NSData *certificateData in self.pinnedCertificates) { @@ -290,6 +284,9 @@ - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust } return trustedPublicKeyCount > 0; } + + default: + return NO; } return NO; @@ -317,7 +314,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { 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:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; + self.pinnedCertificates = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(pinnedCertificates))]; return self; } diff --git a/AFNetworking/AFURLRequestSerialization.h b/AFNetworking/AFURLRequestSerialization.h index 694696b9aa..dd7cb457bc 100644 --- a/AFNetworking/AFURLRequestSerialization.h +++ b/AFNetworking/AFURLRequestSerialization.h @@ -216,7 +216,7 @@ forHTTPHeaderField:(NSString *)field; @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. */ -- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; +- (void)setQueryStringSerializationWithBlock:(nullable NSString * _Nullable (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; ///------------------------------- /// @name Creating Request Objects @@ -234,10 +234,10 @@ forHTTPHeaderField:(NSString *)field; @return An `NSMutableURLRequest` object. */ -- (NSMutableURLRequest *)requestWithMethod:(NSString *)method - URLString:(NSString *)URLString - parameters:(nullable id)parameters - error:(NSError * _Nullable __autoreleasing *)error; +- (nullable NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error; /** Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 @@ -278,7 +278,7 @@ forHTTPHeaderField:(NSString *)field; #pragma mark - /** - The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`. + The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`. */ @protocol AFMultipartFormData diff --git a/AFNetworking/AFURLRequestSerialization.m b/AFNetworking/AFURLRequestSerialization.m index 68c2c2d7be..f1d9ee18a0 100644 --- a/AFNetworking/AFURLRequestSerialization.m +++ b/AFNetworking/AFURLRequestSerialization.m @@ -217,12 +217,13 @@ - (instancetype)init { }]; [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]]; @@ -312,7 +313,7 @@ - (NSDictionary *)HTTPRequestHeaders { - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field { - dispatch_barrier_async(self.requestHeaderModificationQueue, ^{ + dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{ [self.mutableHTTPRequestHeaders setValue:value forKey:field]; }); } @@ -334,7 +335,7 @@ - (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username } - (void)clearAuthorizationHeader { - dispatch_barrier_async(self.requestHeaderModificationQueue, ^{ + dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{ [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"]; }); } @@ -367,10 +368,8 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url]; mutableRequest.HTTPMethod = method; - for (NSString *keyPath in AFHTTPRequestSerializerObservedKeyPaths()) { - if ([self.mutableObservedChangedKeyPaths containsObject:keyPath]) { - [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath]; - } + for (NSString *keyPath in self.mutableObservedChangedKeyPaths) { + [mutableRequest setValue:[self valueForKeyPath:keyPath] forKey:keyPath]; } mutableRequest = [[self requestBySerializingRequest:mutableRequest withParameters:parameters error:error] mutableCopy]; @@ -571,7 +570,7 @@ - (void)encodeWithCoder:(NSCoder *)coder { dispatch_sync(self.requestHeaderModificationQueue, ^{ [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))]; }); - [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; + [coder encodeObject:@(self.queryStringSerializationStyle) forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; } #pragma mark - NSCopying @@ -679,6 +678,11 @@ - (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest return self; } +- (void)setRequest:(NSMutableURLRequest *)request +{ + _request = [request mutableCopy]; +} + - (BOOL)appendPartWithFileURL:(NSURL *)fileURL name:(NSString *)name error:(NSError * __autoreleasing *)error @@ -1290,7 +1294,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; - [coder encodeInteger:self.writingOptions forKey:NSStringFromSelector(@selector(writingOptions))]; + [coder encodeObject:@(self.writingOptions) forKey:NSStringFromSelector(@selector(writingOptions))]; } #pragma mark - NSCopying @@ -1376,7 +1380,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; - [coder encodeInteger:self.format forKey:NSStringFromSelector(@selector(format))]; + [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))]; [coder encodeObject:@(self.writeOptions) forKey:NSStringFromSelector(@selector(writeOptions))]; } diff --git a/AFNetworking/AFURLResponseSerialization.h b/AFNetworking/AFURLResponseSerialization.h index 0f6d462b7c..56a4d28ae1 100644 --- a/AFNetworking/AFURLResponseSerialization.h +++ b/AFNetworking/AFURLResponseSerialization.h @@ -24,6 +24,11 @@ NS_ASSUME_NONNULL_BEGIN +/** + Recursively removes `NSNull` values from a JSON object. +*/ +FOUNDATION_EXPORT id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions); + /** The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. @@ -57,8 +62,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; -@property (nonatomic, assign) NSStringEncoding stringEncoding DEPRECATED_MSG_ATTRIBUTE("The string encoding is never used. AFHTTPResponseSerializer only validates status codes and content types but does not try to decode the received data in any way."); - /** Creates and returns a serializer with default configuration. */ @@ -108,6 +111,8 @@ NS_ASSUME_NONNULL_BEGIN - `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 @@ -163,7 +168,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; /** - Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSXMLDocument` documentation section "Input and Output Options". `0` by default. */ @property (nonatomic, assign) NSUInteger options; diff --git a/AFNetworking/AFURLResponseSerialization.m b/AFNetworking/AFURLResponseSerialization.m index b7be3d403c..2715a1b319 100755 --- a/AFNetworking/AFURLResponseSerialization.m +++ b/AFNetworking/AFURLResponseSerialization.m @@ -60,11 +60,13 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co return NO; } -static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { +id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) { if ([JSONObject isKindOfClass:[NSArray class]]) { NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]]; for (id value in (NSArray *)JSONObject) { - [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + if (![value isEqual:[NSNull null]]) { + [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)]; + } } return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray]; @@ -112,7 +114,7 @@ - (BOOL)validateResponse:(NSHTTPURLResponse *)response BOOL responseIsValid = YES; NSError *validationError = nil; - if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { + if ([response isKindOfClass:[NSHTTPURLResponse class]]) { if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] && !([response MIMEType] == nil && [data length] == 0)) { @@ -180,7 +182,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { } self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))]; - self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; + self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))]; return self; } @@ -269,6 +271,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -486,6 +492,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -702,6 +712,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -788,13 +802,18 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { return nil; } - self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))]; + NSSet *classes = [NSSet setWithArray:@[[NSArray class], [AFHTTPResponseSerializer class]]]; + self.responseSerializers = [decoder decodeObjectOfClasses:classes forKey:NSStringFromSelector(@selector(responseSerializers))]; return self; } diff --git a/AFNetworking/AFURLSessionManager.h b/AFNetworking/AFURLSessionManager.h index 3824736a78..399f64959b 100644 --- a/AFNetworking/AFURLSessionManager.h +++ b/AFNetworking/AFURLSessionManager.h @@ -25,6 +25,7 @@ #import "AFURLResponseSerialization.h" #import "AFURLRequestSerialization.h" #import "AFSecurityPolicy.h" +#import "AFCompatibilityMacros.h" #if !TARGET_OS_WATCH #import "AFNetworkReachabilityManager.h" #endif @@ -64,7 +65,7 @@ ### `NSURLSessionDownloadDelegate` - `URLSession:downloadTask:didFinishDownloadingToURL:` - - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:` + - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:` - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:` If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. @@ -164,19 +165,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, strong, nullable) dispatch_group_t completionGroup; -///--------------------------------- -/// @name Working Around System Bugs -///--------------------------------- - -/** - Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. - - @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. - - @see https://github.com/AFNetworking/AFNetworking/issues/1675 - */ -@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; - ///--------------------- /// @name Initialization ///--------------------- @@ -191,25 +179,17 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; /** - Invalidates the managed session, optionally canceling pending tasks. - - @param cancelPendingTasks Whether or not to cancel pending tasks. + 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; +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession; ///------------------------- /// @name Running Data Tasks ///------------------------- -/** - Creates an `NSURLSessionDataTask` with the specified request. - - @param request The HTTP request for the request. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE; - /** Creates an `NSURLSessionDataTask` with the specified request. @@ -335,6 +315,11 @@ NS_ASSUME_NONNULL_BEGIN Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + + @warning Implementing a session authentication challenge handler yourself totally bypasses AFNetworking's security policy defined in `AFSecurityPolicy`. Make sure you fully understand the implications before implementing a custom session authentication challenge handler. If you do not want to bypass AFNetworking's security policy, use `-setAuthenticationChallengeHandler:` instead. + + @see -securityPolicy + @see -setAuthenticationChallengeHandler: */ - (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; @@ -354,14 +339,27 @@ 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 * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; +- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * _Nullable (^)(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:`. - - @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. - */ -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + + @param authenticationChallengeHandler A block object to be executed when a session task has received a request specific authentication challenge. + + When implementing an authentication challenge handler, you should check the authentication method first (`challenge.protectionSpace.authenticationMethod `) to decide if you want to handle the authentication challenge yourself or if you want AFNetworking to handle it. If you want AFNetworking to handle the authentication challenge, just return `@(NSURLSessionAuthChallengePerformDefaultHandling)`. For example, you certainly want AFNetworking to handle certificate validation (i.e. authentication method == `NSURLAuthenticationMethodServerTrust`) as defined by the security policy. If you want to handle the challenge yourself, you have four options: + + 1. Return `nil` from the authentication challenge handler. You **MUST** call the completion handler with a disposition and credentials yourself. Use this if you need to present a user interface to let the user enter their credentials. + 2. Return an `NSError` object from the authentication challenge handler. You **MUST NOT** call the completion handler when returning an `NSError `. The returned error will be reported in the completion handler of the task. Use this if you need to abort an authentication challenge with a specific error. + 3. Return an `NSURLCredential` object from the authentication challenge handler. You **MUST NOT** call the completion handler when returning an `NSURLCredential`. The returned credentials will be used to fulfil the challenge. Use this when you can get credentials without presenting a user interface. + 4. Return an `NSNumber` object wrapping an `NSURLSessionAuthChallengeDisposition`. Supported values are `@(NSURLSessionAuthChallengePerformDefaultHandling)`, `@(NSURLSessionAuthChallengeCancelAuthenticationChallenge)` and `@(NSURLSessionAuthChallengeRejectProtectionSpace)`. You **MUST NOT** call the completion handler when returning an `NSNumber`. + + If you return anything else from the authentication challenge handler, an exception will be thrown. + + For more information about how URL sessions handle the different types of authentication challenges, see [NSURLSession](https://developer.apple.com/reference/foundation/nsurlsession?language=objc) and [URL Session Programming Guide](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html). + + @see -securityPolicy + */ +- (void)setAuthenticationChallengeHandler:(id (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition , NSURLCredential * _Nullable)))authenticationChallengeHandler; /** Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. @@ -377,6 +375,14 @@ 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 AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)); +#endif ///------------------------------------------- /// @name Setting Data Task Delegate Callbacks ///------------------------------------------- @@ -410,11 +416,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; /** - Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. + Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. @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; +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block AF_API_UNAVAILABLE(macos); ///----------------------------------------------- /// @name Setting Download Task Delegate Callbacks @@ -428,7 +434,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:totalBytesWritten:totalBytesExpectedToWrite:`. + Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData: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. */ @@ -467,6 +473,11 @@ FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; */ FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; +/** + Posted when a session download task finished moving the temporary download file to a specified destination successfully. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidMoveFileSuccessfullyNotification; + /** Posted when a session download task encountered an error when moving the temporary download file to a specified destination. */ @@ -497,4 +508,9 @@ 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 diff --git a/AFNetworking/AFURLSessionManager.m b/AFNetworking/AFURLSessionManager.m index 2475595d77..c8b6810ef5 100644 --- a/AFNetworking/AFURLSessionManager.m +++ b/AFNetworking/AFURLSessionManager.m @@ -22,33 +22,6 @@ #import "AFURLSessionManager.h" #import -#ifndef NSFoundationVersionNumber_iOS_8_0 -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug 1140.11 -#else -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0 -#endif - -static dispatch_queue_t url_session_manager_creation_queue() { - static dispatch_queue_t af_url_session_manager_creation_queue; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - af_url_session_manager_creation_queue = dispatch_queue_create("com.alamofire.networking.session.manager.creation", DISPATCH_QUEUE_SERIAL); - }); - - return af_url_session_manager_creation_queue; -} - -static void url_session_manager_create_task_safely(dispatch_block_t block) { - if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) { - // Fix of bug - // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8) - // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093 - dispatch_sync(url_session_manager_creation_queue(), block); - } else { - block(); - } -} - static dispatch_queue_t url_session_manager_processing_queue() { static dispatch_queue_t af_url_session_manager_processing_queue; static dispatch_once_t onceToken; @@ -73,6 +46,7 @@ static dispatch_group_t url_session_manager_completion_group() { NSString * const AFNetworkingTaskDidCompleteNotification = @"com.alamofire.networking.task.complete"; NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networking.task.suspend"; NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate"; +NSString * const AFURLSessionDownloadTaskDidMoveFileSuccessfullyNotification = @"com.alamofire.networking.session.download.file-manager-succeed"; NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error"; NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; @@ -80,21 +54,24 @@ static dispatch_group_t url_session_manager_completion_group() { 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"; -static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; - typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); typedef NSURLRequest * (^AFURLSessionTaskWillPerformHTTPRedirectionBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request); typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionTaskDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); +typedef id (^AFURLSessionTaskAuthenticationChallengeBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential)); typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSession *session); 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) AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)); +#endif typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response); typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask); @@ -108,7 +85,6 @@ static dispatch_group_t url_session_manager_completion_group() { typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); - #pragma mark - @interface AFURLSessionManagerTaskDelegate : NSObject @@ -118,6 +94,9 @@ - (instancetype)initWithTask:(NSURLSessionTask *)task; @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 AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)); +#endif @property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; @property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock; @property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock; @@ -148,11 +127,17 @@ - (instancetype)initWithTask:(NSURLSessionTask *)task { progress.pausingHandler = ^{ [weakTask suspend]; }; - if ([progress respondsToSelector:@selector(setResumingHandler:)]) { +#if AF_CAN_USE_AT_AVAILABLE + if (@available(macOS 10.11, *)) +#else + if ([progress respondsToSelector:@selector(setResumingHandler:)]) +#endif + { progress.resumingHandler = ^{ [weakTask resume]; }; } + [progress addObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted)) options:NSKeyValueObservingOptionNew @@ -181,17 +166,20 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N } } +static const void * const AuthenticationChallengeErrorKey = &AuthenticationChallengeErrorKey; + #pragma mark - NSURLSessionTaskDelegate - (void)URLSession:(__unused NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { + error = objc_getAssociatedObject(task, AuthenticationChallengeErrorKey) ?: error; __strong AFURLSessionManager *manager = self.manager; __block id responseObject = nil; - __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; //Performance Improvement from #2672 @@ -202,6 +190,14 @@ - (void)URLSession:(__unused NSURLSession *)session 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) { @@ -250,6 +246,14 @@ - (void)URLSession:(__unused NSURLSession *)session } } +#if AF_CAN_INCLUDE_SESSION_TASK_METRICS +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)) { + self.sessionTaskMetrics = metrics; +} +#endif + #pragma mark - NSURLSessionDataDelegate - (void)URLSession:(__unused NSURLSession *)session @@ -303,6 +307,8 @@ - (void)URLSession:(NSURLSession *)session if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]) { [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo]; + } else { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidMoveFileSuccessfullyNotification object:downloadTask userInfo:nil]; } } } @@ -374,7 +380,7 @@ + (void)load { 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]; @@ -448,12 +454,15 @@ @interface AFURLSessionManager () @property (readwrite, nonatomic, strong) NSLock *lock; @property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid; @property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge; -@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession; +@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession AF_API_UNAVAILABLE(macos); @property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection; -@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge; +@property (readwrite, nonatomic, copy) AFURLSessionTaskAuthenticationChallengeBlock authenticationChallengeHandler; @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 AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)); +#endif @property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse; @property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask; @property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData; @@ -484,8 +493,6 @@ - (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)config 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]; @@ -522,6 +529,19 @@ - (void)dealloc { #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]; } @@ -677,12 +697,15 @@ - (NSArray *)downloadTasks { #pragma mark - -- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession { if (cancelPendingTasks) { [self.session invalidateAndCancel]; } else { [self.session finishTasksAndInvalidate]; } + if (resetSession) { + self.session = nil; + } } #pragma mark - @@ -706,21 +729,12 @@ - (void)removeNotificationObserverForTask:(NSURLSessionTask *)task { #pragma mark - -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler]; -} - - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler { - __block NSURLSessionDataTask *dataTask = nil; - url_session_manager_create_task_safely(^{ - dataTask = [self.session dataTaskWithRequest:request]; - }); + NSURLSessionDataTask *dataTask = [self.session dataTaskWithRequest:request]; [self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler]; @@ -734,20 +748,14 @@ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler { - __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]; - } + NSURLSessionUploadTask *uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; + + if (uploadTask) { + [self addDelegateForUploadTask:uploadTask + progress:uploadProgressBlock + completionHandler:completionHandler]; } - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; - return uploadTask; } @@ -756,11 +764,8 @@ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler { - __block NSURLSessionUploadTask *uploadTask = nil; - url_session_manager_create_task_safely(^{ - uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; - }); - + NSURLSessionUploadTask *uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; + [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; return uploadTask; @@ -770,10 +775,7 @@ - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)reques progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler { - __block NSURLSessionUploadTask *uploadTask = nil; - url_session_manager_create_task_safely(^{ - uploadTask = [self.session uploadTaskWithStreamedRequest:request]; - }); + NSURLSessionUploadTask *uploadTask = [self.session uploadTaskWithStreamedRequest:request]; [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; @@ -787,11 +789,8 @@ - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler { - __block NSURLSessionDownloadTask *downloadTask = nil; - url_session_manager_create_task_safely(^{ - downloadTask = [self.session downloadTaskWithRequest:request]; - }); - + NSURLSessionDownloadTask *downloadTask = [self.session downloadTaskWithRequest:request]; + [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; return downloadTask; @@ -802,10 +801,7 @@ - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler { - __block NSURLSessionDownloadTask *downloadTask = nil; - url_session_manager_create_task_safely(^{ - downloadTask = [self.session downloadTaskWithResumeData:resumeData]; - }); + NSURLSessionDownloadTask *downloadTask = [self.session downloadTaskWithResumeData:resumeData]; [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; @@ -831,9 +827,11 @@ - (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChalle self.sessionDidReceiveAuthenticationChallenge = block; } +#if !TARGET_OS_OSX - (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block { self.didFinishEventsForBackgroundURLSession = block; } +#endif #pragma mark - @@ -845,10 +843,6 @@ - (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession self.taskWillPerformHTTPRedirection = block; } -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { - self.taskDidReceiveAuthenticationChallenge = block; -} - - (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block { self.taskDidSendBodyData = block; } @@ -857,6 +851,12 @@ - (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTas self.taskDidComplete = block; } +#if AF_CAN_INCLUDE_SESSION_TASK_METRICS +- (void)setTaskDidFinishCollectingMetricsBlock:(void (^)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLSessionTaskMetrics * _Nullable))block AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)) { + self.taskDidFinishCollectingMetrics = block; +} +#endif + #pragma mark - - (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block { @@ -896,15 +896,20 @@ - (NSString *)description { } - (BOOL)respondsToSelector:(SEL)selector { - if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) { + if (selector == @selector(URLSession:didReceiveChallenge:completionHandler:)) { + return self.sessionDidReceiveAuthenticationChallenge != nil; + } else if (selector == @selector(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:)) { return self.taskWillPerformHTTPRedirection != nil; } else if (selector == @selector(URLSession:dataTask:didReceiveResponse:completionHandler:)) { return self.dataTaskDidReceiveResponse != nil; } else if (selector == @selector(URLSession:dataTask:willCacheResponse:completionHandler:)) { return self.dataTaskWillCacheResponse != nil; - } else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) { + } +#if !TARGET_OS_OSX + else if (selector == @selector(URLSessionDidFinishEventsForBackgroundURLSession:)) { return self.didFinishEventsForBackgroundURLSession != nil; } +#endif return [[self class] instancesRespondToSelector:selector]; } @@ -925,27 +930,10 @@ - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { - NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; - __block NSURLCredential *credential = nil; + NSAssert(self.sessionDidReceiveAuthenticationChallenge != nil, @"`respondsToSelector:` implementation forces `URLSession:didReceiveChallenge:completionHandler:` to be called only if `self.sessionDidReceiveAuthenticationChallenge` is not nil"); - if (self.sessionDidReceiveAuthenticationChallenge) { - disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential); - } else { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { - credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - if (credential) { - disposition = NSURLSessionAuthChallengeUseCredential; - } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } - } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; - } - } + NSURLCredential *credential = nil; + NSURLSessionAuthChallengeDisposition disposition = self.sessionDidReceiveAuthenticationChallenge(session, challenge, &credential); if (completionHandler) { completionHandler(disposition, credential); @@ -976,21 +964,40 @@ - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { + BOOL evaluateServerTrust = NO; NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling; - __block NSURLCredential *credential = nil; + NSURLCredential *credential = nil; - if (self.taskDidReceiveAuthenticationChallenge) { - disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential); + if (self.authenticationChallengeHandler) { + id result = self.authenticationChallengeHandler(session, task, challenge, completionHandler); + if (result == nil) { + return; + } else if ([result isKindOfClass:NSError.class]) { + objc_setAssociatedObject(task, AuthenticationChallengeErrorKey, result, OBJC_ASSOCIATION_RETAIN); + disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; + } else if ([result isKindOfClass:NSURLCredential.class]) { + credential = result; + disposition = NSURLSessionAuthChallengeUseCredential; + } else if ([result isKindOfClass:NSNumber.class]) { + disposition = [result integerValue]; + NSAssert(disposition == NSURLSessionAuthChallengePerformDefaultHandling || disposition == NSURLSessionAuthChallengeCancelAuthenticationChallenge || disposition == NSURLSessionAuthChallengeRejectProtectionSpace, @""); + evaluateServerTrust = disposition == NSURLSessionAuthChallengePerformDefaultHandling && [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; + } else { + @throw [NSException exceptionWithName:@"Invalid Return Value" reason:@"The return value from the authentication challenge handler must be nil, an NSError, an NSURLCredential or an NSNumber." userInfo:nil]; + } } else { - if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { - if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { - disposition = NSURLSessionAuthChallengeUseCredential; - credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; - } else { - disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; - } + evaluateServerTrust = [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; + } + + if (evaluateServerTrust) { + if ([self.securityPolicy evaluateServerTrust:challenge.protectionSpace.serverTrust forDomain:challenge.protectionSpace.host]) { + disposition = NSURLSessionAuthChallengeUseCredential; + credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; } else { - disposition = NSURLSessionAuthChallengePerformDefaultHandling; + objc_setAssociatedObject(task, AuthenticationChallengeErrorKey, + [self serverTrustErrorForServerTrust:challenge.protectionSpace.serverTrust url:task.currentRequest.URL], + OBJC_ASSOCIATION_RETAIN); + disposition = NSURLSessionAuthChallengeCancelAuthenticationChallenge; } } @@ -999,6 +1006,31 @@ - (void)URLSession:(NSURLSession *)session } } +- (nonnull NSError *)serverTrustErrorForServerTrust:(nullable SecTrustRef)serverTrust url:(nullable NSURL *)url +{ + NSBundle *CFNetworkBundle = [NSBundle bundleWithIdentifier:@"com.apple.CFNetwork"]; + NSString *defaultValue = @"The certificate for this server is invalid. You might be connecting to a server that is pretending to be “%@” which could put your confidential information at risk."; + NSString *descriptionFormat = NSLocalizedStringWithDefaultValue(@"Err-1202.w", nil, CFNetworkBundle, defaultValue, @"") ?: defaultValue; + NSString *localizedDescription = [descriptionFormat componentsSeparatedByString:@"%@"].count <= 2 ? [NSString localizedStringWithFormat:descriptionFormat, url.host] : descriptionFormat; + NSMutableDictionary *userInfo = [@{ + NSLocalizedDescriptionKey: localizedDescription + } mutableCopy]; + + if (serverTrust) { + userInfo[NSURLErrorFailingURLPeerTrustErrorKey] = (__bridge id)serverTrust; + } + + if (url) { + userInfo[NSURLErrorFailingURLErrorKey] = url; + + if (url.absoluteString) { + userInfo[NSURLErrorFailingURLStringErrorKey] = url.absoluteString; + } + } + + return [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorServerCertificateUntrusted userInfo:userInfo]; +} + - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler @@ -1024,9 +1056,9 @@ - (void)URLSession:(NSURLSession *)session { 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]; } } @@ -1060,6 +1092,23 @@ - (void)URLSession:(NSURLSession *)session } } +#if AF_CAN_INCLUDE_SESSION_TASK_METRICS +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task +didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics AF_API_AVAILABLE(ios(10), macosx(10.12), watchos(3), tvos(10)) +{ + 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 @@ -1122,6 +1171,7 @@ - (void)URLSession:(NSURLSession *)session } } +#if !TARGET_OS_OSX - (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session { if (self.didFinishEventsForBackgroundURLSession) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -1129,6 +1179,7 @@ - (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session }); } } +#endif #pragma mark - NSURLSessionDownloadDelegate @@ -1145,6 +1196,8 @@ - (void)URLSession:(NSURLSession *)session if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]) { [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo]; + } else { + [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidMoveFileSuccessfullyNotification object:downloadTask userInfo:nil]; } return; diff --git a/CHANGELOG.md b/CHANGELOG.md index fa18294b1f..f28635b35b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,207 @@ -#Change Log +# Change Log All notable changes to this project will be documented in this file. -`AFNetworking` adheres to [Semantic Versioning](http://semver.org/). +`AFNetworking` adheres to [Semantic Versioning](https://semver.org/). --- +## [4.0.1](https://github.com/AFNetworking/AFNetworking/releases/tag/4.0.1) (04/19/2020) +Release on Sunday, April 19, 2020. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/milestone/20?closed=1). + +#### Updated +* Project templates and integrations. + * Implemented by Kaspik in [#4531](https://github.com/AFNetworking/AFNetworking/pull/4531). +* Various CocoaPods podspec settings. + * Implemented by ElfSundae in [#4528](https://github.com/AFNetworking/AFNetworking/pull/4528), [#4532](https://github.com/AFNetworking/AFNetworking/pull/4532), and [#4533](https://github.com/AFNetworking/AFNetworking/pull/4533). + +#### Fixed +* Crash during authentication delegate method. + * Implemented by Kaspik, ElfSundae, and jshier in [#4542](https://github.com/AFNetworking/AFNetworking/pull/4542), [#4552](https://github.com/AFNetworking/AFNetworking/pull/4552), and [#4553](https://github.com/AFNetworking/AFNetworking/pull/4553). +* SPM integration. + * Implemented by jshier in [#4554](https://github.com/AFNetworking/AFNetworking/pull/4554). +* Improper update instead of replacement of header values. + * Implemented by ElfSundae in [#4550](https://github.com/AFNetworking/AFNetworking/pull/4550). +* Nullability of some methods. + * Implemented by ElfSundae in [#4551](https://github.com/AFNetworking/AFNetworking/pull/4551). +* Typos in CHANGELOG. + * Implemented by ElfSundae in [#4537](https://github.com/AFNetworking/AFNetworking/pull/4537). +* Missing tvOS compatibility for some methods. + * Implemented by ElfSundae in [#4536](https://github.com/AFNetworking/AFNetworking/pull/4536). +* Missing `FOUNDATION_EXPORT` for `AFJSONObjectByRemovingKeysWithNullValues`. + * Implemented by ElfSundae in [#4529](https://github.com/AFNetworking/AFNetworking/pull/4529). + +#### Removed +* Unused UIImage+AFNetworking.h file. + * Implemented by ElfSundae in [#4535](https://github.com/AFNetworking/AFNetworking/pull/4535). + +## [4.0.0](https://github.com/AFNetworking/AFNetworking/releases/tag/4.0.0) (03/29/2020) +Released on Sunday, March 29, 2020. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/milestone/16?closed=1). + +#### Added +* Notificate when a downloaded file has been moved successfully. + * Implemented by xingheng in [#4393](https://github.com/AFNetworking/AFNetworking/pull/4393). +* Specific error for certificate pinning failure. + * Implemented by 0xced in [#3425](https://github.com/AFNetworking/AFNetworking/pull/3425). +* `WKWebView` extensions. + * Implemented by tjanela in [#4439](https://github.com/AFNetworking/AFNetworking/pull/4439). +* Automatic location of certificates in the main bundle for certificate pinning. + * Implemented by 0xced in [#3752](https://github.com/AFNetworking/AFNetworking/pull/3752). +* User-Agent support for tvOS. + * Implemented by ghking in [#4014](https://github.com/AFNetworking/AFNetworking/pull/4014). +* Ability for `AFHTTPSessionManager` to recreate its underlying `NSURLSession`. + * Implemented by Kaspik in [#4256](https://github.com/AFNetworking/AFNetworking/pull/4256). +* Ability to set HTTP headers per request. + * Implemented by stnslw in [#4113](https://github.com/AFNetworking/AFNetworking/pull/4113). +* Ability to capture `NSURLSessionTaskMetrics`. + * Implemented by Caelink in [#4237](https://github.com/AFNetworking/AFNetworking/pull/4237). + +#### Updated +* `dataTaskWithHTTPMethod` to be public. + * Implemented by smartinspereira in [#4007](https://github.com/AFNetworking/AFNetworking/pull/4007). +* Reachability notification to include the instance which issued the notification. + * Implemented by LMsgSendNilSelf in [#4051](https://github.com/AFNetworking/AFNetworking/pull/4051). +* `AFJSONObjectByRemovingKeysWithNullValues` to be public. + * Implemented by ashfurrow in [#4051](https://github.com/AFNetworking/AFNetworking/pull/4051). +* `AFJSONObjectByRemovingKeysWithNullValues` to remove `NSNull` values from `NSArray`s. + * Implemented by ashfurrow in [#4052](https://github.com/AFNetworking/AFNetworking/pull/4052). + +#### Changed +* Automated CI to GitHub Actions. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). + +#### Fixed +* Explicit `NSSecureCoding` support. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). +* Deprecated API usage on Catalyst. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). +* Nullability annotations. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). +* `AFImageDownloader` to more accurately cancel downloads. + * Implemented by kinarobin in [#4407](https://github.com/AFNetworking/AFNetworking/pull/4407). +* Double KVO notifications in `AFNetworkActivityManager`. + * Implemented by kinarobin in [#4406](https://github.com/AFNetworking/AFNetworking/pull/4406). +* Availability annotations around `NSURLSessionTaskMetrics`. + * Implemented by ElfSundae in [#4516](https://github.com/AFNetworking/AFNetworking/pull/4516). +* Issues with `associated_object` and subclasses. + * Implemented by welcommand in [#3872](https://github.com/AFNetworking/AFNetworking/pull/3872). +* Memory leak in example application. + * Implemented by svoit in [#4196](https://github.com/AFNetworking/AFNetworking/pull/4196). +* Crashes in multithreaded scenarios and `dispatch_barrier`. + * Implemented by streeter in [#4474](https://github.com/AFNetworking/AFNetworking/pull/4474). +* Issues with `NSSecureCoding`. + * Implemented by ElfSudae in [#4409](https://github.com/AFNetworking/AFNetworking/pull/4409). +* Code style issues. + * Implemented by svoit in [#4200](https://github.com/AFNetworking/AFNetworking/pull/4200). +* Race condition in `AFImageDownloader`. + * Implemented by bbeversdorf in [#4246](https://github.com/AFNetworking/AFNetworking/pull/4246). +* Coding style issues. + * Implemented by LeeHongHwa in [#4002](https://github.com/AFNetworking/AFNetworking/pull/4002). + +#### Removed +* Support for iOS < 9, macOS < 10.10. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). +* All previously deprecated APIs. + * Implemented by jshier in [#4523](https://github.com/AFNetworking/AFNetworking/pull/4523). +* Unnecessary `__block` capture. + * Implemented by kinarobin in [#4526](https://github.com/AFNetworking/AFNetworking/pull/4526). +* Workaround for `NSURLSessionUploadTask` creation on iOS 7. + * Implemented by kinarobin in [#4525](https://github.com/AFNetworking/AFNetworking/pull/4525). +* Workaround for safe `NSURLSessionTask` creation on iOS < 8. + * Implemented by kinarobin in [#4401](https://github.com/AFNetworking/AFNetworking/pull/4401). +* `UIWebView` extensions. + * Implemented by tjanela in [#4439](https://github.com/AFNetworking/AFNetworking/pull/4439). + +--- + +## [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). @@ -173,7 +371,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 @@ -183,7 +381,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 @@ -225,10 +423,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. @@ -253,7 +451,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. @@ -280,7 +478,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. @@ -290,7 +488,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`. @@ -306,7 +504,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 @@ -319,11 +517,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). @@ -1065,7 +1263,7 @@ calls (Mindaugas Vaičiūnas) * Update files to remove executable privilege (Kyle Fuller) -## 2.0.1 (2013-10-10) +## [2.0.1](https://github.com/AFNetworking/AFNetworking/releases/tag/2.0.1) (2013-10-10) * Fix iOS 6 compatibility (Matt Baker, Mattt Thompson) @@ -1769,7 +1967,7 @@ Steven Fisher) renamed to `numberOfFinishedOperations` (Mattt Thompson) -## 0.10.0 / 2012-06-26 +## [0.10.0](https://github.com/AFNetworking/AFNetworking/releases/tag/0.10.0) / 2012-06-26 * Add Twitter Mac Example application (Mattt Thompson) @@ -1834,7 +2032,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 / 2012-04-25 +## [1.0RC1](https://github.com/AFNetworking/AFNetworking/releases/tag/1.0RC1) / 2012-04-25 * Add `AFHTTPRequestOperation +addAcceptableStatusCodes / +addAcceptableContentTypes` to dynamically add acceptable status codes and @@ -1854,7 +2052,7 @@ Mattt Thompson) distinction between WWan and WiFi reachability (Kevin Harwood, Mattt Thompson) -## 0.9.2 / 2012-04-25 +## [0.9.2](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.2) / 2012-04-25 * Add thread safety to `AFNetworkActivityIndicator` (Peter Steinberger, Mattt Thompson) @@ -1899,7 +2097,7 @@ Mattt Thompson) * Remove @try-@catch block wrapping network thread entry point (Charles T. Ahn) -## 0.9.1 / 2012-03-19 +## [0.9.1](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.1) / 2012-03-19 * Create Twitter example application (Mattt Thompson) @@ -1957,7 +2155,7 @@ where % is used as a literal rather than as part of a percent escape code `AFImageRequestOperation` (Michael Schneider) -## 0.9.0 / 2012-01-23 +## [0.9.0](https://github.com/AFNetworking/AFNetworking/releases/tag/0.9.0) / 2012-01-23 * Add thread-safe behavior to `AFURLConnectionOperation` (Mattt Thompson) diff --git a/CONTRIBUTING_CH.md b/CONTRIBUTING_CH.md new file mode 100644 index 0000000000..165da75a47 --- /dev/null +++ b/CONTRIBUTING_CH.md @@ -0,0 +1,97 @@ +# 贡献指南 +本文档包含有关为此项目做出贡献的信息和指南。 +请在开始参加之前阅读。 + +**主题** + +* [提问](#提问) +* [报告安全问题](#报告安全问题) +* [报告其他问题](#报告其他问题) +* [提交拉取请求](#提交拉取请求) +* [开发人员原产地证书](#开发人员原产地证书-1.1) +* [行为守则](#行为守则) + +## 提问 + +我们不使用GitHub的论坛发表问题 +对于任何非特定于项目本身的使用问题, +请直接在[Stack Overflow](https://stackoverflow.com)上询问。 +通过此方法,你可以快速解决您的问题, +并且任何有相同问题的人可以找到答案。 +这也使维护人员能够专注于为其他人改进项目。 + +## 报告安全问题 + +Alamofire Software Foundation 认真对待安全问题。 +如果您发现任何关于安全的问题,请立即通知我们! + +请**不要**公然公开发布问题, +而是将您的问题私下发送到。 +这将有于帮助确保发现的任何漏洞 +可以[披露制度](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) 社区. +我们表彰和感激他们为促进项目合作所做的付出。* diff --git a/Example/AFNetworking Example.xcodeproj/project.pbxproj b/Example/AFNetworking Example.xcodeproj/project.pbxproj index 3e883ca87f..65b44131f8 100644 --- a/Example/AFNetworking Example.xcodeproj/project.pbxproj +++ b/Example/AFNetworking Example.xcodeproj/project.pbxproj @@ -38,7 +38,7 @@ 29E6F1E91BB9E37200A4466C /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29E6F1E81BB9E37200A4466C /* NotificationCenter.framework */; }; 29E6F1ED1BB9E37200A4466C /* TodayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1EC1BB9E37200A4466C /* TodayViewController.m */; }; 29E6F1F01BB9E37200A4466C /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29E6F1EE1BB9E37200A4466C /* MainInterface.storyboard */; }; - 29E6F1F41BB9E37200A4466C /* Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 29E6F1F41BB9E37200A4466C /* iOS Today Extension Example.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 29E6F1F91BB9E56200A4466C /* Post.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19A1BB9DD7300A4466C /* Post.m */; }; 29E6F1FA1BB9E56500A4466C /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19C1BB9DD7300A4466C /* User.m */; }; C2BFE0251C11870800BB258D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2BFE0241C11870800BB258D /* AppDelegate.m */; }; @@ -87,7 +87,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( - 29E6F1F41BB9E37200A4466C /* Today Extension Example.appex in Embed App Extensions */, + 29E6F1F41BB9E37200A4466C /* iOS Today Extension Example.appex in Embed App Extensions */, ); name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; @@ -108,7 +108,7 @@ /* Begin PBXFileReference section */ 291BFDB91BB9E85400FFB029 /* watchOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "watchOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "watchOS Example Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; - 291BFDE71BB9E8C700FFB029 /* OS X Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OS X Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 291BFDE71BB9E8C700FFB029 /* macOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "macOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 291BFDED1BB9E8C700FFB029 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 291BFDF21BB9E8C700FFB029 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 291BFDF71BB9E8C700FFB029 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -137,7 +137,7 @@ 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAppDotNetAPIClient.m; sourceTree = ""; }; 29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29E6F1E01BB9E03600A4466C /* Launchscreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Launchscreen.storyboard; path = "iOS Example/Launchscreen.storyboard"; sourceTree = SOURCE_ROOT; }; - 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Today Extension Example.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "iOS Today Extension Example.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 29E6F1E81BB9E37200A4466C /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; 29E6F1EB1BB9E37200A4466C /* TodayViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TodayViewController.h; sourceTree = ""; }; 29E6F1EC1BB9E37200A4466C /* TodayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TodayViewController.m; sourceTree = ""; }; @@ -205,7 +205,7 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 291BFDE81BB9E8C700FFB029 /* OS X Example */ = { + 291BFDE81BB9E8C700FFB029 /* macOS Example */ = { isa = PBXGroup; children = ( C2BFE0231C11870800BB258D /* AppDelegate.h */, @@ -215,7 +215,7 @@ 291BFDF71BB9E8C700FFB029 /* Info.plist */, 291BFDEC1BB9E8C700FFB029 /* Supporting Files */, ); - path = "OS X Example"; + path = "macOS Example"; sourceTree = ""; }; 291BFDEC1BB9E8C700FFB029 /* Supporting Files */ = { @@ -267,7 +267,7 @@ 29E6F1EA1BB9E37200A4466C /* Today Extension Example */, 29E6F20F1BB9E76A00A4466C /* watchOS Example */, 29E6F21E1BB9E76A00A4466C /* watchOS Example Extension */, - 291BFDE81BB9E8C700FFB029 /* OS X Example */, + 291BFDE81BB9E8C700FFB029 /* macOS Example */, 291BFE161BB9ECEE00FFB029 /* tvOS Example */, 29E6F1E71BB9E37200A4466C /* Frameworks */, 29E6F1761BB9DCB500A4466C /* Products */, @@ -281,10 +281,10 @@ isa = PBXGroup; children = ( 29E6F1751BB9DCB500A4466C /* iOS Example.app */, - 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */, + 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */, 291BFDB91BB9E85400FFB029 /* watchOS Example.app */, 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */, - 291BFDE71BB9E8C700FFB029 /* OS X Example.app */, + 291BFDE71BB9E8C700FFB029 /* macOS Example.app */, 291BFE151BB9ECEE00FFB029 /* tvOS Example.app */, ); name = Products; @@ -422,9 +422,9 @@ productReference = 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */; productType = "com.apple.product-type.watchkit2-extension"; }; - 291BFDE61BB9E8C700FFB029 /* OS X Example */ = { + 291BFDE61BB9E8C700FFB029 /* macOS Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */; + buildConfigurationList = 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */; buildPhases = ( 291BFDE31BB9E8C700FFB029 /* Sources */, 291BFDE41BB9E8C700FFB029 /* Frameworks */, @@ -434,9 +434,9 @@ ); dependencies = ( ); - name = "OS X Example"; + name = "macOS Example"; productName = "OS X Example"; - productReference = 291BFDE71BB9E8C700FFB029 /* OS X Example.app */; + productReference = 291BFDE71BB9E8C700FFB029 /* macOS Example.app */; productType = "com.apple.product-type.application"; }; 291BFE141BB9ECEE00FFB029 /* tvOS Example */ = { @@ -477,9 +477,9 @@ productReference = 29E6F1751BB9DCB500A4466C /* iOS Example.app */; productType = "com.apple.product-type.application"; }; - 29E6F1E51BB9E37200A4466C /* Today Extension Example */ = { + 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */; + buildConfigurationList = 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */; buildPhases = ( 29E6F1E21BB9E37200A4466C /* Sources */, 29E6F1E31BB9E37200A4466C /* Frameworks */, @@ -489,9 +489,9 @@ ); dependencies = ( ); - name = "Today Extension Example"; + name = "iOS Today Extension Example"; productName = "Today Extension Example"; - productReference = 29E6F1E61BB9E37200A4466C /* Today Extension Example.appex */; + productReference = 29E6F1E61BB9E37200A4466C /* iOS Today Extension Example.appex */; productType = "com.apple.product-type.app-extension"; }; /* End PBXNativeTarget section */ @@ -500,7 +500,7 @@ 29E6F16B1BB9DA2E00A4466C /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0710; + LastUpgradeCheck = 1200; TargetAttributes = { 291BFDB81BB9E85400FFB029 = { CreatedOnToolsVersion = 7.1; @@ -525,7 +525,7 @@ }; buildConfigurationList = 29E6F16E1BB9DA2E00A4466C /* Build configuration list for PBXProject "AFNetworking Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -537,10 +537,10 @@ projectRoot = ""; targets = ( 29E6F1741BB9DCB500A4466C /* iOS Example */, - 29E6F1E51BB9E37200A4466C /* Today Extension Example */, + 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */, 291BFDB81BB9E85400FFB029 /* watchOS Example */, 291BFDC41BB9E85500FFB029 /* watchOS Example Extension */, - 291BFDE61BB9E8C700FFB029 /* OS X Example */, + 291BFDE61BB9E8C700FFB029 /* macOS Example */, 291BFE141BB9ECEE00FFB029 /* tvOS Example */, ); }; @@ -668,7 +668,7 @@ }; 29E6F1F31BB9E37200A4466C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 29E6F1E51BB9E37200A4466C /* Today Extension Example */; + target = 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */; targetProxy = 29E6F1F21BB9E37200A4466C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -709,6 +709,7 @@ 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; @@ -757,6 +758,7 @@ 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; @@ -800,6 +802,7 @@ 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; @@ -849,6 +852,7 @@ 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; @@ -892,6 +896,7 @@ 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; @@ -921,12 +926,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "OS X Example/Info.plist"; + INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -941,6 +946,7 @@ 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; @@ -964,11 +970,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = "OS X Example/Info.plist"; + INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -984,6 +990,7 @@ 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; @@ -1020,7 +1027,7 @@ SDKROOT = appletvos; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1036,6 +1043,7 @@ 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; @@ -1064,7 +1072,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; @@ -1074,12 +1082,68 @@ 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + 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; }; @@ -1092,6 +1156,7 @@ 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; @@ -1103,6 +1168,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1121,7 +1187,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "$(PROJECT_DIR)/iOS Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1140,6 +1206,7 @@ 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; @@ -1151,6 +1218,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1163,7 +1231,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "$(PROJECT_DIR)/iOS Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.iOS-Example"; @@ -1181,6 +1249,7 @@ 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; @@ -1229,6 +1298,7 @@ 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; @@ -1284,7 +1354,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "OS X Example" */ = { + 291BFDF81BB9E8C700FFB029 /* Build configuration list for PBXNativeTarget "macOS Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 291BFDF91BB9E8C700FFB029 /* Debug */, @@ -1320,7 +1390,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "Today Extension Example" */ = { + 29E6F1F51BB9E37200A4466C /* Build configuration list for PBXNativeTarget "iOS Today Extension Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 29E6F1F61BB9E37200A4466C /* Debug */, diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme index 93b6407941..58d9b02931 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -1,6 +1,6 @@ - - + shouldUseLaunchSchemeArgsEnv = "YES" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES"> + + + + + + + + - - @@ -56,8 +56,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + + + + + - - @@ -29,8 +29,8 @@ @@ -41,24 +41,34 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + + + + + + + diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme index 86c8714f62..4421acd8d7 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/tvOS Example.xcscheme @@ -1,6 +1,6 @@ - - - - + + + + + + + + - - - - + + - - - - - + - + + + - - - - - + - + diff --git a/Example/AFNetworking tvOS Example.xcodeproj/project.pbxproj b/Example/AFNetworking tvOS Example.xcodeproj/project.pbxproj index bb24710065..a2ecb47cb1 100644 --- a/Example/AFNetworking tvOS Example.xcodeproj/project.pbxproj +++ b/Example/AFNetworking tvOS Example.xcodeproj/project.pbxproj @@ -237,6 +237,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -390,6 +391,7 @@ 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; }; @@ -405,6 +407,7 @@ 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; }; diff --git a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Assets.xcassets/AppIcon.appiconset/Contents.json index 1b34a14fad..327aae2ab6 100644 --- a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -2,79 +2,110 @@ "images" : [ { "idiom" : "iphone", - "size" : "29x29", "scale" : "2x", - "filename" : "Icon-Small@2x.png" + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", "scale" : "3x", - "filename" : "Icon-Small@3x.png" + "size" : "20x20" }, { + "filename" : "Icon-Small@2x.png", "idiom" : "iphone", - "size" : "40x40", "scale" : "2x", - "filename" : "Icon-40@2x.png" + "size" : "29x29" }, { + "filename" : "Icon-Small@3x.png", "idiom" : "iphone", - "size" : "40x40", "scale" : "3x", - "filename" : "Icon-40@3x.png" + "size" : "29x29" }, { + "filename" : "Icon-40@2x.png", "idiom" : "iphone", - "size" : "60x60", "scale" : "2x", - "filename" : "Icon-60@2x.png" + "size" : "40x40" }, { + "filename" : "Icon-40@3x.png", "idiom" : "iphone", - "size" : "60x60", "scale" : "3x", - "filename" : "Icon-60@3x.png" + "size" : "40x40" + }, + { + "filename" : "Icon-60@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "Icon-60@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" }, { "idiom" : "ipad", - "size" : "29x29", "scale" : "1x", - "filename" : "Icon-Small.png" + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "29x29", "scale" : "2x", - "filename" : "Icon-Small@2x.png" + "size" : "20x20" }, { + "filename" : "Icon-Small.png", "idiom" : "ipad", - "size" : "40x40", "scale" : "1x", - "filename" : "Icon-40.png" + "size" : "29x29" }, { + "filename" : "Icon-Small@2x.png", "idiom" : "ipad", - "size" : "40x40", "scale" : "2x", - "filename" : "Icon-40@2x.png" + "size" : "29x29" }, { + "filename" : "Icon-40.png", "idiom" : "ipad", - "size" : "76x76", "scale" : "1x", - "filename" : "Icon-76.png" + "size" : "40x40" }, { + "filename" : "Icon-40@2x.png", "idiom" : "ipad", - "size" : "76x76", "scale" : "2x", - "filename" : "Icon-76@2x.png" + "size" : "40x40" + }, + { + "filename" : "Icon-76.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "Icon-76@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "Icon-1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "makeappicon" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Example/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Example/Assets.xcassets/AppIcon.appiconset/Icon-1024.png new file mode 100644 index 0000000000..635f6d61b2 Binary files /dev/null and b/Example/Assets.xcassets/AppIcon.appiconset/Icon-1024.png differ diff --git a/Example/Classes/Models/Post.m b/Example/Classes/Models/Post.m index 33d7e80d6e..d922f3ff90 100644 --- a/Example/Classes/Models/Post.m +++ b/Example/Classes/Models/Post.m @@ -44,7 +44,7 @@ - (instancetype)initWithAttributes:(NSDictionary *)attributes { #pragma mark - + (NSURLSessionDataTask *)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block { - return [[AFAppDotNetAPIClient sharedClient] GET:@"stream/0/posts/stream/global" parameters:nil progress:nil success:^(NSURLSessionDataTask * __unused task, id JSON) { + return [[AFAppDotNetAPIClient sharedClient] GET:@"stream/0/posts/stream/global" parameters:nil headers: nil progress:nil success:^(NSURLSessionDataTask * __unused task, id JSON) { NSArray *postsFromResponse = [JSON valueForKeyPath:@"data"]; NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[postsFromResponse count]]; for (NSDictionary *attributes in postsFromResponse) { diff --git a/Example/Today Extension Example/TodayViewController.m b/Example/Today Extension Example/TodayViewController.m index 47b6a360a5..0aa96f8edc 100644 --- a/Example/Today Extension Example/TodayViewController.m +++ b/Example/Today Extension Example/TodayViewController.m @@ -50,7 +50,6 @@ - (void)viewWillAppear:(BOOL)animated { - (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler { [Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) { if (!error) { - self.post = posts.firstObject; [self savePost:self.post]; diff --git a/Example/iOS Example/Info.plist b/Example/iOS Example/Info.plist index 0d2fa5c44c..6343f948e2 100644 --- a/Example/iOS Example/Info.plist +++ b/Example/iOS Example/Info.plist @@ -32,7 +32,7 @@ CFBundleSignature ???? CFBundleVersion - 1.0.0 + $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/Example/OS X Example/AppDelegate.h b/Example/macOS Example/AppDelegate.h similarity index 100% rename from Example/OS X Example/AppDelegate.h rename to Example/macOS Example/AppDelegate.h diff --git a/Example/OS X Example/AppDelegate.m b/Example/macOS Example/AppDelegate.m similarity index 94% rename from Example/OS X Example/AppDelegate.m rename to Example/macOS Example/AppDelegate.m index ced2646ab0..d4658dbf87 100644 --- a/Example/OS X Example/AppDelegate.m +++ b/Example/macOS Example/AppDelegate.m @@ -46,8 +46,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification { self.postsArrayController.content = posts; }]; + __weak __typeof(self)weakSelf = self; [[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { - [self.tableView reloadData]; + __strong __typeof(weakSelf)strongSelf = weakSelf; + [strongSelf.tableView reloadData]; }]; } diff --git a/Example/OS X Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/macOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/OS X Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Example/macOS Example/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/OS X Example/Info.plist b/Example/macOS Example/Info.plist similarity index 100% rename from Example/OS X Example/Info.plist rename to Example/macOS Example/Info.plist diff --git a/Example/OS X Example/MainMenu.xib b/Example/macOS Example/MainMenu.xib similarity index 86% rename from Example/OS X Example/MainMenu.xib rename to Example/macOS Example/MainMenu.xib index 9ec30caa42..407b43c0e3 100644 --- a/Example/OS X Example/MainMenu.xib +++ b/Example/macOS Example/MainMenu.xib @@ -1,7 +1,9 @@ - - + + - + + + @@ -13,10 +15,10 @@ - - + + - + @@ -31,7 +33,7 @@ - + @@ -50,7 +52,7 @@ - + @@ -148,7 +150,7 @@ - + @@ -158,33 +160,32 @@ - - + + - - + + - + - + - + - - + + - + - @@ -192,11 +193,11 @@ - + - + @@ -221,14 +222,12 @@ - + - - - + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad mi. @@ -239,15 +238,14 @@ - - + - - - + + + @@ -261,25 +259,25 @@ - -