Compare commits

..

501 Commits
2974 ... master

Author SHA1 Message Date
WELCommand
555385d2b8 Fix associated object bug in UIKit extensions (#3872) 2020-01-04 19:34:04 -05:00
Cédric Luthi
2da270be61 Search for default pinned certificates in the main bundle (#3752)
Using `[NSBundle bundleForClass:[self class]]` is dangerous because the code will behave differently depending on how AFNetworking is integrated.

* If it is integrated as a static library (for example using CocoaPods), certificates will be searched in the main bundle.

* If it is integrated as a framework (for example using Carthage), certificates will be searched in the AFNetworking framework.

Even though this behavior is documented, this is dangerous. Using the main bundle makes the behavior deterministic.

Fixes #3575
2020-01-04 19:26:41 -05:00
svoit
0fba527112 Fix reference cycle in example, remove unnecessary weak / strong (#4196)
* Fixed memory leak issues

* Fixed memory leak issues

* Fixed crash
2020-01-04 19:19:31 -05:00
Bofei Zhu
4743faa83c Fix travis CI build (#4472)
* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* update fastlane settings

* nit

* fix tvos

* Update AFTestCase.m

* revert timeout

* Update AFUIWebViewTests.m

* Update .env.ios12_xcode10
2020-01-04 18:26:32 -05:00
Chris Streeter
eb9ce0e23d Use dispatch_barrier_sync (#4474)
This should hopefully avoid any problems where we attempt to write an
HTTP header to a deallocated header dictionary.

See https://github.com/AFNetworking/AFNetworking/pull/3891
See https://github.com/AFNetworking/AFNetworking/issues/3636
Modified from 32760e7a3a

Fixes #1391
2020-01-04 18:24:33 -05:00
Tiago Janela
5cf601ce0c Updated SSL Pinning Test Assets (#4463) 2019-10-26 18:34:47 -04:00
yehuanwen
006e896fbc Fix typeof (#3912) 2019-10-20 23:23:30 -04:00
Gavin King
9dcc6efd85 adding tvOS user agent information (#4014) 2019-10-20 23:02:35 -04:00
Jeff Kelley
2c2d2c3062 Update code coverage settings (#4201)
* Ignore coverage of test code.

* Add a second code coverage lane.

* Increase testing for code coverage.

* Fix the name of the Apple TV simulator.

* Delete .env.osx_10.10_xcode6

* Delete .env.osx_10.9_xcode6
2019-10-20 22:39:56 -04:00
Mars Lan
7383ffc61f Fix CHANGELOG Styling (#4460) 2019-10-20 22:00:32 -04:00
Elf Sundae
023cec7994 Fix NSSecureCoding (#4409)
* Fix type for decoding object

* Fix encoding numeric
2019-10-20 21:53:18 -04:00
Jeff Kelley
685e31a31b
Merge pull request #4365 from classdojo/cd-master
Fix podspec #trivial #important
2019-03-01 14:00:35 -05:00
Jakub Kaspar
b3c4a78aca Fix podspec as pod version supports iOS 8+ but podspec says iOS 7+ 2019-03-01 16:23:33 +01:00
Jeff Kelley
ee950948f2
Merge pull request #4200 from svoit/code_cleaning
Code cleaning
2019-02-09 13:18:38 -05:00
Jeff Kelley
9cc782931a
Merge pull request #4357 from AFNetworking/update-httpbin-certificates-april-2019
Update HTTPBin certificates in tests
2019-02-09 13:11:50 -05:00
Jeff Kelley
3517a1d23c Update HTTPBin certificates 2019-02-09 11:38:10 -05:00
Jeff Kelley
5890adc404
Merge pull request #4298 from AFNetworking/update-httpbin-certificates-december-2018
Update HTTPBin certificates, good through December 2018.
2018-10-14 10:20:46 -04:00
Jeff Kelley
ba4238910e Update HTTPBin certificates, good through December 2018. 2018-10-10 23:02:34 -04:00
svoit
d6db8307d9 Merge branch 'master' into code_cleaning
* master: (61 commits)
  Update Travis config for Xcode 10.
  Add test for object posting notification
  update README.md, the old "Foundation URL Loading System" link is 404
  Change test name to correct one
  Change default teardown methods to tests
  Update tests to use new API
  Update PR feedback, add more tests
  Add test
  remove temporary method that could be doing nothing
  Update HTTPBin certificates.
  Chinese CONTRIBUTING.md translate
  Delete CONTRIBUTING_CH.md
  Chinese Contributing.md translate
  rollback method 'AFPostReachabilityStatusChange'
  Use AFNetworkReachabilityManager to compare  consistency of notification posts and gets, instead of SCNetworkReachabilityRef. And test case reference.
  Remove test that is nilling session manually as it's not possible anymore to not have valid session (correctly)
  Add tests for  verifing reachability manager consistence  for notification posting and getting
  Specify Xcode 9.4 in Travis file.
  Update AFImageDownloader.m
  Add an ability that notification-observer know which reachability its belong
  ...
2018-10-08 23:28:53 +02:00
Jeff Kelley
27608c91d0
Merge pull request #4081 from MapaX/master
Fixed CLANG_ENABLE_CODE_COVERAGE flag so release can be made
2018-10-02 12:10:55 -04:00
Jeff Kelley
1bd73c7fca
Merge pull request #4256 from classdojo/cd-master
Fix crashes and memory leaks
2018-09-24 14:00:21 -04:00
Jeff Kelley
59e92b18c6
Merge pull request #4293 from AFNetworking/xcode-10
Update Travis config for Xcode 10.
2018-09-24 13:24:04 -04:00
Jeff Kelley
fdbec013c4 Update Travis config for Xcode 10. 2018-09-24 12:35:04 -04:00
Jeff Kelley
99cda82d33
Merge pull request #4286 from rob2468/master
update README.md, the old "Foundation URL Loading System" link is 404
2018-09-24 12:27:48 -04:00
Jeff Kelley
e46e64c274
Merge pull request #4248 from LMsgSendNilSelf/#4247
Add an ability that notification-observer know which reachability it belongs
2018-09-21 16:16:33 -04:00
Jeff Kelley
390e8fa6d4
Merge pull request #4262 from jin940/master
Chinese version for CONTRIBUTING.md
2018-09-21 15:41:04 -04:00
wangpeng
dea4316db0 Add test for object posting notification 2018-09-20 16:15:30 +08:00
jam.chenjun
23a6f442c8 update README.md, the old "Foundation URL Loading System" link is 404 2018-09-18 15:01:40 +08:00
Jakub Kaspar
9bb8ea7452 Change test name to correct one 2018-09-13 10:56:00 -07:00
Jakub Kaspar
af23240a4b Change default teardown methods to tests 2018-09-11 12:58:25 -07:00
Jakub Kaspar
0579f71d5a Update tests to use new API 2018-09-11 12:20:21 -07:00
Jakub Kaspar
864c8d6aed Update PR feedback, add more tests 2018-09-11 12:15:01 -07:00
Jeff Kelley
7b48feb383
Merge branch 'master' into master 2018-09-08 11:54:27 -04:00
Jakub Kaspar
3c54e1f8a5 Add test 2018-08-14 08:52:28 +02:00
Jakub Kaspar
a8758d26d5 Merge branch 'master' into cd-master
# Conflicts:
#	Tests/Tests/AFURLSessionManagerTests.m
2018-08-13 22:44:03 +02:00
Jakub Kaspar
64795368ae Merge remote-tracking branch 'as_origin/master'
# Conflicts:
#	AFNetworking/AFNetworkReachabilityManager.h
#	AFNetworking/AFURLSessionManager.m
2018-08-13 22:42:56 +02:00
Jakub Kaspar
86c8cc2263 remove temporary method that could be doing nothing 2018-08-13 22:34:41 +02:00
Jeff Kelley
b892e566f9
Merge pull request #4269 from AFNetworking/update-httpbin-certificates-october-2018
Update HTTPBin certificates, valid through October 2018.
2018-08-08 16:46:47 -04:00
Jeff Kelley
12088d6d37 Update HTTPBin certificates. 2018-08-08 14:23:40 -04:00
Jeff Kelley
a24b4896bb
Merge pull request #4113 from stnslw/headers-per-request
Support for setting headers per request when using AFHTTPSessionManager.
2018-07-31 00:05:58 -04:00
Jeff Kelley
a101152743
Merge pull request #4237 from Caelink/master
Implement two ways to collect NSURLSessionTaskMetrics
2018-07-30 23:47:01 -04:00
jin940
5b92ed3368
Chinese CONTRIBUTING.md translate
Chinese CONTRIBUTING.md translate
2018-07-29 01:07:45 +08:00
jin940
17edb8138a
Delete CONTRIBUTING_CH.md 2018-07-29 01:06:01 +08:00
jin940
7ff008b872
Chinese Contributing.md translate
Chinese Contributing.md translate
2018-07-29 01:00:38 +08:00
wangpeng
619a65b57e rollback method 'AFPostReachabilityStatusChange' 2018-07-25 22:00:31 +08:00
wangpeng
91cc666887 Use AFNetworkReachabilityManager to compare consistency of notification posts and gets, instead of SCNetworkReachabilityRef.
And test case reference.
2018-07-25 21:48:31 +08:00
Jakub Kaspar
926d4dbb8b Remove test that is nilling session manually as it's not possible anymore to not have valid session (correctly) 2018-07-23 12:20:10 +02:00
Jakub Kaspar
5544ef03f4 Merge branch 'master' into cd-master
* master: (71 commits)
  Specify Xcode 9.4 in Travis file.
  Update AFImageDownloader.m
  Safely get mergedTasks On responseQueue
  Update HTTPBin certificates.
  Update block usage requirements.
  Fixed tests.
  Update AFAutoPurgingImageCache.m
  Preparing for the 3.2.1 release
  Fix issues with AFCompatibilityMacros.h
  Add AFCompatibilityMacros.h to podspec.
  Add new .env files for iOS 11.x
  Update SDK settings in Travis config.
  Use old SDKs to test earlier versions of iOS 11.
  Update default SDK for iOS and tvOS
  Update umbrella header.
  Update HTTPBin certificates for April 2018.
  Remove beta from 9.3 image
  Update asset catalog JSON.
  Tweak tests to send expressions directly.
  Add tests and also prohibit +new from working.
  ...

# Conflicts:
#	AFNetworking/AFNetworkReachabilityManager.h
#	AFNetworking/AFURLSessionManager.m
2018-07-23 11:15:48 +02:00
wangpeng
ffbcabeb58 Add tests for verifing reachability manager consistence for notification posting and getting 2018-07-15 15:51:03 +08:00
Jeff Kelley
7642bcf659
Merge pull request #4249 from AFNetworking/xcode-9.4
Update Travis settings for Xcode 9.4
2018-07-13 18:04:45 -04:00
Jeff Kelley
9c2742c868 Specify Xcode 9.4 in Travis file. 2018-07-13 17:19:50 -04:00
Jeff Kelley
5fe5ea3355 Merge branch 'master' into pr/4051 2018-07-13 17:09:18 -04:00
Jeff Kelley
d135b740da
Merge pull request #4246 from bbeversdorf/master
Safely get mergedTasks On responseQueue
2018-07-13 15:16:47 -04:00
bbeversdorf
342653f27e
Update AFImageDownloader.m 2018-07-13 10:15:08 -05:00
wangpeng
06079adbe4 Add an ability that notification-observer know which reachability its belong 2018-07-13 18:33:01 +08:00
Brian Beversdorf
1c52c76537 Safely get mergedTasks On responseQueue
There is a race condition in -[AFImageDownloader downloadImageForURLRequest:withReceiptID:success:failure:] that can cause a crash.

#3876
#3984
2018-07-12 16:09:29 -05:00
Caelin Jackson-King
1d1c0241a9 Replace the version numbers with raw values 2018-07-02 17:00:18 -07:00
Caelin Jackson-King
ca380fdcfc Inverted preprocessor logic to check iff version exists in target 2018-06-29 16:50:35 -07:00
Caelin Jackson-King
54f11357d7 Replaced preprocessor variable to make sure all valid targets allow NSURLSessionTaskMetrics 2018-06-29 15:25:26 -07:00
Caelin Jackson-King
6622b05771 Missed one use of related type 2018-06-29 14:40:17 -07:00
Caelin Jackson-King
63410f3567 Xcode 7.x compatibility 2018-06-29 11:49:55 -07:00
Caelin
d0448a80f4
Merge pull request #1 from Caelink/didFinishCollectingMetrics
Implemented methods for collecting NSURLSessionTaskMetrics
2018-06-29 10:56:08 -07:00
Caelin Jackson-King
c4caddc5e9 Tests for notification and block use 2018-06-29 10:50:58 -07:00
Caelin Jackson-King
aed00d3099 Test for notification publishing the metrics 2018-06-28 16:38:16 -07:00
Caelin Jackson-King
fba4f366d2 Added kvo use of sessionTaskMetrics 2018-06-28 16:15:18 -07:00
Caelin Jackson-King
ad7b31f4f9 First stab at adding a block to be called and implementing didFinishCollectingMetrics on the SessionManager 2018-06-28 15:03:26 -07:00
Jeff Kelley
009e3bb667
Merge pull request #4225 from AFNetworking/update-httpbin-certificates-august-2018
Update HTTPBin certificates, valid through August 2018.
2018-06-09 13:44:52 -07:00
Jeff Kelley
d768f1c7c5 Update HTTPBin certificates. 2018-06-08 10:02:15 -07:00
Jeff Kelley
684dfe05d8 Update block usage requirements. 2018-06-07 23:09:14 -07:00
Jeff Kelley
41782ab4d6 Merge branch 'pr/3962' 2018-06-07 23:06:00 -07:00
Jeff Kelley
850974c941 Merge remote-tracking branch 'origin/master' 2018-06-07 23:03:26 -07:00
Jeff Kelley
61e15f412b Merge branch 'pr/4052' 2018-06-07 22:59:25 -07:00
Jeff Kelley
b15888735a
Merge pull request #4002 from LeeHongHwa/fix_coding_convention
fix space used in Objective-C method (coding style)
2018-06-07 22:56:28 -07:00
Jeff Kelley
48b63fa252 Fixed tests. 2018-06-07 22:50:31 -07:00
Jeff Kelley
447d7f3c58 Merge branch 'pr/4088' 2018-06-07 22:45:04 -07:00
Jeff Kelley
207a707fa3
Merge pull request #4206 from Huang-Libo/patch-1
Update AFAutoPurgingImageCache.m
2018-06-07 22:33:40 -07:00
Huang-Libo
357466d102
Update AFAutoPurgingImageCache.m
NSString property should use `copy`.
2018-05-07 00:51:45 +08:00
Jeff Kelley
746f6c3a1e Preparing for the 3.2.1 release 2018-05-04 12:59:26 -04:00
Jeff Kelley
6897b06049 Fix issues with AFCompatibilityMacros.h 2018-05-04 11:38:18 -04:00
Jeff Kelley
29021d2eeb
Merge pull request #4203 from AFNetworking/add-compatibility-macros-to-podspec
Add AFCompatibilityMacros.h to podspec.
2018-04-25 02:18:10 -04:00
Jeff Kelley
eb0635cb1b Add AFCompatibilityMacros.h to podspec. 2018-04-25 00:14:44 -04:00
Jeff Kelley
e08306e789
Merge pull request #4199 from AFNetworking/xcode-9.3
Xcode 9.3 Support
2018-04-13 14:10:03 -04:00
Jeff Kelley
899109bec8 Add new .env files for iOS 11.x 2018-04-11 20:13:04 -04:00
svoit
e6c674ed84 Removed redundant switch case 2018-04-11 23:22:18 +02:00
Jeff Kelley
fd98ef0d65 Update SDK settings in Travis config. 2018-04-11 16:53:03 -04:00
Jeff Kelley
f0fe188b7e Use old SDKs to test earlier versions of iOS 11. 2018-04-11 10:23:11 -04:00
Jeff Kelley
2927f79908 Merge remote-tracking branch 'origin/master' into xcode-9.3 2018-04-11 10:19:45 -04:00
Jeff Kelley
accf62f65a
Update default SDK for iOS and tvOS 2018-04-10 22:38:01 -04:00
Jeff Kelley
20bc43628e
Merge pull request #4198 from AFNetworking/april-2018-certificate-updates
Update HTTPBin certificates for April 2018.
2018-04-10 19:17:29 -04:00
svoit
1f70ba85bb Code cleaning 2018-04-10 23:23:46 +02:00
Jeff Kelley
a2401da932 Update umbrella header. 2018-04-10 17:14:22 -04:00
Jeff Kelley
09f49eb90a Update HTTPBin certificates for April 2018. 2018-04-10 17:13:58 -04:00
Jeff Kelley
4f4e4a96a9 Merge branch 'xcode-9.3' of github.com:AFNetworking/AFNetworking into xcode-9.3 2018-04-02 16:17:13 -04:00
Jeff Kelley
33f69a6f23 Merge branch 'master' into xcode-9.3 2018-04-02 16:17:10 -04:00
Jeff Kelley
49d3fe112e Remove beta from 9.3 image 2018-03-29 16:48:08 -04:00
Jeff Kelley
bc323baaa5 Update asset catalog JSON. 2018-03-29 16:47:11 -04:00
Jeff Kelley
9e005d9714
Merge pull request #4182 from AFNetworking/init-nullable-specifier-fix
Remove conflicting nullable specifier on init
2018-03-23 15:26:15 -04:00
Jeff Kelley
68214ee292 Tweak tests to send expressions directly. 2018-03-23 14:38:00 -04:00
Jeff Kelley
abd34500ab Add tests and also prohibit +new from working. 2018-03-23 14:35:39 -04:00
Jeff Kelley
b3f5f644a4
Merge pull request #4179 from AFNetworking/fix-xcode-brace-parsing
Move a brace to make Xcode happy.
2018-03-16 11:42:56 -04:00
Jeff Kelley
10afc7c4ac Merge branch 'xcode-9.3' of github.com:AFNetworking/AFNetworking into xcode-9.3 2018-03-16 11:40:42 -04:00
Jeff Kelley
adc8004b2b Update Travis config for Xcode 9.3 beta. 2018-03-16 11:40:37 -04:00
Nick Brook
2315d76280 Remove conflicting nullable specifier on init
The nullable specifier on init conflicts with the nonnull specifier on NSObject which generates a warning. This change removes it and throws an exception if init is used.
2018-03-16 09:29:29 -04:00
Jeff Kelley
03423c877f Merge remote-tracking branch 'origin/master' into xcode-9.3 2018-03-16 09:27:59 -04:00
Jeff Kelley
5d4b628906 Merge remote-tracking branch 'origin/master' into fix-xcode-brace-parsing 2018-03-16 09:27:38 -04:00
Jeff Kelley
7bc866d47a
Merge pull request #4180 from AFNetworking/update-fastlane-configuration
Update Fastlane Configuration
2018-03-16 09:26:41 -04:00
Jeff Kelley
09394030e1 Update Fastfile import branch. 2018-03-15 17:05:38 -04:00
Jeff Kelley
15f09aeb65 Merge branch 'master' into xcode-9.3 2018-03-15 15:17:11 -04:00
Jeff Kelley
b013b458c5 Move a brace to make Xcode happy.
The trailing brace within the #ifdef was confusig Xcode parsing the structure of the file.
2018-03-15 15:12:07 -04:00
Jeff Kelley
1a5b4814ea
Merge pull request #4131 from aduflo/patch-1
UIImageView+AFNetworking: Prevent stuck state for malformed urlRequest
2018-02-26 10:26:20 -05:00
aduflo
6184295398 Merge branch 'master' of https://github.com/AFNetworking/AFNetworking into patch-1 2018-02-25 10:54:55 -05:00
Jeff Kelley
29e0573128
Merge pull request #4155 from AFNetworking/february-2018-certificate-updates
Update HTTPBin.org certificates.
2018-02-24 22:18:33 -05:00
Jeff Kelley
1dc9e87729 Define compatibility macros. 2018-02-15 18:14:09 -05:00
Jeff Kelley
871dcf0da4 Finish marking macOS bits as unavailable. 2018-02-15 17:48:47 -05:00
Jeff Kelley
3a344e3d6f Comment out unavailable macOS API.
There’s a new warning for this in Xcode 9.3’s recommended settings.
2018-02-15 17:12:25 -05:00
Jeff Kelley
0de996f84b Apply recommended changes for Xcode 9.3 beta 1. 2018-02-15 17:11:57 -05:00
Jeff Kelley
7ea8c74739 Update HTTPBin.org certificates.
These will expire on 4/11/2018.
2018-02-15 16:47:18 -05:00
aduflo
8232b54262 Merge branch 'master' of https://github.com/aduflo/AFNetworking into patch-1 2018-02-15 10:10:20 -05:00
Jeff Kelley
e976d63ed2
Merge pull request #4138 from AFNetworking/unguarded-availability
Use @available if available to silence a warning.
2018-01-27 00:55:59 -05:00
Jeff Kelley
b32766772d Fix for Xcode 8. 2018-01-26 14:21:47 -05:00
Jeff Kelley
00ae01d063 Remove tvOS and watchOS availability checks.
tvOS 9 and watchOS 2 are the minimum version supported by AFNetworking,
so there’s no reason to do an additional check for them (they will be
included by the `*`).
2018-01-26 13:08:09 -05:00
Jeff Kelley
5521f5e0c5 Use @available if available to silence a warning. 2018-01-26 13:03:51 -05:00
Jeff Kelley
78ce859962
Merge pull request #4122 from AFNetworking/merge-fix
Fix analyzer warning for upload task creation
2018-01-26 11:36:34 -05:00
Dan Loewenherz
2d19dc8540 use Objective-C 2.0 subscripting 2018-01-14 09:10:04 -06:00
aduflo
f0b1149731 added test to cover image download with malformed url 2018-01-12 09:42:34 -05:00
Adam Duflo
0b35a643c6
Prevent stuck state for bad urlRequest 2018-01-10 16:17:52 -05:00
Jeff Kelley
bcede21e8a
Merge pull request #4125 from liaodalin19903/master
add the link for LICENSE
2018-01-09 21:25:33 -05:00
Liao Malin
944c3768a5
add the link for LICENSE
User can find the LICENSE address conveniently
2018-01-09 13:29:21 +08:00
Jeff Kelley
67dd69e632 Simpler version that avoid assertions. 2018-01-08 23:23:51 -05:00
Jeff Kelley
5aaaa501fc Add a test method for the bad case. 2018-01-08 23:12:56 -05:00
Jeff Kelley
bf9b920187 Move task creation inside block. 2018-01-07 23:23:29 -05:00
Jeff Kelley
f07fe50814
Merge pull request #4123 from AFNetworking/update-travis
Update Travis configuration for Xcode 9.2.
2018-01-07 23:22:42 -05:00
Jeff Kelley
3972e95c80 Uninstall executables when uninstalling Bundler. 2018-01-07 22:30:00 -05:00
Jeff Kelley
eae14bd8ce Consistent naming. 2018-01-06 23:35:08 -05:00
Jeff Kelley
a5933f3f83 Update Travis configuration for Xcode 9.2. 2018-01-06 23:33:13 -05:00
Jeff Kelley
15116f93b1 Preparing for the 3.2.0 release 2017-12-15 11:30:24 -05:00
Jeff Kelley
b0d24a08db
Merge pull request #4010 from WJE/config_afimagedownloader_nsurlcache
Config AFImageDownloader NSURLCache and ask AFImageRequestCache implementer if an image should be cached
2017-12-15 10:39:03 -05:00
Jeff Kelley
f7ecca5420
Merge pull request #4104 from SlaunchaMan/2017-updates
2017 Updates
2017-12-15 10:38:42 -05:00
Stanisław Brzeski
5e19a4df0b Minor codestyle fix 2017-12-15 16:31:03 +01:00
Stanisław Brzeski
ded6a76946 Added support for setting headers per HTTP request 2017-12-15 15:54:23 +01:00
Jeff Kelley
4de115625a
Merge pull request #3750 from skyline75489/master
Clarify documentation for supported encodings in AFJSONResponseSerializer
2017-11-23 20:51:56 -05:00
skyline75489
8ad70504fb Fix typo 2017-11-24 06:53:25 +08:00
Chester Liu
9fbf003dd6 Update content to reflect the newer RFC 2017-11-24 06:53:25 +08:00
skyline75489
84e409d6ae Clarify documentation for supported encodings in AFJSONResponseSerializer 2017-11-24 06:53:25 +08:00
Jeff Kelley
fc941b3336 Rename Fastlane env scheme. 2017-11-23 01:04:04 -05:00
Jeff Kelley
f6439cfa09 Remove redundant iOS deployment target setting. 2017-11-23 01:00:31 -05:00
Jeff Kelley
0c193a2c37 Set Xcode compatibility to Xcode 6.3 and up. 2017-11-23 01:00:19 -05:00
Jeff Kelley
4b64a60d4b Change “OS X” to “macOS” across the board.
Also change the “Today Extension Example” to specify iOS now that macOS
has those too.
2017-11-23 00:19:44 -05:00
Jeff Kelley
f45a3abf08 Fix analyzer warning about memory leak. 2017-11-23 00:05:51 -05:00
Jeff Kelley
20ff51cb8e Fix analyzer warning about NULL dereference. 2017-11-23 00:05:43 -05:00
Jeff Kelley
00addee8a1 Fix analyzer warning about mutable copies. 2017-11-23 00:05:25 -05:00
Jeff Kelley
1f2ffbb41b Update project settings to Xcode 9.1 defaults. 2017-11-23 00:05:16 -05:00
Jeff Kelley
9d5a894cb0
Merge pull request #3753 from skyline75489/xml-tests
Add XMLParser/XMLDocument serializer tests
2017-11-22 23:59:53 -05:00
Jeff Kelley
3297dfe5f0
Update security policy test certificates (#4103) 2017-11-22 23:47:31 -05:00
Jakub Kaspar
c976cf3db8 fix crashes 2017-11-12 12:20:24 -08:00
Matti Mustonen
d8f45e79e5 Fixed init method nullability to default value 2017-10-13 10:28:52 +03:00
Matti Mustonen
1e03fb1a72 Fixed CLANG_ENABLE_CODE_COVERAGE flag so release can be made 2017-10-12 13:49:40 +03:00
Ash Furrow
75763005cb
Modifies AFJSONObjectByRemovingKeysWithNullValues to remove NSArray null objects. 2017-09-18 11:11:02 -04:00
Ash Furrow
849dff7dee
Exposes C function prototype. 2017-09-18 10:47:07 -04:00
Henddher Pedroza
9b33c1699f self in block 2017-07-28 17:11:47 -05:00
Henddher Pedroza
6554afe3c9 Merge branch 'config_afimagedownloader_nsurlcache' of https://github.com/WJE/AFNetworking into config_afimagedownloader_nsurlcache 2017-07-28 16:22:05 -05:00
Henddher Pedroza
c69c109da8 Remove usage of XCTestExpectation.inverted (not supported) 2017-07-28 16:19:34 -05:00
Henddher Pedroza
a241b4fcdd Remove usage of XCTestExpectation.inverted (not supported) 2017-07-28 15:46:45 -05:00
Henddher Pedroza
6babb5f039 Test-cases. 2017-07-28 15:29:53 -05:00
Henddher Pedroza
51a80847ed Ask <AFImageRequestCache> implementor if an image should be cached. Implementors may prevent caching. 2017-07-28 11:15:44 -05:00
Henddher Pedroza
f6f64c83b3 Remove setter for defaultURLCache 2017-07-28 08:48:58 -05:00
Henddher Pedroza
8db67cdfa9 Allow initialization of AFImageDownloader using custom NSURLSessionConfiguration. 2017-07-28 08:45:02 -05:00
Henddher Pedroza
41897b19c6 Ability to set the defaultURLCache 2017-07-26 18:10:07 -05:00
Dominik Gruber
dd59ffa188 Allow return value of HTTP redirection block to be NULL (#3975)
* Allow return value of HTTP redirection block to be NULL

* Make tests pass again (#3993)

* Make tests pass again

* Fix macOS builds in Fastlane.
2017-07-22 19:01:50 -04:00
leehonghwa
27c819537a Fix asterisk location in method declaration 2017-07-19 15:08:26 +09:00
leehonghwa
c18c09a75c fix space used in Objective-C method (coding style) 2017-07-19 14:29:27 +09:00
Josh Friend
e6d975619e Fix CHANGELOG formatting (#3915) 2017-07-13 15:06:12 -04:00
skyline75489
158dc56d30 Fix a failure description 2017-07-13 20:00:46 +08:00
skyline75489
0840d05555 Fix some typo 2017-07-13 20:00:45 +08:00
skyline75489
0ffb17d619 Add XMLParser/XMLDocument serializer tests 2017-07-13 20:00:45 +08:00
Jeff Kelley
ec5c955059 Make tests pass again (#3993)
* Make tests pass again

* Fix macOS builds in Fastlane.
2017-07-12 22:24:56 -04:00
BKKim
f8159fee72 Fix AFURLSessionManager security weakness
crashes when calling to a released block pointer
2017-05-30 21:35:54 +09:00
Cédric Luthi
4f3c694920 Merge pull request #3751 from 0xced/deprecate-stringEncoding
Deprecate the unused stringEncoding property of AFHTTPResponseSerializer
2016-10-14 14:26:23 +02:00
Cédric Luthi
33a403cb9c Deprecate AFHTTPResponseSerializer.stringEncoding
The `stringEncoding` property is never used. It was probably inroduced by error in 9a40c0dc0f. It was probably a copy/paste error as the same property also exists on `AFHTTPRequestSerializer` where it’s actually used.
2016-10-14 01:23:00 +02:00
Kevin Harwood
5b6def1f4e Merge pull request #3694 from 0xced/fix-reachability-tests
Fix reachability tests
2016-10-12 07:17:00 -05:00
Cédric Luthi
fb5022c073 Remove assertion that status in callback == reachabilityManager status
The status passed in callbacks (both block and notification) is captured before the callbacks are dispatched on the main thread. It is thus possible that the reachabilityManager status change in the meantime.

Users MUST use the status parameter for the block callback or the `AFNetworkingReachabilityNotificationStatusItem` user info key for the notification.
2016-10-12 07:54:10 +02:00
Cédric Luthi
025c82fa7b Explicitly set the expectation to nil to avoid calling fulfill twice 2016-10-12 07:41:51 +02:00
Cédric Luthi
83c33fb9a7 Enable domain reachability tests 2016-10-12 07:39:43 +02:00
Cédric Luthi
111931b32c Fulfill the expectation once the network status becomes reachable
Do not use XCTAssertEqual(reachable, ...) because it might transition to AFNetworkReachabilityStatusNotReachable before becoming reachable.
2016-10-12 07:39:43 +02:00
Cédric Luthi
550d8c3dd2 Remove unnecessary assert
This pattern does not make sense at all because the assert can never fail.

if (condition) {
    XCTAssert(condition, @"comment");
}
2016-10-12 07:39:43 +02:00
Cédric Luthi
9627d0fc20 Merge pull request #3748 from AFNetworking/httpbin-base-url
Enable custom httpbin URL with HTTPBIN_BASE_URL environment variable
2016-10-12 06:48:44 +02:00
Cédric Luthi
5d6867c3b6 Enable custom httpbin URL with HTTPBIN_BASE_URL environment variable
Editing the scheme and checking the `HTTPBIN_BASE_URL` box enables running the test suites on a default local installation of httpbin.
2016-10-11 21:34:04 +02:00
skyline75489
0e947a7ae6 Add test method to wait for common timeout without handler 2016-10-11 08:56:39 -05:00
Maksym Shcheglov
9fea2240a8 Removed ambiguous array creation. According to documentation SecTrustCreateWithCertificates takes SecCertificateRef object or an array of certificates. 2016-10-11 08:38:21 -05:00
Cédric Luthi
719a3bf60b Do not crash when passing invalid JSON for serialization
Fixes #3711

The `NSURLErrorCannotDecodeContentData` code is not ideal, but `AFURLRequestSerializationErrorDomain` should define its own error codes anyway.
2016-10-10 12:11:22 -05:00
Kevin Harwood
4429921ac1 Merge pull request #3735 from AFNetworking/3594
Fixed crash around customizing NSURLCache size for < iOS 8.2
2016-10-10 10:00:34 -05:00
Kevin Harwood
b36f0ed444 Added a comment 2016-10-10 09:21:17 -05:00
flutechang
84d18cac75 Fix crash around customizing NSURLCache size. 2016-10-10 09:21:17 -05:00
Kevin Harwood
7118eb6bbf Removed explicit xcpretty install 2016-10-10 09:04:28 -05:00
Kevin Harwood
f39ec68b44 Merge pull request #3733 from skyline75489/master
Fixed issue where UIWebView extension did not preserve all of the request information
2016-10-10 07:59:02 -05:00
Kevin Harwood
e8fde524d7 Merge pull request #3653 from tclementdev/master
Handle Error Pointers according to Cocoa Convention
2016-10-10 07:44:16 -05:00
skyline75489
0fc675e960 Use NSURLRequest to construct dataTask. Fix #3724 2016-10-09 22:00:24 +08:00
Thomas Clement
f28654cb5c Add test asserts for non-nil errors. 2016-10-06 18:28:14 +02:00
Thomas Clement
95fa90666d Fix class name comment. 2016-10-06 18:26:20 +02:00
Thomas Clement
290ec35a4a Add json/plist serializer tests for better code coverage. 2016-10-06 17:51:09 +02:00
Kevin Harwood
748a410ba7 Fixed bug with webview delegate callback 2016-10-06 10:13:24 -05:00
Kevin Harwood
2d1fb6ba7a Fixed issue where response serializers did not inherit super class copying 2016-10-06 08:38:54 -05:00
Cédric Luthi
a26a500c1d Make it impossible to set a security policy with pinning on insecure URLs
### Before this commit
Setting a security policy configured with `AFSSLPinningModeCertificate` or `AFSSLPinningModePublicKey` on a AFHTTPSessionManager instance configured with an insecure `http` base URL was valid. Requests made with this manager would always succeed since the `-[AFURLSessionManager URLSession:didReceiveChallenge:completionHandler:]` would never be called and thus the security policy would never be evaluated.

### After this commit
Setting a security policy configured with `AFSSLPinningModeCertificate` or `AFSSLPinningModePublicKey` on a AFHTTPSessionManager instance configured with an insecure `http` base URL will throw an exception. This will force the manager to be configured with a secure `https` URL.

Note that properly configuring App Transport Security (ATS) would also solve this issue since insecure connections would fail anyway, but this is a *belt and suspenders* solution.
2016-10-06 08:27:21 -05:00
Thomas Clement
2201d2cd55 Rewrite code flow to clarify error handling. 2016-10-06 13:07:13 +02:00
Thomas Clement
df5b5121a4 Make sure we check the return values before handling the error objects (this is the correct way to handle errors as described in Apple's documentation). 2016-10-06 12:51:02 +02:00
Thomas Clement
0be9763246 Check return value before doing anything with error. This is a Cocoa convention. 2016-10-06 12:51:02 +02:00
Kevin Harwood
e337471d80 Disabling background manager tests for Xcode 8 due to rdar://28588583 2016-10-05 13:15:09 -05:00
Kevin Harwood
51561a9236 Removed code signing for test targets
Trying `FASTLANE_EXPLICIT_OPEN_SIMULATOR=1`
2016-10-05 13:15:09 -05:00
Kevin Harwood
a81d445a00 Updated travis matrix based on upcoming image support changes 2016-10-05 13:15:09 -05:00
Kevin Harwood
89b79c53a0 Xcode 8 Compatibility for Travis CI
- Updated Test Runners for Travis
- Updated project settings for Xcode 8
- Updated macOS example platform
2016-10-05 13:15:09 -05:00
Cédric Luthi
a8c148f9df Extract common URLs into AFTestCase
There was some repetition in URL creation for unit tests. Extracting the common URLs (png, jpeg, delay, status code) makes it easier run the test suites on a local copy of httpbin with the `python -m httpbin.core` command.
2016-10-05 09:38:33 -05:00
Kevin Harwood
dd674a3268 Merge pull request #3718 from 0xced/fix-potential-KVO-crasher
Fixed potential KVO crasher for URL Session Task delegates
2016-10-03 08:46:50 -05:00
Cédric Luthi
2163a8b750 Do not dispatch session invalidation on the main thread
The dispatching on main thread was introduced in 920e2669f9 in order to fix #2053. It was not a proper fix but rather a lucky coincidence. This kind of KVO error must be fixed by ensuring that observer are properly registered and unregistered, not by dispatching some random method on the main thread.

It is very important not to dispatch async session invalidation code because it is called in unit tests from the `tearDown` method. At that point, there’s no active runloop, so the session invalidation would not happen immediately but when running the next asynchronous unit test, i.e. when the `waitForExpectationsWithCommonTimeoutUsingHandler:` method is called.

This commit, in conjunction with d869571b82 fixes #3710.
2016-09-30 23:52:29 +02:00
Cédric Luthi
d869571b82 Safer KVO implementation in AFURLSessionManagerTaskDelegate
Adding self as observer in init and removing self as observer in dealloc is the best way to ensure a proper KVO implementation.
2016-09-30 23:32:39 +02:00
Kevin Harwood
4fb051898c Merge pull request #3693 from 0xced/fix-progress-handlers
Fix progress handlers called with fractionCompleted == 1 several times
2016-09-23 08:07:15 -05:00
Cédric Luthi
cd5cd6e787 Fix progress handlers called with fractionCompleted == 1 several times
Setting the expectation to nil after it is fulfilled in order to avoid `*** Assertion failure in -[XCTestExpectation fulfill]` was just hiding the real issue.
2016-09-23 14:33:25 +02:00
Kevin Harwood
6aa6a3b7ed Merge pull request #3692 from 0xced/disable-reachability-test
Disable another domain reachability test for Travis stability
2016-09-22 15:59:29 -05:00
Kevin Harwood
bcba777cfa Merge pull request #3691 from 0xced/fix-fastlane-bundler-issues
Fix Travis build failures because of fastlane/bundler error
2016-09-22 15:59:16 -05:00
Cédric Luthi
f235558c69 Disable another domain reachability test for Travis stability 2016-09-22 22:26:08 +02:00
Cédric Luthi
51b17804ee Fix Travis build failures because of fastlane/bundler error
Workaround a bundler issue which is tracked on https://github.com/bundler/bundler/pull/4981
2016-09-22 22:20:03 +02:00
Kevin Harwood
137676251b Merge pull request #3649 from Microbee23/bug/reachability-ns-unavailable
Fixed issue where `NS_UNAVAILABLE` is not reported for `AFNetworkReachabilityManager`
2016-09-19 10:37:02 -05:00
Joseph Granieri
712ac61a4f Fixed issue where NS_UNAVAILABLE is not reported to calling code as it was previously just in the .m file - this allows the compiler to generate a build error when using the init method 2016-08-17 14:46:14 +10:00
Kevin Harwood
f51f0b8533 Merge pull request #3565 from chenxin0123/cx
Moved `[self didChangeValueForKey:@"currentState"]` into correct scope
2016-08-03 08:12:55 -05:00
Kevin Harwood
fdb2d14f0f Merge pull request #3604 from Starscream27/uiprogressview-completed-crash
Fixed an issue where registering a UIProgessView to a task that was a…
2016-08-03 08:06:50 -05:00
Kevin Harwood
ff228fad3a Merge pull request #3607 from wikimedia/bug/kvo-progress-removal
Remove KVO of progress in favor of using the NSURLSession delegate APIs
2016-08-03 07:55:18 -05:00
Kevin Harwood
18a7973839 Merge pull request #3612 from ethansinjin/master
require app extension api only on watchOS
2016-08-03 07:41:50 -05:00
Ethan Gill
1e27113c8b require app extension api only on watchOS 2016-07-14 17:51:24 -07:00
Corey Floyd
9aa03d0f96 Remove KVO of progress in favor of using the NSURLSession delegate APIs
The impetus for this change was a bug related to:
https://github.com/AFNetworking/AFNetworking/issues/3380

Which points to an issue where AFURLSessionManager could get in a state where it does not inform the AFURLSessionManagerTaskDelegate to un-observe cancelled (or otherwise completed) tasks before they are deallocated.
While the above issue is specific to background tasks/sessions, we have observed it on sessions with default configurations as well.

Instead of debugging the KVO issues, I decided to replace the KVO code with in favor of the appropriate NSURLSession delegate methods.
Running all unit tests shows that this approach appears to be working.

The pull request that made this change (https://github.com/AFNetworking/AFNetworking/pull/3187) mentions that its goal was to remove the need for AFNetworking API consumers to use a KVO API for getting progress.
This makes sense, but I was unable to see any reason why KVO was used internally for getting progress information rather than the NSURLSession Delegate methods.
Because of this, It isn't clear to me what the historical reasons were/are for KVO being needed to satisfy the progress requirements of the AFNetworking API.

With any luck, KVO is no longer needed and we can eliminate this class of crashes by eliminating KVO.
2016-07-06 13:05:23 -04:00
Mathieu Meylan
7dc973b89c Fixed an issue where registering a UIProgessView to a task that was already completed would crash with the following error:
CRASH: Fatal exception: An instance ***** of class ******* was deallocated while key value observers were still registered with it.
2016-07-05 17:01:53 +02:00
CX
023f3505c8 move [self didChangeValueForKey:@"currentState"]; into if scope 2016-06-11 20:04:48 +08:00
Kevin Harwood
2a53b2c3f4 Merge pull request #3526 from alexbird/bugs/header-threading-crash
Fixed crashes due to race conditions with NSMutableDictionary access in AFHTTPRequestSerialiser
2016-06-06 13:07:39 -05:00
Kevin Harwood
363a1fcc20 Merge pull request #3555 from hulizhen/master
Update README.md
2016-06-06 09:12:06 -05:00
Kevin Harwood
ac2af11551 Merge pull request #3504 from Coeur/patch-2
documenting the workaround to uploadTaskWithRequest:fromFile: bug
2016-06-06 07:56:40 -05:00
Hu Lizhen
f26bfb46c3 Update README.md
Update the content of the section `Installation with CocoaPods` in `README.md`.
2016-06-04 09:35:13 +08:00
Alex Bird
0e46d1ea89 Fix for crashes due to dangerous NSMutableDictionary access in AFHTTPRequestSerialiser – Moved unit test to a better location. 2016-05-19 22:35:49 +01:00
Alex Bird
fa8b02da94 Fix for crashes due to dangerous NSMutableDictionary access in AFHTTPRequestSerialiser – Added unit test which reproduces the issue.
NB: as the crash is caused by using a dictionary in a way that the runtime did not expect, it typically causes intermittent crashes which are almost always in unrelated areas of the app. This seems to be strongly related to deallocation of the values in the dictionary, but this may not be the only cause. As such, there is nothing to positively test for, the test succeeds if it doesn't EXC_BAD_ACCESS when cleaning up the @autoreleasepool at the end.
2016-05-19 22:27:21 +01:00
Antoine Cœur
27652fe03e documenting the workaround to uploadTaskWithRequest:fromFile: bug 2016-05-12 14:33:25 +08:00
Kevin Harwood
59d5111895 Merge pull request #3490 from dchohfi/deprecating-method
Added deprecated attribute to  `dataTaskWithRequest:completionHandler:`
2016-05-06 09:15:40 -05:00
Kevin Harwood
e1e2d62ad8 Merge pull request #3476 from ecaselles/ecaselles-update-methods-override-documentation
Updates `AFHTTPSessionManager` documentation to reflect v3.x changes
2016-05-06 09:14:14 -05:00
Kevin Harwood
3eec2c1f0f Merge pull request #3488 from gemmakbarlow/master
Updated character
2016-05-06 08:50:30 -05:00
Diego Chohfi
11c049a083 Fixing unit tests for deprecated method 2016-05-03 12:23:17 -03:00
Diego Chohfi
c0131a92a1 Deprecating method dataTaskWithRequest:completionHandler: from AFURLSessionManager 2016-05-03 11:53:11 -03:00
Gemma Barlow
0cac3e4bfc Updated character
Updated to a different unicode dash (U+002D rather than U+2013) so that it is parsed correctly by markdown, when converting the CocoaPods Acknowledgements.markdown to HTML.
2016-05-01 17:29:32 -04:00
Edu Caselles
711aeec616 Updates documentation to reflect the new behaviour on GET, POST, etc. convenience methods. 2016-04-28 16:24:56 +01:00
Kevin Harwood
b7073e4990 Merge pull request #3431 from 0xced/warnings
Improved code base to generate fewer warnings when using strictor compiler settings
2016-04-11 13:34:50 -05:00
Kevin Harwood
df039898bb Merge pull request #3432 from yulingtianxia/master
remove unused `AFTaskStateChangedContext`
2016-04-11 13:28:24 -05:00
yulingtianxia
60ad370c8f remove unused AFTaskStateChangedContext
`AFTaskStateChangedContext` is not used in AFN 3
2016-04-09 17:45:48 +08:00
Cédric Luthi
885e0a4b4e Enable more warnings 2016-04-09 01:06:05 +02:00
Cédric Luthi
19e4aef45c Enable Treat Warnings as Errors 2016-04-09 00:41:38 +02:00
Cédric Luthi
4a7148db79 Comment out unused static functions
They were referenced in testPolicyWithCertificatePinningAllowsGoogleComServerTrustIncompleteChainWithRootCertificatePinnedAndValidDomainName which is now disabled.
2016-04-09 00:41:38 +02:00
Cédric Luthi
c52ff8510f Remove unnecessary #pragma clang diagnostic ignored 2016-04-09 00:41:38 +02:00
Cédric Luthi
16c09fae46 Remove all #pragma clang diagnostic ignored "-Wgnu" 2016-04-08 23:46:10 +02:00
Kevin Harwood
ba3bb8e5d7 Removing Fastlane Readme from repo 2016-03-31 12:36:27 -05:00
Kevin Harwood
88f13053b1 Preparing for the 3.1.0 release 2016-03-31 12:28:02 -05:00
Kevin Harwood
f169be43e1 Merge pull request #3417 from AFNetworking/bug/ssl_pinning_disposition
Reverted `NSURLSessionAuthChallengeDisposition` to `NSURLSessionAuthChallengeCancelAuthenticationChallenge` for SSL Pinning
2016-03-31 12:25:05 -05:00
Kevin Harwood
6b53aaac2b Merge pull request #3418 from AFNetworking/travis/update_xcode73
Updated Test Suite to run on Xcode 7.3
2016-03-31 12:24:19 -05:00
Kevin Harwood
280baf585f Reverted NSURLSession Challenge Disposition to be NSURLSessionAuthChallengeCancelAuthenticationChallenge to allow for more determistic pinning results.
- Updated test suite to check for new error code
2016-03-31 09:27:05 -05:00
Kevin Harwood
8a99f2d172 Added test demonstrating failure for PK 2016-03-31 09:25:02 -05:00
Kevin Harwood
74720869a7 Fixed simulator settings 2016-03-29 09:04:12 -05:00
Kevin Harwood
62ab0f9a2c Updated main travis environment to be Xcode 7.3 2016-03-29 08:39:30 -05:00
Kevin Harwood
439e67f560 Merge pull request #3367 from quellish/AFImageResponseSerializerTests
AFImageResponseSerializer tests
2016-03-28 15:29:01 -05:00
Kevin Harwood
3bd26dceca Merge pull request #3393 from AFNetworking/pr/3336_resolved_compiler_warnings
Resolved compiler warnings for incorrect @param in function documenta…
2016-03-28 15:28:14 -05:00
quellish
c297688068 automaticallyInflatesResponseImage and imageScale properties are not available on MacOS X, using the preprocessor to handle that correctly. 2016-03-14 12:46:02 -07:00
quellish
ca22ad539d Removed assertions on acceptableContentTypes.count and acceptableStatusCodes.count as this is now handled by isEqual assertions 2016-03-14 12:46:02 -07:00
quellish
f3a7adf147 Added additional assertions to compare the acceptableContentTypes and acceptableStatusCodes properties for copying and archiving. 2016-03-14 12:46:02 -07:00
quellish
dfbe3edab4 Added test to ensure that archiving an image serializer with non-default property values produces the expected result. 2016-03-14 12:46:02 -07:00
quellish
2e790eb917 Changed test names to be more descriptive 2016-03-14 12:46:02 -07:00
quellish
e0052338d6 Added test assertions for automaticallyInflatesResponseImage and imageScale of AFImageResponseSerializer 2016-03-14 12:46:02 -07:00
quellish
723cf3237a Added AFImageResponseSerializerTests to MacOS and tvOS test targets 2016-03-14 12:46:02 -07:00
quellish
77f6fe1c31 Added AFImageResponseSerializerTests class. 2016-03-14 12:46:02 -07:00
Kevin Harwood
32cf30a245 Merge pull request #3385 from AFNetworking/bug/fix_image_downloader_crash_with_bad_url
Fixed crash if bad URL was passed into the image downloader
2016-03-14 13:10:59 -05:00
Kevin Harwood
5d1dc7c2ee Merge pull request #3360 from jasonhotsauce/master
Use `NSKeyValueChangeNewKey` constant in change dictionary rather than hardcoded string.
2016-03-14 13:03:40 -05:00
Kevin Harwood
9a70ba90a4 Merge pull request #3386 from AFNetworking/bug/remove_query_string_question_mark_if_parameters_are_empty
Removed trailing question mark in query string if parameters are empty
2016-03-14 12:06:27 -05:00
Wenbin Zhang
305c974b8b Use NSKeyValueChangeNewKey in change dictionary.
* We explicitly used @"new" in `change`, I think it's better to use
platform defined constant.
2016-03-14 07:37:51 -07:00
Kevin Harwood
b737d74fe9 Removed trailing question mark in query string if parameters are empty
Related to #3376
2016-03-14 09:34:52 -05:00
Kevin Harwood
3e8addb653 Merge pull request #3292 from AFNetworking/bug/properly_handle_205
Fixed status code 204/205 handling
2016-03-14 09:07:26 -05:00
Kevin Harwood
aba212c842 Merge pull request #3332 from duanhong169/master
Fixed issue where UIButton image downloading called wrong cancel method
2016-03-14 09:06:40 -05:00
Kevin Harwood
502fe0f4a5 Merge pull request #3336 from guvera-labs/resolve_compiler_warnings
Resolved compiler warnings for documentation errors
2016-03-14 09:06:07 -05:00
Kevin Harwood
ac6ba4580e Refactored to dispatch an error if a bad URL is passed in. 2016-03-14 09:02:48 -05:00
Christian Wen
fa2c806a39 Prevent crash when "AFImageDownloader identifier" is nil (which is cause by passing an NSURLRequest which doesn't return an absoluteString). #3343. Added a test for this behavior. 2016-03-14 08:50:28 -05:00
Kevin Harwood
326ccb170d Merge pull request #3384 from Draveness/patch-2
Added white space to URLs in code comment to allow Xcode to properly parse them
2016-03-14 08:48:06 -05:00
Kevin Harwood
9e8ac96863 Merge pull request #3369 from hhanesand/master
Updated documentation to match method names and correct compiler warnings
2016-03-14 08:46:13 -05:00
Kevin Harwood
37a23f07bc Merge pull request #3355 from AFNetworking/fix/image_cache_tests
Fix - Image Cache Tests
2016-03-14 08:28:37 -05:00
Draveness
c27b46c87d Add leading whitespace to urls 2016-03-14 10:17:27 +08:00
Draveness
d86c4ce00b Merge remote-tracking branch 'draven/patch-2' 2016-03-14 10:13:49 +08:00
Draveness
d0b1db20d8 Add whitespace between url and ')' to prevent Xcode misunderstanding 2016-03-14 10:12:20 +08:00
Draveness
333169d430 Add a whitespace to reachability sample code url
If there is not a whitespace, Xcode will misunderstand the whole url is 

```
https://developer.apple.com/library/ios/samplecode/reachability/)
```

instead of 

```
https://developer.apple.com/library/ios/samplecode/reachability/
```
2016-03-14 09:32:52 +08:00
Alex Bird
2ffdc3db85 Fix for crashes due to dangerous NSMutableDictionary access in AFHTTPRequestSerialiser, added a dispatch queue for safety in multithreaded environments. 2016-03-08 16:43:51 +00:00
Hakon Hanesand
5623891554 update documentation to match method names 2016-03-03 18:40:58 -06:00
Kevin Harwood
f674d572db Merge pull request #3345 from careykevin/patch-1
Fix spelling
2016-02-23 12:47:19 -06:00
Christian Noon
62bef6835b Fixed up auto-purging image cache tests after fixing the memory calculation bug. 2016-02-23 10:10:24 -08:00
Christian Noon
5883c54943 Merge pull request #3344 from SummertimSadness/bug/imageMemory
Fixed image memory calculation
2016-02-23 08:46:29 -08:00
Kevin Carey
aee9462179 Fix spelling
Misspelling of "committed"
2016-02-17 13:19:00 -05:00
周明宇
fac9d87340 Fixed image memory calculation 2016-02-17 10:44:52 +08:00
duanhong
49e77f198b typo and incomplete doc 2016-02-16 10:05:33 +08:00
duanhong
e457fc980d fix: wrong methods called. 2016-02-16 10:05:33 +08:00
Ricardo Santos
0ad81c37b8 Fix incorrect @param's in function documentation 2016-02-16 10:08:15 +10:30
Ricardo Santos
a7127aca6a Resolved compiler warnings for incorrect @param in function documentation. 2016-02-15 09:15:37 -06:00
Kevin Harwood
32547b02c9 Merge pull request #3325 from AFNetworking/bug/fix_cancellation_race_condition
Fixed image downloading cancellation race condition
2016-02-15 08:43:05 -06:00
Kevin Harwood
cc7a00d6a8 Merge pull request #3339 from ReadmeCritic/master
Correct the spelling of CocoaPods in README
2016-02-15 08:42:33 -06:00
ReadmeCritic
f2597f7e60 Correct the spelling of CocoaPods in README 2016-02-10 13:42:56 -08:00
Kevin Harwood
124811e31e Switched to smaller images to improve test performance 2016-02-08 10:56:28 -06:00
Kevin Harwood
ed39be2a09 Improved the Unit Test
Fixed issue where test could still fail if cancelled in a certain order
2016-02-08 10:56:28 -06:00
Kevin Harwood
bfc67c9d6c Fixed image downloading cancellation race condition
Addresses #3324
2016-02-08 10:56:28 -06:00
Kevin Harwood
3cde647ed7 Merge pull request #3337 from AFNetworking/tests/disable_incomplete_cert_chain_test
Tests/disable incomplete cert chain test
2016-02-08 10:48:59 -06:00
Kevin Harwood
c8e5ce2341 Fixed issue with iOS scheme in 7.2.1 2016-02-08 09:46:51 -06:00
Kevin Harwood
44977793c3 Disabling the cert chain temporarily 2016-02-08 08:41:05 -06:00
Kevin Harwood
1b5d9bae38 Merge pull request #3330 from AFNetworking/ci/xcode73
Added CI support for Xcode 7.3 and iOS 9.3. Removed iOS 8.2
2016-02-01 11:23:32 -06:00
Kevin Harwood
913f2f9e8f Added support for Xcode 7.3 and iOS 9.3. Removed iOS 8.2 2016-02-01 10:44:58 -06:00
Kevin Harwood
7dc8ca21c5 Update CONTRIBUTING.md 2016-02-01 08:22:34 -06:00
Kevin Harwood
c7f8d01cf5 Merge pull request #3315 from SlaunchaMan/fix-reachability-warnings
Fixed static analyzer warnings on AFNetworkReachabilityManager
2016-01-28 16:23:40 -06:00
Kevin Harwood
0574a40df8 Merge pull request #3321 from radarhere/patch-1
Fixed typo
2016-01-28 12:11:34 -06:00
Andrew Murray
c0fb105bd2 Fixed typo 2016-01-29 00:02:53 +11:00
Jeff Kelley
8627ada34a Stop monitoring before destroying reachability object. 2016-01-27 09:52:30 -05:00
Jeff Kelley
b0d0e58c4c Don’t use ARC for reachability ref. 2016-01-27 09:52:30 -05:00
Kevin Harwood
5bd9ad85ea Merge pull request #3317 from SlaunchaMan/fix-httpbin-certs
Update HTTPBin certificates that expired.
2016-01-27 08:15:33 -06:00
Jeff Kelley
3641532d85 Update HTTPBin certificates that expired.
The new expiry date is 1/19/2017.
2016-01-26 20:44:21 -05:00
Kevin Harwood
aa9b5f59aa Merge pull request #3294 from emilyZhouwm/master
Fixed issue where download progress would not be reported in iOS 7
2016-01-15 08:27:49 -06:00
zwm
a745be4fcd for iOS7 call downloadProgress block 2016-01-15 11:35:28 +08:00
Kevin Harwood
056a1b69d6 Merge pull request #3290 from AFNetworking/docs/copyright_bump
Bumping copyright to 2016
2016-01-14 16:23:50 -06:00
Kevin Harwood
3e0c986224 Fixed status code 205 handling
If a server returned a 205 with no response content type and no response data, the response serializer would fail. This patch allows response serialization to continue without error if no response content type header is defined, and there are zero bytes of response of data.

If the server returns a response content type header OR response data, the serializar will respect the old serialization logic. This means that if a response content type is listed in the header, we are expecting some type of data response.
2016-01-14 16:20:29 -06:00
Kevin Harwood
31560ea86e Updated license 2016-01-14 10:23:27 -06:00
Kevin Harwood
71fb444f44 Merge pull request #3289 from AFNetworking/bug/webview_progress_crash
Fixed crash when passing nil/null for progress in UIWebView extension
2016-01-14 10:19:31 -06:00
Kevin Harwood
412d903e62 Fixed crash when passing nil/null for progress in UIWebView extension 2016-01-14 08:31:45 -06:00
Kevin Harwood
d0e5aa0b0c Merge pull request #3259 from corymsmith/master
Changing confusing URL in Readme for data task
2016-01-11 08:52:35 -06:00
Cory Smith
5b5e0107d8 Updating URL for datatask to one that returns JSON 2016-01-05 09:49:30 -07:00
Kevin Harwood
5d73b00640 Bumping copyright to 2016 2016-01-05 09:22:42 -06:00
Kevin Harwood
c0e8cc0a82 Merge pull request #3160 from AFNetworking/feature/expose_query_string_helper
Exposed `AFQueryStringFromParameters` and `AFPercentEscapedStringFromString` for public use.
2016-01-05 08:35:49 -06:00
Kevin Harwood
9c7a3ab7e2 Merge pull request #3253 from 0xced/remove-NSJSONSerialization-workaround
Removed workaround for NSJSONSerialization bug that was fixed in iOS 7
2016-01-05 08:35:29 -06:00
Cédric Luthi
00e7a8bcd8 Remove workaround NSJSONSerialization bug
The NSJSONSerialization bug with Unicode character escape codes has been fixed in iOS 7, see http://openradar.appspot.com/radar?id=2397401#ag9zfm9wZW5yYWRhci1ocmRyFAsSB0NvbW1lbnQYgICAgIDdwwgM

Removing the NSData -> NSString -> NSData roundtrip is also likely a nice performance boost.
2016-01-05 13:50:16 +01:00
Cédric Luthi
1d37329184 Refactor workaround single space in JSON deserialization 2016-01-05 13:50:16 +01:00
Cédric Luthi
d0ff538023 Add tests for some AFJSONRequestSerializer corner cases (empty data) 2016-01-05 13:50:16 +01:00
Kevin Harwood
a3dcf0f25f Merge pull request #3254 from gunyarakun/fix/readme-serializer-error
Add error parameter to the examples of AFHTTPRequestSerializer on README.md
2016-01-04 09:11:48 -06:00
Kevin Harwood
2cb45e92ae Merge pull request #3256 from mz2/master
Adds Carthage/Build into .gitignore
2016-01-04 09:11:30 -06:00
Cory Smith
c5d3fb69f0 Changing confusing URL in Readme for data task 2016-01-03 20:03:41 -07:00
mz2
510509a155 Adds Carthage/Build into .gitignore 2015-12-30 14:44:45 +02:00
Tasuku SUENAGA a.k.a. gunyarakun
ea9304e201 Update README.md
Now AFHTTPRequestSerializer always requires error parameter
2015-12-29 20:22:08 -08:00
Kevin Harwood
942c0c5b9f Preparing for the 3.0.4 release 2015-12-18 12:51:47 -06:00
Kevin Harwood
21bee52970 Merge pull request #3236 from AFNetworking/bug/notification_removed_twice
Fixed issue where `AFNSURLSessionTaskDidResumeNotification` was removed twice
2015-12-18 08:51:14 -06:00
Kevin Harwood
2e5be900e0 Fixed bug where the notification was removed twice 2015-12-18 07:55:46 -06:00
Kevin Harwood
7b22a26a6c Added Code Coverage to README 2015-12-17 09:44:57 -06:00
Kevin Harwood
4f6d461e6c updated .gitignore 2015-12-16 14:25:18 -06:00
Kevin Harwood
86ecc12050 Preparing for the 3.0.3 release 2015-12-16 13:49:48 -06:00
Kevin Harwood
6031cb663b Merge pull request #3233 from AFNetworking/code-coverage/response_serialization
Added tests for response serializers to increase test coverage
2015-12-16 11:40:09 -06:00
Kevin Harwood
73df7b9d84 Merge pull request #3229 from lessthanyouthink/fix-watchOS-image-response-serialization
Fixed `AFImageResponseSerializer` serializing on watchOS
2015-12-16 11:39:17 -06:00
Charles Joseph
75d83fd4e3 Fixed a typo (| vss ||). 2015-12-16 11:49:03 -05:00
Kevin Harwood
a56a22790e Added tests for response serializers to increase test coverage 2015-12-16 08:34:33 -06:00
Charles Joseph
b7f6ec1ceb Fixed AFImageResponseSerializer serializing on watchOS (issue #3228), as well as a couple other missing preprocessor checks for tvOS and watchOS. 2015-12-15 16:46:47 -05:00
Kevin Harwood
9be1743c53 Exposing AFPercentEscapedStringFromString for #3227 2015-12-15 14:42:10 -06:00
Kevin Harwood
d03552aca4 Exposed AFQueryStringFromParameters for public use (#3160) 2015-12-15 11:00:28 -06:00
Kevin Harwood
151da2238d Merge pull request #3225 from AFNetworking/code-coverage/httpsessionmanager
Increased testing code coverage for `AFHTTPSessionManager`
2015-12-14 17:14:38 -06:00
Kevin Harwood
c87a86ddce Increased testing code coverage for AFHTTPSessionManager 2015-12-14 16:12:18 -06:00
Kevin Harwood
301f1e3ecb Preparing for the 3.0.2 release 2015-12-14 14:28:35 -06:00
Kevin Harwood
ae28b51504 Merge pull request #3222 from lembacon/fix-unrecognized-selector
Fixed crash in `AFURLSessionManager` when resuming download task.
2015-12-14 12:02:23 -06:00
Chongyu Zhu
572e273beb AFURLSessionManagerTaskDelegate does not respond to the instance method -URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:. As long as there is already a downloadTaskDidResume block, this invocation should be removed. 2015-12-14 23:07:02 +08:00
Kevin Harwood
749bad1441 Merge pull request #3220 from eofs/uibutton-backgroundimage
Button image changed instead of background image
2015-12-14 08:46:00 -06:00
eofs
c5dc6d0f42 Test that background image changes 2015-12-14 15:33:24 +02:00
eofs
4ead780eee Button image changed instead of background image 2015-12-14 15:11:57 +02:00
Kevin Harwood
68e36deeae Preparing for the 3.0.1 release 2015-12-11 14:57:47 -06:00
Kevin Harwood
91858893ea Added an additional test for #3215 2015-12-11 12:19:48 -06:00
Kevin Harwood
1fec9249e8 Merge pull request #3215 from AFNetworking/bug/image_view_race_condition_alternate_fix
Fixed race condition with ImageView/Button image downloading when starting/cancelling/starting the same request
2015-12-11 11:54:01 -06:00
Kevin Harwood
79bd901510 Merge pull request #3216 from AFNetworking/travis/xcode72
Added Xcode 7.2 support to Travis
2015-12-11 11:48:03 -06:00
Kevin Harwood
a7a184f969 Added Xcode 7.2 support to Travis 2015-12-11 10:45:30 -06:00
Kevin Harwood
43d4847e39 Fixed race condition with image downloader when starting/cancelling/starting the same request
Alternate Solution

See https://github.com/Alamofire/AlamofireImage/issues/55 for details
2015-12-11 10:36:54 -06:00
Kevin Harwood
97aa010602 Fix for #3210 2015-12-10 13:36:52 -06:00
Kevin Harwood
f31b043cf2 Commenting out deploy for now 2015-12-10 11:36:23 -06:00
Kevin Harwood
cff0bf83d1 Updating travis to be ready for deployment 2015-12-10 11:01:03 -06:00
Kevin Harwood
a1b2ba71be Prepping for 3.0.0 release 2015-12-10 11:00:06 -06:00
Kevin Harwood
7cd23c284a Cleaning up test 2015-12-10 10:37:38 -06:00
Kevin Harwood
64048bfee8 Merge pull request #3209 from AFNetworking/experimental/travis
Added support for older versions of Xcode to Travis
2015-12-10 10:20:54 -06:00
Kevin Harwood
99501e36de Merge pull request #3208 from AFNetworking/bug/task_creation_queue
Improved task creation performance for iOS 8+
2015-12-10 10:09:37 -06:00
Kevin Harwood
19464132e9 Updating travis build matrix to support older versions of Xcode 2015-12-10 09:41:54 -06:00
Kevin Harwood
626d43b9b9 Added a test for #3205 2015-12-10 09:26:12 -06:00
nikitahils
b16cf7f8ce fix: dispatch_sync instead of dispatch_async call
(https://github.com/AFNetworking/AFNetworking/pull/3205)
2015-12-09 19:00:25 +03:00
Nikita G
8a2d8bb008 typo fix
(https://github.com/AFNetworking/AFNetworking/pull/3205)
2015-12-09 01:32:52 +03:00
nikitahils
1f9c0f9301 Non-blocking task creation feature on iOS 8 + versions with support of iOS 7 version with additional logic of fixing Apple bug in NSURLSession.
More about:
Open Radar: http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8)
Issue: https://github.com/AFNetworking/AFNetworking/issues/2093
2015-12-08 21:25:50 +03:00
Kevin Harwood
23088401f1 Updated README 2015-12-07 09:02:01 -06:00
Kevin Harwood
9dc4c0d57d Merge pull request #3199 from NextThought/new-line-at-eof
add newlines to end of .h files.
2015-12-07 08:57:10 -06:00
Chris Utz
c920f3ce81 add newlines to end of .h files. 2015-12-06 11:37:27 -06:00
Kevin Harwood
c893bd08b6 Updating for 3.0.0-beta.3 release 2015-12-04 14:51:42 -06:00
Kevin Harwood
3106e9d06f Merge pull request #3187 from AFNetworking/feature/progress_improvement
New Progress Reporting API using `NSProgress`
2015-12-04 13:39:44 -06:00
Kevin Harwood
423d83ed5e Changed __nullable to _Nullable 2015-12-04 11:18:22 -06:00
Kevin Harwood
2adeda5d44 Added a deprecated flag to older methods in the API 2015-12-04 11:18:22 -06:00
Kevin Harwood
86ade4e13f Fixed issue where task was being captured in a block 2015-12-04 11:18:22 -06:00
Kevin Harwood
210c260422 New Progress Reporting API
These changes expose a simpler, block based progress reporting API, while maintaining the ability for more advanced features using KVO on NSProgress.
2015-12-04 11:18:22 -06:00
Kevin Harwood
957f18ba37 Merge pull request #3196 from AFNetworking/feature/codecov
Added support for Codecov.io
2015-12-04 11:16:57 -06:00
Kevin Harwood
c626be395a Updating fastlane import to 0.0.4 2015-12-04 10:10:11 -06:00
Kevin Harwood
b32221e187 Updated to only use codecov for now. 2015-12-04 09:55:07 -06:00
Cédric Luthi
29e35f0520 Send code coverage information to Coveralls and Codecov 2015-12-04 09:50:42 -06:00
Kevin Harwood
7f6722c42d Updated fastfile to use 0.0.3 AFNetworking Fastlane 2015-12-04 08:44:34 -06:00
Kevin Harwood
6831f21300 Added failure step for travis 2015-12-04 08:35:26 -06:00
Kevin Harwood
65bb7ec9ab Merge pull request #3193 from 0xced/split-app-delegate
Split the iOS and OS X AppDelegate classes in the Example Project
2015-12-04 07:54:13 -06:00
Cédric Luthi
dc25d2253f Split the iOS and OS X AppDelegate classes
The only thing they share is their name.
2015-12-04 09:38:56 +01:00
Kevin Harwood
e9bed697f9 Cherry-picked changelog update from master 2015-12-03 16:30:27 -06:00
Kevin Harwood
f5388f0a57 Merge pull request #3191 from AFNetworking/change/improve_pinning_error
Changed SSL Pinning Error to be `NSURLErrorServerCertificateUntrusted`
2015-12-03 12:07:31 -06:00
Kevin Harwood
9e38c8e7f5 Change https domain to test 2015-12-03 11:23:35 -06:00
Kevin Harwood
2de951b5e1 Cleaning up logs 2015-12-03 11:06:16 -06:00
Cédric Luthi
b14e740c49 Add logs for NSURLSession(Data|Download)TaskDelegate 2015-12-03 11:05:12 -06:00
Cédric Luthi
88080eb0ca Log the session too 2015-12-03 11:05:12 -06:00
Cédric Luthi
2ce441eaba Log all NSURLSession delegate methods 2015-12-03 11:05:12 -06:00
Cédric Luthi
97eb2781f4 Display verbose logs in case of failure 2015-12-03 11:05:12 -06:00
Cédric Luthi
86a1196864 Add some debug logs
Trying to figure out why the `testInvalidServerTrustProducesCorrectError` test passes on iOS 9 and tvOS but fails on iOS 8 and OS X here: https://travis-ci.org/AFNetworking/AFNetworking/builds/92142622
2015-12-03 11:05:12 -06:00
Cédric Luthi
7b4d617fcf Better error when the server trust is invalid
When the server trust is invalid, using `NSURLSessionAuthChallengeCancelAuthenticationChallenge` terminates the task with an error from `NSURLErrorDomain` with code `NSURLErrorCancelled` (-999) which is indistinguishable from the error you get when calling the `cancel` method on a `NSURLSessionTask`.

Using `NSURLSessionAuthChallengeRejectProtectionSpace` instead produces a much better error:
Error Domain:           NSURLErrorDomain
Code:                   NSURLErrorServerCertificateUntrusted (-1202)
NSLocalizedDescription: "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “httpbin.org” which could put your confidential information at risk."

Fixes #3165
2015-12-03 11:05:12 -06:00
Kevin Harwood
4d9c1b505d Merge pull request #3188 from 0xced/base64
Removed AFBase64EncodedStringFromString static function
2015-12-02 16:00:52 -06:00
Cédric Luthi
f4f258000e Remove AFBase64EncodedStringFromString static function
Use the system provided `base64EncodedStringWithOptions:` method instead
2015-12-02 15:51:21 +01:00
Cédric Luthi
91a8654746 Add test for hidden basic authentication 2015-12-02 15:38:36 +01:00
Cédric Luthi
9e610eb6ec Set indentation settings to four spaces at the project level
Remake of 95b4f6c979 ;-)
2015-12-02 15:28:38 +01:00
Kevin Harwood
627277d502 Merge pull request #3177 from 0xced/conditional-compilation-cleanup
Removed code supporting conditional compilation for unsupported development configurations.
2015-12-01 10:46:21 -06:00
Cédric Luthi
76b048018a Remove #ifdef _SYSTEMCONFIGURATION_H leftovers 2015-11-25 01:18:21 +01:00
Cédric Luthi
5579be7f83 Remove #ifdef __UTTYPE__ conditional compilation
MobileCoreServices.h or CoreServices.h headers are always imported anyway.
2015-11-25 01:14:46 +01:00
Cédric Luthi
19097d695d Remove OS_OBJECT_HAVE_OBJC_SUPPORT conditional compilation
`OS_OBJECT_HAVE_OBJC_SUPPORT` is defined to 1 for iOS deployment target >= 6.0 and OS X deployment target >= 10.8.
2015-11-25 00:33:53 +01:00
Cédric Luthi
7d03e633ed Remove NS_DESIGNATED_INITIALIZER protections
Xcode 7 comes with the iOS 9 SDK which has NS_DESIGNATED_INITIALIZER defined in NSObjCRuntime.h
2015-11-25 00:29:33 +01:00
Kevin Harwood
b083b5dcf1 Added a test for #3163 2015-11-24 09:57:28 -06:00
Kevin Harwood
315be03700 Merge pull request #3174 from AFNetworking/feature/IPV6_support
Added support for IPv6 to Reachability
2015-11-23 14:49:35 -06:00
Kevin Harwood
6a1e6bb733 Updated to support the 3_0_0 branch 2015-11-23 13:26:04 -06:00
SAMUKEI
161e631a76 Fixed iOS 8.x test fail. 2015-11-23 13:23:12 -06:00
SAMUKEI
95757d5a57 Reachability support IPv6.
[Apple Document(Supporting IPv6 DNS64/NAT64 Networks)]
https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW26
2015-11-23 13:20:48 -06:00
Kevin Harwood
d96f126a0c Merge pull request #3166 from AFNetworking/feature/3166
Added support for Objective-C light weight generics
2015-11-23 13:10:45 -06:00
Kevin Harwood
1272e3e32d Fixed documentation error 2015-11-19 10:58:03 -06:00
Kevin Harwood
0ea8101abb Added support for generics 2015-11-19 10:13:45 -06:00
Kevin Harwood
70e319d520 Merge pull request #3168 from AFNetworking/pr/3167
Removed deprecated methods, properties, and notifications from AFN 2.x
2015-11-19 08:12:28 -08:00
Kevin Harwood
422847539f Removed deprecated methods, properties, and notifications 2015-11-19 09:36:01 -06:00
Kevin Harwood
c94242d62f Merge pull request #3164 from 0xced/pinnedCertificates-NSSet
Changed `pinnedCertificates` type in `AFSecurityPolicy` from `NSArray` to `NSSet`
2015-11-18 06:46:17 -08:00
Cédric Luthi
352f851549 Change pinnedCertificates type from NSArray to NSSet
Pinned certificates were deduplicated anyway, so let’s make it clear directly in the API.
2015-11-18 13:33:45 +01:00
Kevin Harwood
94023386c3 Prepping for 3.0.0-beta.2 2015-11-13 12:54:05 -06:00
Kevin Harwood
daf0a509aa Updated changelog from 2.x branch 2015-11-13 11:50:55 -06:00
Kevin Harwood
99b48aeb83 Merge pull request #3159 from p4checo/fix-incomplete-chain-certificate-validation-3_0_0
Fixed certificate validation for servers providing incomplete chains
2015-11-13 11:48:58 -06:00
André Pacheco Neves
468c2baa03 Fix certificate validation for servers providing incomplete chains
Some servers send incomplete certificate chains (without the Root CA), which
cause issues in the latest version's (2.6.3) certificate pinning mechanism.
In these cases, when `AFSecurityPolicy`s `-evaluateServerTrust:` invokes
`AFCertificateTrustChainForServerTrust(serverTrust)` (prior to setting the
anchor), the Root CA isn't present (the server didn't send it). Afterwards,
even though `AFServerTrustIsValid(serverTrust)` succeeds, the next validation
fails since no pinned certificate matches any of the `serverCertificates`.

By fetching the `AFCertificateTrustChainForServerTrust(serverTrust)` *after*
the `AFServerTrustIsValid(serverTrust)` validation, the complete chain is
obtained and the Root CAs match (pinned vs validated).

A slight optimization was also made when validating if the `serverTrust`
certificates contain the `pinnedCertificates`, looping in reverse order and
returning after finding the first match.
2015-11-13 17:36:16 +00:00
Kevin Harwood
1855f3c434 Merge pull request #3153 from AFNetworking/fix/2502
Fixed bug in AFMultipartBodyStream that may cause the input stream to read more bytes than required.
2015-11-13 08:37:26 -06:00
Kevin Harwood
1d649bb6e9 Merge pull request #3154 from chairish/loudnate/3_0_0/nullability
Added nullability attributes to response object in success block
2015-11-13 08:36:13 -06:00
Nathan Racklyeft
60f93d79c2 Adding missing nullability attributes
See #3149
2015-11-12 14:38:18 -08:00
bang
5f4ef6add6 fix bug for AFMultipartBodyStream
may cause inputStream read more bytes than the setting value numberOfBytesInPacket
2015-11-12 16:31:44 -06:00
Kevin Harwood
2a6cf844ae Removing travis deploy step until beta is complete 2015-11-12 16:12:33 -06:00
Kevin Harwood
815f7d9019 Updated project file to help with versioning 2015-11-12 15:52:54 -06:00
Kevin Harwood
3695d2ada3 Cleaned up unused code in test 2015-11-12 15:24:33 -06:00
Kevin Harwood
083ab12581 Merge pull request #3152 from AFNetworking/fix/notification_race_condition
Fixed race condition crash from Resume/Suspend task notifications
2015-11-12 15:11:04 -06:00
Kevin Harwood
e3af1fde9c Fixed race condition crash from Resume/Suspend task notifications
References #2439 and #3023
2015-11-12 14:36:46 -06:00
Kevin Harwood
cbeca5da39 Migrated to common timeout handler for tests 2015-11-12 14:29:42 -06:00
Kevin Harwood
829c07cfc0 Merge pull request #3148 from AFNetworking/fastlane
Migrated to Fastlane for CI and Deployment
2015-11-12 14:28:48 -06:00
Kevin Harwood
c3c5538e45 Cleaned up .gitignore 2015-11-12 12:00:18 -06:00
Kevin Harwood
bc53fbe1c6 Switching to HTTPS 2015-11-12 12:00:18 -06:00
Kevin Harwood
3d17369f92 Removed test files 2015-11-12 12:00:18 -06:00
Kevin Harwood
ae48b26965 Added fastlane support 2015-11-12 12:00:18 -06:00
Kevin Harwood
5fe7ecbb6d Merge pull request #3151 from AFNetworking/tests/stabilization
Cleaning up tests that were causing stability issues
2015-11-12 11:59:57 -06:00
Kevin Harwood
52bd49b057 Cleaning up tests that were causing stability issues 2015-11-12 11:07:25 -06:00
Kevin Harwood
8c6038c895 Merge pull request #3150 from rsilva/imageDownloaderStall
Fixed AFImageDownloader stalling after numerous failures
2015-11-12 11:07:05 -06:00
Rick Silva
cfed41d1cf Fix AFImageDownloader stalling after number of failures reaches maximumActiveDownloads.
The active task count was only being decremented after success. Once
the number of failures reaches the maximumActiveDownloads, no more
tasks were being started.
2015-11-12 11:42:44 -05:00
Kevin Harwood
07cb3fd9a2 Fixed issue clang analyzer warning suppression that preventing building under some project configurations
Fix for #3138
2015-11-11 08:26:08 -06:00
Kevin Harwood
39296373cc Merge pull request #3146 from AFNetworking/fix/3145
Fixed crash that occurred if you passed a nil URL to the image view
2015-11-10 09:53:27 -06:00
Kevin Harwood
848a1905f5 Fixed crash that occurred if you passed a nil URL to the image view
Fix for #3145
2015-11-10 08:24:49 -06:00
Kevin Harwood
16972a42a2 Merge pull request #3134 from AFNetworking/3.0.0fix/3117
Fixed race condition in reachability callback delivery
2015-11-06 15:28:46 -06:00
Kevin Harwood
695e6d5bca Updated reachability test 2015-11-06 13:26:12 -06:00
Kevin Harwood
1ea9b708ec Fixed race condition in reachability callback delivery
Bringing over fix from #3117
2015-11-06 09:58:42 -06:00
Kevin Harwood
7d8fba1dbb Suppressed false positive memory leak warning in Reachability Manager
Fix for #3110
2015-11-06 09:45:39 -06:00
Kevin Harwood
e501c8e37b Fixed swift interop issue that prevented returning a nil NSURL for a download task
Fix for #3104 and #3043
2015-11-06 09:44:51 -06:00
Kevin Harwood
ad83475738 Bringing #3130 into 3_0_0 2015-11-06 09:43:53 -06:00
Kevin Harwood
95f09f0cab Merge pull request #3111 from AFNetworking/feature/unique_reachability_managers
Added a method to create a unique reachability manager
2015-11-06 07:54:44 -06:00
Kevin Harwood
ad6c7c3653 Merge pull request #3126 from AFNetworking/fix/3114_webview_warning
Fixed warnings generated in UIWebView category
2015-11-06 07:53:17 -06:00
Kevin Harwood
8c57f945ed Fixed warnings generated in UIWebView category
commit resolves #3114
2015-11-05 18:16:08 -06:00
Kevin Harwood
ce7cd80271 Merge pull request #3124 from AFNetworking/3.0_feature/improve_test_reliability
Improved testing reliability for continuous integration
2015-11-05 18:11:46 -06:00
Kevin Harwood
39abf77fe6 Removed tests to improve ci reliability 2015-11-04 10:02:05 -06:00
Mo Bitar
c093cd990a Add unique reachability manager (#3014) 2015-11-03 09:02:10 -06:00
Kevin Harwood
ef7d55b955 Updating Test Target for new version of Cocoapods 2015-10-27 14:24:08 -05:00
Kevin Harwood
238814eeec Updated project settings for Xcode 7.1 2015-10-27 14:22:56 -05:00
Kevin Harwood
6a3104eeaf Removed additional warnings 2015-10-27 14:22:33 -05:00
Steve Christensen
de7cfbdf84 Added some casts to fix compiler errors with stricy build settings. Renamed some function parameters to avoid reserved keyword issues if the compiler is set for Obj-C++. 2015-10-27 14:22:30 -05:00
Raphael Doehring
caaa997aec Fix README link to WWDC session …
Apple changed the format WWDC video URLs.
2015-10-27 10:51:57 -05:00
Kevin Harwood
cbf46f2ce4 Removed reachability test to improve travis stability 2015-10-26 14:45:02 -05:00
Kevin Harwood
2107169cb8 Removed unstable test 2015-10-26 14:31:04 -05:00
Kevin Harwood
c2392cb80f Updated reachability to only return if reachable 2015-10-26 11:29:07 -05:00
Kevin Harwood
c8193f71d9 Removing test that will not reliably pass on travis 2015-10-26 10:07:07 -05:00
Kevin Harwood
b4227d5ee7 Returning nil for cache response 2015-10-26 09:52:29 -05:00
Kevin Harwood
2438f91eb0 Extended timeouts for reachability 2015-10-26 09:49:04 -05:00
Kevin Harwood
a53d719607 Added additional test check to caching tests 2015-10-26 09:38:32 -05:00
Kevin Harwood
25b5c20c79 Attempt at improving cache test reliability 2015-10-26 09:26:24 -05:00
Kevin Harwood
f8abf69a89 Merge pull request #3094 from AFNetworking/3.0_feature/network_activity_delay
A refactored version of #3086 allowing a delayed start to the network activity indicator
2015-10-26 09:23:44 -05:00
Kevin Harwood
be56e159ff - Added synchronized block for accessing activity count
- Refactored test class to begin using common timeout across all classes
2015-10-26 08:58:27 -05:00
Kevin Harwood
1a42db67b9 A refactored version of #3086 allowing a delayed start to the network activity indicator 2015-10-23 08:43:16 -05:00
Kevin Harwood
22a9338413 Added tvOS, and other small refactors 2015-10-22 09:12:11 -05:00
Kevin Harwood
3fd613d947 Refactored travis file 2015-10-22 08:47:36 -05:00
Kevin Harwood
fe192915b7 Added a 9.1 test target for travis 2015-10-22 08:33:51 -05:00
Kevin Harwood
8c285e2b01 Updated to the 9.1 simulator 2015-10-22 08:20:13 -05:00
Kevin Harwood
f299b1d556 Updated travis to xcode7.1 2015-10-22 08:09:27 -05:00
Kevin Harwood
b2c449c833 Additional updates for #2794 2015-10-21 14:10:14 -05:00
Oleg Naumenko
0a84afe6ce fix memory leak 2015-10-21 14:10:14 -05:00
Oleg Naumenko
c23c37ab4a fix memory leak in NSURLSession 2015-10-21 14:10:14 -05:00
Kevin Harwood
92006270b1 Added test for #3057 2015-10-21 09:28:03 -05:00
Takeru Chuganji
974ca8ffea fix nullablity 2015-10-21 09:27:46 -05:00
Takeru Chuganji
75fbdf4728 add missing __nullable attributes 2015-10-21 09:26:52 -05:00
Kevin Harwood
6e89efe5aa Cherry-picked change from #3063 2015-10-21 08:49:24 -05:00
Kevin Harwood
f573fdb823 Changed id to instancetype 2015-10-21 08:16:59 -05:00
Kevin Harwood
51b019210d AFSecurityPolicy now conforms to NSSecureCoding and NSCopying for #2887 2015-10-21 08:16:54 -05:00
Kevin Harwood
315b18991d Added two additional tests for caching behavior on AFURLSessionManager 2015-10-19 10:39:48 -05:00
Kevin Harwood
e2eb31a490 Added badges to the readme 2015-10-16 15:22:18 -05:00
Kevin Harwood
30641fbf89 Updated readme 2015-10-16 15:18:32 -05:00
Kevin Harwood
1d7f58b6da Updated podspec 2015-10-16 14:40:33 -05:00
Kevin Harwood
a0b08ecfc7 Merge pull request #3068 from AFNetworking/convert_example_to_frameworks
Converted example to use frameworks
2015-10-16 14:00:12 -05:00
Kevin Harwood
44861fdc5f Updated travis to build example from workspace 2015-10-16 13:32:48 -05:00
Kevin Harwood
7117b5d594 Converted example to use frameworks 2015-10-16 10:19:22 -05:00
Kevin Harwood
7e54e56ae8 Merge pull request #3064 from AFNetworking/kylef/instancetype
Use `instancetype` where applicable
2015-10-15 13:35:27 -05:00
Kyle Fuller
778a1aa9c7 Use instancetype where applicable 2015-10-15 11:01:37 -07:00
155 changed files with 5622 additions and 1986 deletions

2
.codecov.yml Normal file
View File

@ -0,0 +1,2 @@
ignore:
- "Tests"

10
.gitignore vendored
View File

@ -19,3 +19,13 @@ DerivedData
Tests/Pods
Tests/Podfile.lock
Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/
AFNetworking.framework.zip
# Fastlane
/fastlane/report.xml
/fastlane/.env*private*
fastlane/test-output/*
Carthage/Build
fastlane/README.md

View File

@ -1,35 +1,51 @@
language: objective-c
osx_image: xcode7
osx_image: xcode11
sudo: false
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
matrix:
- DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="AFNetworking iOS" SDK=iphonesimulator9.0 BUILD_EXAMPLE="YES" POD_LINT="YES" EXAMPLE_SCHEME="iOS Example"
- DESTINATION="OS=8.2,name=iPhone 5" SCHEME="AFNetworking iOS" SDK=iphonesimulator9.0 BUILD_EXAMPLE="YES" POD_LINT="NO" EXAMPLE_SCHEME="iOS Example"
- DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="AFNetworking iOS" SDK=iphonesimulator9.0 BUILD_EXAMPLE="YES" POD_LINT="NO" EXAMPLE_SCHEME="iOS Example"
- DESTINATION="OS=8.4,name=iPhone 6" SCHEME="AFNetworking iOS" SDK=iphonesimulator9.0 BUILD_EXAMPLE="YES" POD_LINT="NO" EXAMPLE_SCHEME="iOS Example"
- DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="AFNetworking iOS" SDK=iphonesimulator9.0 BUILD_EXAMPLE="YES" POD_LINT="NO" EXAMPLE_SCHEME="iOS Example"
- DESTINATION="arch=x86_64" SCHEME="AFNetworking OS X" SDK=macosx10.11 BUILD_EXAMPLE="NO" POD_LINT="NO" EXAMPLE_SCHEME="OS X Example"
- LANGUAGE=en_US.UTF-8
- FASTLANE_LANE=ci_commit
matrix:
include:
- osx_image: xcode11
env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default
- osx_image: xcode11
env: FASTLANE_ENV=ios13_xcode11
- osx_image: xcode11
env: FASTLANE_ENV=tvos13_xcode11
- osx_image: xcode11
env: FASTLANE_ENV=osx
- osx_image: xcode10
env: FASTLANE_ENV=ios12_xcode10
- osx_image: xcode9.4
env: FASTLANE_ENV=ios11_xcode94
- osx_image: xcode9.3
env: FASTLANE_ENV=ios11_xcode93
- osx_image: xcode9.2
env: FASTLANE_ENV=ios11_xcode92
- osx_image: xcode9.1
env: FASTLANE_ENV=ios11_xcode91
- osx_image: xcode9
env: FASTLANE_ENV=ios11_xcode9
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install fastlane --no-document --quiet
- gem install cocoapods --no-document --quiet
script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -project AFNetworking.xcodeproj -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION"
-configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c
- xcodebuild -project AFNetworking.xcodeproj -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION"
-configuration Release ONLY_ACTIVE_ARCH=NO test | xcpretty -c
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -project "Example/AFNetworking Example.xcodeproj" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION"
-configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
fi
- if [ $BUILD_EXAMPLE == "YES" ]; then
xcodebuild -project "Example/AFNetworking Example.xcodeproj" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION"
-configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
fi
- if [ $POD_LINT == "YES" ]; then
pod lib lint --quick;
- 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

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '3.0.0-beta.1'
s.version = '3.2.1'
s.license = 'MIT'
s.summary = 'A delightful iOS and OS X networking framework.'
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
@ -27,7 +27,7 @@ Pod::Spec.new do |s|
EOS
s.prefix_header_contents = pch_AF
s.ios.deployment_target = '7.0'
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
s.watchos.deployment_target = '2.0'
s.tvos.deployment_target = '9.0'
@ -47,7 +47,7 @@ EOS
end
s.subspec 'Reachability' do |ss|
ss.ios.deployment_target = '7.0'
ss.ios.deployment_target = '8.0'
ss.osx.deployment_target = '10.9'
ss.tvos.deployment_target = '9.0'
@ -61,14 +61,16 @@ EOS
ss.dependency 'AFNetworking/Serialization'
ss.ios.dependency 'AFNetworking/Reachability'
ss.osx.dependency 'AFNetworking/Reachability'
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'
ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h', 'AFNetworking/AFCompatibilityMacros.h'
end
s.subspec 'UIKit' do |ss|
ss.platform = :ios
ss.ios.deployment_target = '8.0'
ss.tvos.deployment_target = '9.0'
ss.dependency 'AFNetworking/NSURLSession'
ss.public_header_files = 'UIKit+AFNetworking/*.h'

View File

@ -3,10 +3,21 @@
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 */; };
1F8482C0220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
1F8482C1220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; };
1F96D2A4203649560085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F96D2A5203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F96D2A6203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F96D2A7203649580085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
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 */; };
297824A51BC2D69A0041C395 /* adn_1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 297824A11BC2D69A0041C395 /* adn_1.cer */; };
@ -47,10 +58,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 */; };
2987B0DB1BC40AF300179A4C /* httpbinorg_01162016.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C711BC2C88F00FD3B3E /* httpbinorg_01162016.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 */; };
@ -74,14 +81,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 */; };
298D7CC41BC2CAA100FD3B3E /* httpbinorg_01162016.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C711BC2C88F00FD3B3E /* httpbinorg_01162016.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 */; };
298D7CC81BC2CAA200FD3B3E /* httpbinorg_01162016.cer in Resources */ = {isa = PBXBuildFile; fileRef = 298D7C711BC2C88F00FD3B3E /* httpbinorg_01162016.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 */; };
@ -141,6 +140,9 @@
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 */; };
29D96E7A1BCC3D6000F571A5 /* AFHTTPSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 299522461BBF125A00859F49 /* AFHTTPSessionManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
29D96E7C1BCC3D6000F571A5 /* AFSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2995224B1BBF125A00859F49 /* AFSecurityPolicy.h */; settings = {ATTRIBUTES = (Public, ); }; };
29D96E7D1BCC3D6000F571A5 /* AFURLRequestSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 2995224D1BBF125A00859F49 /* AFURLRequestSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -168,6 +170,44 @@
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 */; };
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 */; };
5F4323BE1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */; };
5F4323BF1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */; };
5F4323C01BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */; };
5F4323C11BF63741003B8749 /* google.com.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B51BF63741003B8749 /* google.com.cer */; };
5F4323C21BF63741003B8749 /* google.com.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B51BF63741003B8749 /* google.com.cer */; };
5F4323C31BF63741003B8749 /* google.com.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323B51BF63741003B8749 /* google.com.cer */; };
5F4323CD1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323BA1BF63741003B8749 /* GoogleInternetAuthorityG2.cer */; };
5F4323CE1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323BA1BF63741003B8749 /* GoogleInternetAuthorityG2.cer */; };
5F4323CF1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323BA1BF63741003B8749 /* GoogleInternetAuthorityG2.cer */; };
5F4323D51BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */; };
5F4323D61BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */; };
5F4323D71BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */; };
5F4323D91BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */; };
5F4323DA1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */; };
5F4323DB1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */; };
5F4323DD1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
5F4323DE1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
5F4323DF1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */ = {isa = PBXBuildFile; fileRef = 5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */; };
E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */; };
E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */; };
E2B10D94233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
E2B10D95233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
E2B10D96233035100004E005 /* Amazon.cer in Resources */ = {isa = PBXBuildFile; fileRef = E2B10D8D233035100004E005 /* Amazon.cer */; };
E91164651DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
E91164661DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
E91164671DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -195,17 +235,17 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = "<group>"; };
1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFCompatibilityMacros.h; sourceTree = "<group>"; };
1F8482BF220F386200718111 /* httpbinorg_03172020.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_03172020.cer; sourceTree = "<group>"; };
2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = "<group>"; };
297824A01BC2D69A0041C395 /* adn_0.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_0.cer; path = ADNNetServerTrustChain/adn_0.cer; sourceTree = "<group>"; };
297824A11BC2D69A0041C395 /* adn_1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_1.cer; path = ADNNetServerTrustChain/adn_1.cer; sourceTree = "<group>"; };
297824A21BC2D69A0041C395 /* adn_2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_2.cer; path = ADNNetServerTrustChain/adn_2.cer; sourceTree = "<group>"; };
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 = "<group>"; };
298D7C6F1BC2C88F00FD3B3E /* COMODO_RSA_Certification_Authority.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Certification_Authority.cer; sourceTree = "<group>"; };
298D7C701BC2C88F00FD3B3E /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = COMODO_RSA_Domain_Validation_Secure_Server_CA.cer; sourceTree = "<group>"; };
298D7C711BC2C88F00FD3B3E /* httpbinorg_01162016.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_01162016.cer; sourceTree = "<group>"; };
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 = "<group>"; };
298D7C791BC2C88F00FD3B3E /* AltName.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = AltName.cer; sourceTree = "<group>"; };
298D7C7A1BC2C88F00FD3B3E /* foobar.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = foobar.com.cer; sourceTree = "<group>"; };
@ -265,6 +305,21 @@
299522991BBF13C700859F49 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+AFNetworking.m"; sourceTree = "<group>"; };
2995229A1BBF13C700859F49 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+AFNetworking.h"; sourceTree = "<group>"; };
2995229B1BBF13C700859F49 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = "<group>"; };
29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCompoundResponseSerializerTests.m; sourceTree = "<group>"; };
29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIWebViewTests.m; sourceTree = "<group>"; };
2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLParserResponseSerializerTests.m; sourceTree = "<group>"; };
2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLDocumentResponseSerializerTests.m; sourceTree = "<group>"; };
5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Equifax_Secure_Certificate_Authority_Root.cer; sourceTree = "<group>"; };
5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "GeoTrust_Global_CA-cross.cer"; sourceTree = "<group>"; };
5F4323B51BF63741003B8749 /* google.com.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.com.cer; sourceTree = "<group>"; };
5F4323BA1BF63741003B8749 /* GoogleInternetAuthorityG2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = GoogleInternetAuthorityG2.cer; sourceTree = "<group>"; };
5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath1; sourceTree = "<group>"; };
5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = GoogleComServerTrustChainPath2; sourceTree = "<group>"; };
5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GeoTrust_Global_CA_Root.cer; sourceTree = "<group>"; };
E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Starfield Services Root Certificate Authority - G2.cer"; sourceTree = "<group>"; };
E2B10D8C233035100004E005 /* Amazon Root CA 1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Amazon Root CA 1.cer"; sourceTree = "<group>"; };
E2B10D8D233035100004E005 /* Amazon.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = Amazon.cer; sourceTree = "<group>"; };
E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPropertyListRequestSerializerTests.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -339,6 +394,7 @@
298D7C6D1BC2C88F00FD3B3E /* HTTPBin.org */,
298D7C771BC2C88F00FD3B3E /* logo.png */,
298D7C781BC2C88F00FD3B3E /* SelfSigned */,
5F4323B21BF63741003B8749 /* Google.com */,
);
path = Resources;
sourceTree = "<group>";
@ -357,11 +413,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 */,
298D7C711BC2C88F00FD3B3E /* httpbinorg_01162016.cer */,
1F8482BF220F386200718111 /* httpbinorg_03172020.cer */,
);
path = HTTPBin.org;
sourceTree = "<group>";
@ -394,8 +450,13 @@
298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */,
298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */,
298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */,
298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */,
2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */,
2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */,
298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */,
E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */,
29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */,
1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */,
298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */,
298D7C891BC2C88F00FD3B3E /* AFSecurityPolicyTests.m */,
298D7C8F1BC2C88F00FD3B3E /* AFURLSessionManagerTests.m */,
);
@ -411,6 +472,8 @@
298D7C8C1BC2C88F00FD3B3E /* AFUIActivityIndicatorViewTests.m */,
298D7C8D1BC2C88F00FD3B3E /* AFUIImageViewTests.m */,
298D7C8E1BC2C88F00FD3B3E /* AFUIRefreshControlTests.m */,
2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */,
29F5EF021C47E64F008B976A /* AFUIWebViewTests.m */,
);
name = "AFNetworking UIKit Tests";
sourceTree = "<group>";
@ -424,7 +487,10 @@
298D7C561BC2C88F00FD3B3E /* Tests */,
2995223A1BBF104D00859F49 /* Products */,
);
indentWidth = 4;
sourceTree = "<group>";
tabWidth = 4;
usesTabs = 0;
};
2995223A1BBF104D00859F49 /* Products */ = {
isa = PBXGroup;
@ -433,7 +499,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 */,
);
@ -453,6 +519,7 @@
299522451BBF125A00859F49 /* AFNetworking */ = {
isa = PBXGroup;
children = (
1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */,
299522461BBF125A00859F49 /* AFHTTPSessionManager.h */,
299522471BBF125A00859F49 /* AFHTTPSessionManager.m */,
299522491BBF125A00859F49 /* AFNetworkReachabilityManager.h */,
@ -496,6 +563,20 @@
path = "UIKit+AFNetworking";
sourceTree = "<group>";
};
5F4323B21BF63741003B8749 /* Google.com */ = {
isa = PBXGroup;
children = (
5F4323D41BF63CB0003B8749 /* GoogleComServerTrustChainPath1 */,
5F4323D81BF63CBA003B8749 /* GoogleComServerTrustChainPath2 */,
5F4323B31BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer */,
5F4323DC1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer */,
5F4323B41BF63741003B8749 /* GeoTrust_Global_CA-cross.cer */,
5F4323BA1BF63741003B8749 /* GoogleInternetAuthorityG2.cer */,
5F4323B51BF63741003B8749 /* google.com.cer */,
);
path = Google.com;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@ -511,6 +592,7 @@
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 */,
@ -535,6 +617,7 @@
2995225E1BBF125A00859F49 /* AFURLSessionManager.h in Headers */,
2995225C1BBF125A00859F49 /* AFURLResponseSerialization.h in Headers */,
299522A21BBF13C700859F49 /* UIActivityIndicatorView+AFNetworking.h in Headers */,
1F96D2A4203649560085FC3F /* AFCompatibilityMacros.h in Headers */,
2995223D1BBF104D00859F49 /* AFNetworking.h in Headers */,
299522B01BBF13C700859F49 /* UIWebView+AFNetworking.h in Headers */,
299522AC1BBF13C700859F49 /* UIProgressView+AFNetworking.h in Headers */,
@ -550,6 +633,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 */,
@ -564,6 +648,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 */,
@ -628,9 +713,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 */,
@ -641,9 +726,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 */ = {
@ -682,9 +767,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 */,
@ -695,7 +780,7 @@
);
dependencies = (
);
name = "AFNetworking OS X";
name = "AFNetworking macOS";
productName = "AFNetworking OS X";
productReference = 299522771BBF136400859F49 /* AFNetworking.framework */;
productType = "com.apple.product-type.framework";
@ -706,7 +791,7 @@
299522301BBF104D00859F49 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = AFNetworking;
TargetAttributes = {
2987B0A41BC408A200179A4C = {
@ -714,9 +799,11 @@
};
2987B0AD1BC408A200179A4C = {
CreatedOnToolsVersion = 7.1;
ProvisioningStyle = Manual;
};
298D7C3A1BC2C79500FD3B3E = {
CreatedOnToolsVersion = 7.0.1;
ProvisioningStyle = Manual;
};
298D7C491BC2C7B200FD3B3E = {
CreatedOnToolsVersion = 7.0.1;
@ -733,7 +820,7 @@
};
};
buildConfigurationList = 299522331BBF104D00859F49 /* Build configuration list for PBXProject "AFNetworking" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 6.3";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
@ -746,10 +833,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 */,
);
};
@ -769,17 +856,24 @@
files = (
2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */,
2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */,
2987B0D91BC40AF300179A4C /* COMODO_RSA_Certification_Authority.cer in Resources */,
2987B0DB1BC40AF300179A4C /* httpbinorg_01162016.cer in Resources */,
E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */,
2987B0DF1BC40AFB00179A4C /* NoDomains.cer in Resources */,
2987B0D41BC40AE900179A4C /* adn_1.cer in Resources */,
2987B0DD1BC40AFB00179A4C /* AltName.cer in Resources */,
2987B0D71BC40AF000179A4C /* HTTPBinOrgServerTrustChain in Resources */,
2987B0D31BC40AE900179A4C /* adn_0.cer in Resources */,
2987B0DC1BC40AF600179A4C /* logo.png in Resources */,
2987B0D81BC40AF300179A4C /* AddTrust_External_CA_Root.cer in Resources */,
2987B0D51BC40AE900179A4C /* adn_2.cer in Resources */,
2987B0DA1BC40AF300179A4C /* COMODO_RSA_Domain_Validation_Secure_Server_CA.cer in Resources */,
5F4323D71BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
E2B10D96233035100004E005 /* Amazon.cer in Resources */,
5F4323DB1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
5F4323BD1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
5F4323DF1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */,
5F4323C01BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
5F4323CF1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
5F4323C31BF63741003B8749 /* google.com.cer in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -787,19 +881,26 @@
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 */,
298D7CC81BC2CAA200FD3B3E /* httpbinorg_01162016.cer in Resources */,
E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
1F8482C0220F386200718111 /* httpbinorg_03172020.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 */,
298D7CC01BC2CA9D00FD3B3E /* NoDomains.cer in Resources */,
298D7CE01BC2CB5A00FD3B3E /* ADNNetServerTrustChain in Resources */,
298D7CBE1BC2CA9D00FD3B3E /* AltName.cer in Resources */,
5F4323D51BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
E2B10D94233035100004E005 /* Amazon.cer in Resources */,
5F4323D91BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
5F4323BB1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
5F4323DD1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */,
5F4323BE1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
5F4323CD1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
5F4323C11BF63741003B8749 /* google.com.cer in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -807,19 +908,26 @@
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 */,
298D7CC41BC2CAA100FD3B3E /* httpbinorg_01162016.cer in Resources */,
E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */,
1F8482C1220F386200718111 /* httpbinorg_03172020.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 */,
298D7CBD1BC2CA9C00FD3B3E /* NoDomains.cer in Resources */,
298D7CE11BC2CB5A00FD3B3E /* ADNNetServerTrustChain in Resources */,
298D7CBB1BC2CA9C00FD3B3E /* AltName.cer in Resources */,
5F4323D61BF63CB0003B8749 /* GoogleComServerTrustChainPath1 in Resources */,
E2B10D95233035100004E005 /* Amazon.cer in Resources */,
5F4323DA1BF63CBA003B8749 /* GoogleComServerTrustChainPath2 in Resources */,
5F4323BC1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */,
5F4323CE1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */,
E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */,
5F4323DE1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */,
5F4323BF1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */,
5F4323C21BF63741003B8749 /* google.com.cer in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -876,13 +984,17 @@
2987B0E31BC40B0900179A4C /* AFUIActivityIndicatorViewTests.m in Sources */,
2987B0D01BC40A7600179A4C /* AFSecurityPolicyTests.m in Sources */,
2987B0CB1BC40A7600179A4C /* AFHTTPResponseSerializationTests.m in Sources */,
1BF9F9621C87843300F1F35A /* AFImageResponseSerializerTests.m in Sources */,
2987B0CE1BC40A7600179A4C /* AFNetworkReachabilityManagerTests.m in Sources */,
2987B0E01BC40B0900179A4C /* AFAutoPurgingImageCacheTests.m in Sources */,
2987B0CA1BC40A7600179A4C /* AFHTTPRequestSerializationTests.m in Sources */,
29D341411C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */,
2987B0E11BC40B0900179A4C /* AFImageDownloaderTests.m in Sources */,
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;
};
@ -890,10 +1002,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
29D3413F1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */,
2960BAC31C1B2F1A00BA02F0 /* AFUIButtonTests.m in Sources */,
298D7C961BC2C94400FD3B3E /* AFTestCase.m in Sources */,
E91164651DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */,
298D7CB11BC2CA6E00FD3B3E /* AFHTTPRequestSerializationTests.m in Sources */,
297824AE1BC2DBD80041C395 /* AFUIActivityIndicatorViewTests.m in Sources */,
297824AD1BC2DBA40041C395 /* AFNetworkActivityManagerTests.m in Sources */,
1BF9F9601C87832B00F1F35A /* AFImageResponseSerializerTests.m in Sources */,
298D7CDD1BC2CAF700FD3B3E /* AFSecurityPolicyTests.m in Sources */,
298D7CD31BC2CAE800FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */,
297824B01BC2DC2D0041C395 /* AFUIImageViewTests.m in Sources */,
@ -902,6 +1018,8 @@
297824AA1BC2DAD80041C395 /* AFAutoPurgingImageCacheTests.m in Sources */,
298D7C981BC2CA2500FD3B3E /* AFURLSessionManagerTests.m in Sources */,
297824AC1BC2DB450041C395 /* AFImageDownloaderTests.m in Sources */,
29F5EF031C47E64F008B976A /* AFUIWebViewTests.m in Sources */,
2D4563901DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */,
298D7CD51BC2CAEC00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */,
298D7CD71BC2CAEF00FD3B3E /* AFJSONSerializationTests.m in Sources */,
298D7CDB1BC2CAF500FD3B3E /* AFPropertyListResponseSerializerTests.m in Sources */,
@ -913,12 +1031,17 @@
buildActionMask = 2147483647;
files = (
298D7CD41BC2CAE900FD3B3E /* AFHTTPResponseSerializationTests.m in Sources */,
29D341401C20D46400A7D266 /* AFCompoundResponseSerializerTests.m in Sources */,
298D7CB21BC2CA6E00FD3B3E /* AFHTTPRequestSerializationTests.m in Sources */,
E91164661DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m in Sources */,
298D7CDE1BC2CAF800FD3B3E /* AFSecurityPolicyTests.m in Sources */,
1BF9F9611C87843200F1F35A /* AFImageResponseSerializerTests.m in Sources */,
298D7C971BC2C94500FD3B3E /* AFTestCase.m in Sources */,
298D7CD81BC2CAF000FD3B3E /* AFJSONSerializationTests.m in Sources */,
2D4563941DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m in Sources */,
298D7CDC1BC2CAF500FD3B3E /* AFPropertyListResponseSerializerTests.m in Sources */,
298D7CD61BC2CAED00FD3B3E /* AFHTTPSessionManagerTests.m in Sources */,
2D4563911DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */,
298D7CDA1BC2CAF300FD3B3E /* AFNetworkReachabilityManagerTests.m in Sources */,
298D7C991BC2CA2600FD3B3E /* AFURLSessionManagerTests.m in Sources */,
);
@ -986,7 +1109,7 @@
};
298D7C511BC2C7B200FD3B3E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 299522761BBF136400859F49 /* AFNetworking OS X */;
target = 299522761BBF136400859F49 /* AFNetworking macOS */;
targetProxy = 298D7C501BC2C7B200FD3B3E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@ -995,12 +1118,15 @@
2987B0B61BC408A200179A4C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = marker;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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";
@ -1017,12 +1143,15 @@
2987B0B71BC408A200179A4C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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";
@ -1039,7 +1168,10 @@
2987B0B81BC408A200179A4C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "";
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_NAME = "$(TARGET_NAME)";
@ -1051,7 +1183,10 @@
2987B0B91BC408A200179A4C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "";
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_NAME = "$(TARGET_NAME)";
@ -1063,9 +1198,11 @@
298D7C431BC2C79500FD3B3E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "";
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
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";
@ -1076,9 +1213,11 @@
298D7C441BC2C79500FD3B3E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "";
DEVELOPMENT_TEAM = "";
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
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";
@ -1089,10 +1228,11 @@
298D7C531BC2C7B200FD3B3E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
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";
@ -1104,10 +1244,11 @@
298D7C541BC2C7B200FD3B3E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch";
INFOPLIST_FILE = "$(PROJECT_DIR)/Tests/Info.plist";
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";
@ -1122,16 +1263,33 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
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;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
@ -1147,11 +1305,24 @@
"DEBUG=1",
"$(inherited)",
);
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
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;
@ -1173,16 +1344,33 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_CODE_COVERAGE = NO;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
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;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
@ -1192,11 +1380,24 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES;
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
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;
@ -1215,15 +1416,17 @@
299522421BBF104D00859F49 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = marker;
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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;
@ -1236,15 +1439,17 @@
299522431BBF104D00859F49 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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;
@ -1257,12 +1462,15 @@
2995226B1BBF129200859F49 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = marker;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
INFOPLIST_FILE = ./Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS";
@ -1278,12 +1486,15 @@
2995226C1BBF129200859F49 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
INFOPLIST_FILE = ./Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS";
@ -1299,7 +1510,9 @@
2995227D1BBF136400859F49 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = marker;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
@ -1307,7 +1520,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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";
@ -1324,7 +1537,9 @@
2995227E1BBF136400859F49 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BITCODE_GENERATION_MODE = bitcode;
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
@ -1332,7 +1547,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = "$(PROJECT_DIR)/Framework/Info.plist";
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";
@ -1376,7 +1591,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 */,
@ -1412,7 +1627,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 */,

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -8,10 +8,10 @@
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
@ -40,8 +40,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
enableAddressSanitizer = "YES"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
@ -52,6 +53,11 @@
BlueprintName = "AFNetworking iOS Tests"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "AFSecurityPolicyTests/testPolicyWithCertificatePinningAllowsGoogleComServerTrustIncompleteChainWithRootCertificatePinnedAndValidDomainName">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
@ -63,6 +69,18 @@
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "HTTPBIN_BASE_URL"
value = "http://127.0.0.1:5000"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@ -85,6 +103,13 @@
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -16,7 +16,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -26,18 +26,23 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
BuildableName = "AFNetworking Mac OS X Tests.xctest"
BlueprintName = "AFNetworking Mac OS X Tests"
BuildableName = "AFNetworking macOS Tests.xctest"
BlueprintName = "AFNetworking macOS Tests"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "AFSecurityPolicyTests/testPolicyWithCertificatePinningAllowsGoogleComServerTrustIncompleteChainWithRootCertificatePinnedAndValidDomainName">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
@ -45,10 +50,17 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "HTTPBIN_BASE_URL"
value = "http://127.0.0.1:5000"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@ -67,7 +79,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
@ -85,7 +97,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
enableAddressSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
@ -37,6 +38,11 @@
BlueprintName = "AFNetworking tvOS Tests"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "AFSecurityPolicyTests/testPolicyWithCertificatePinningAllowsGoogleComServerTrustIncompleteChainWithRootCertificatePinnedAndValidDomainName">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
@ -48,17 +54,36 @@
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "HTTPBIN_BASE_URL"
value = "http://127.0.0.1:5000"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableThreadSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
stopOnEveryThreadSanitizerIssue = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
@ -70,7 +95,19 @@
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -0,0 +1,43 @@
// AFCompatibilityMacros.h
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef AFCompatibilityMacros_h
#define AFCompatibilityMacros_h
#ifdef API_UNAVAILABLE
#define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
#else
#define AF_API_UNAVAILABLE(x)
#endif // API_UNAVAILABLE
#if __has_warning("-Wunguarded-availability-new")
#define AF_CAN_USE_AT_AVAILABLE 1
#else
#define AF_CAN_USE_AT_AVAILABLE 0
#endif
#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
#else
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
#endif
#endif /* AFCompatibilityMacros_h */

View File

@ -1,5 +1,5 @@
// AFHTTPSessionManager.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -33,14 +33,6 @@
#import "AFURLSessionManager.h"
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif
/**
`AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths.
@ -52,7 +44,7 @@
## 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:completionHandler:`.
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:`.
## Serialization
@ -102,6 +94,15 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
///-------------------------------
/// @name Managing Security Policy
///-------------------------------
/**
The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. A security policy configured with `AFSSLPinningModePublicKey` or `AFSSLPinningModeCertificate` can only be applied on a session manager initialized with a secure base URL (i.e. https). Applying a security policy with pinning enabled on an insecure session manager throws an `Invalid Security Policy` exception.
*/
@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
///---------------------
/// @name Initialization
///---------------------
@ -149,8 +150,45 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
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 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
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `GET` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
*/
- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
@ -165,7 +203,24 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:completionHandler:
*/
- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
success:(nullable void (^)(NSURLSessionDataTask *task))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a `POST` request.
@ -179,8 +234,44 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `POST` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param 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
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `POST` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
*/
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
@ -196,8 +287,47 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
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 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
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
@param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
*/
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
@ -211,8 +341,25 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:completionHandler:
*/
- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
@ -226,8 +373,25 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:completionHandler:
*/
- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
/**
Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
@ -241,8 +405,25 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure;
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
/**
Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param headers The headers appended to the default headers for this request.
@param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
@param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
@see -dataTaskWithRequest:completionHandler:
*/
- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
@end

View File

@ -1,5 +1,5 @@
// AFHTTPSessionManager.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -28,13 +28,11 @@
#import <TargetConditionals.h>
#import <Security/Security.h>
#ifdef _SYSTEMCONFIGURATION_H
#import <netinet/in.h>
#import <netinet6/in6.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#import <netdb.h>
#endif
#if TARGET_OS_IOS || TARGET_OS_TV
#import <UIKit/UIKit.h>
@ -88,9 +86,6 @@
#pragma mark -
#ifdef _SYSTEMCONFIGURATION_H
#endif
- (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
NSParameterAssert(requestSerializer);
@ -103,6 +98,23 @@
[super setResponseSerializer:responseSerializer];
}
@dynamic securityPolicy;
- (void)setSecurityPolicy:(AFSecurityPolicy *)securityPolicy {
if (securityPolicy.SSLPinningMode != AFSSLPinningModeNone && ![self.baseURL.scheme isEqualToString:@"https"]) {
NSString *pinningMode = @"Unknown Pinning Mode";
switch (securityPolicy.SSLPinningMode) {
case AFSSLPinningModeNone: pinningMode = @"AFSSLPinningModeNone"; break;
case AFSSLPinningModeCertificate: pinningMode = @"AFSSLPinningModeCertificate"; break;
case AFSSLPinningModePublicKey: pinningMode = @"AFSSLPinningModePublicKey"; break;
}
NSString *reason = [NSString stringWithFormat:@"A security policy configured with `%@` can only be applied on a manager with a secure base URL (i.e. https)", pinningMode];
@throw [NSException exceptionWithName:@"Invalid Security Policy" reason:reason userInfo:nil];
}
[super setSecurityPolicy:securityPolicy];
}
#pragma mark -
- (NSURLSessionDataTask *)GET:(NSString *)URLString
@ -110,10 +122,39 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:success failure:failure];
return [self GET:URLString parameters:parameters headers:nil 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
{
return [self GET:URLString parameters:parameters headers:nil progress:downloadProgress success:success failure:failure];
}
- (NSURLSessionDataTask *)GET:(NSString *)URLString
parameters:(id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
progress:(void (^)(NSProgress * _Nonnull))downloadProgress
success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET"
URLString:URLString
parameters:parameters
headers:headers
uploadProgress:nil
downloadProgress:downloadProgress
success:success
failure:failure];
[dataTask resume];
return dataTask;
}
@ -122,14 +163,23 @@
success:(void (^)(NSURLSessionDataTask *task))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters success:^(NSURLSessionDataTask *task, __unused id responseObject) {
return [self HEAD:URLString parameters:parameters headers:nil success:success failure:failure];
}
- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary<NSString *,NSString *> *)headers
success:(void (^)(NSURLSessionDataTask * _Nonnull))success
failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) {
if (success) {
success(task);
}
} failure:failure];
[dataTask resume];
return dataTask;
}
@ -138,35 +188,74 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters success:success failure:failure];
return [self POST:URLString parameters:parameters headers:nil 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
{
return [self POST:URLString parameters:parameters headers:nil progress:uploadProgress success:success failure:failure];
}
- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
headers:(nullable NSDictionary <NSString *, NSString *> *)headers
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters headers:headers uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure];
[dataTask resume];
return dataTask;
}
- (NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(nullable id)parameters
constructingBodyWithBlock:(nullable void (^)(id<AFMultipartFormData> _Nonnull))block
success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
{
return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:nil success:success failure:failure];
}
- (NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(id)parameters
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:uploadProgress success:success failure:failure];
}
- (NSURLSessionDataTask *)POST:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary<NSString *,NSString *> *)headers
constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> _Nonnull))block
progress:(void (^)(NSProgress * _Nonnull))uploadProgress
success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
{
NSError *serializationError = nil;
NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];
for (NSString *headerField in headers.keyEnumerator) {
[request addValue:headers[headerField] forHTTPHeaderField:headerField];
}
if (serializationError) {
if (failure) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
failure(nil, serializationError);
});
#pragma clang diagnostic pop
}
return nil;
}
__block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:nil completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
__block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
if (error) {
if (failure) {
failure(task, error);
@ -177,9 +266,9 @@
}
}
}];
[task resume];
return task;
}
@ -188,10 +277,19 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters success:success failure:failure];
return [self PUT:URLString parameters:parameters headers:nil success:success failure:failure];
}
- (NSURLSessionDataTask *)PUT:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary<NSString *,NSString *> *)headers
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
[dataTask resume];
return dataTask;
}
@ -200,10 +298,19 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters success:success failure:failure];
return [self PATCH:URLString parameters:parameters headers:nil success:success failure:failure];
}
- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary<NSString *,NSString *> *)headers
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
[dataTask resume];
return dataTask;
}
@ -212,36 +319,51 @@
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters success:success failure:failure];
return [self DELETE:URLString parameters:parameters headers:nil success:success failure:failure];
}
- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary<NSString *,NSString *> *)headers
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
{
NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure];
[dataTask resume];
return dataTask;
}
- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(id)parameters
headers:(NSDictionary <NSString *, NSString *> *)headers
uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress
downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress
success:(void (^)(NSURLSessionDataTask *, id))success
failure:(void (^)(NSURLSessionDataTask *, NSError *))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 addValue:headers[headerField] forHTTPHeaderField:headerField];
}
if (serializationError) {
if (failure) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
failure(nil, serializationError);
});
#pragma clang diagnostic pop
}
return nil;
}
__block NSURLSessionDataTask *dataTask = nil;
dataTask = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
dataTask = [self dataTaskWithRequest:request
uploadProgress:uploadProgress
downloadProgress:downloadProgress
completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
if (error) {
if (failure) {
failure(dataTask, error);
@ -268,7 +390,7 @@
return YES;
}
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))];
NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
if (!configuration) {
@ -289,6 +411,10 @@
self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];
self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))];
if (decodedPolicy) {
self.securityPolicy = decodedPolicy;
}
return self;
}
@ -304,16 +430,17 @@
}
[coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
[coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
[coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))];
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration];
HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone];
return HTTPClient;
}

View File

@ -1,5 +1,5 @@
// AFNetworkReachabilityManager.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -24,14 +24,6 @@
#if !TARGET_OS_WATCH
#import <SystemConfiguration/SystemConfiguration.h>
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif
typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
AFNetworkReachabilityStatusUnknown = -1,
AFNetworkReachabilityStatusNotReachable = 0,
@ -46,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/)
See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ )
@warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
*/
@ -81,6 +73,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (instancetype)sharedManager;
/**
Creates and returns a network reachability manager with the default socket address.
@return An initialized network reachability manager, actively monitoring the default socket address.
*/
+ (instancetype)manager;
/**
Creates and returns a network reachability manager for the specified domain.
@ -93,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Creates and returns a network reachability manager for the socket address.
@param address The socket address (`sockaddr_in`) used to evaluate network reachability.
@param address The socket address (`sockaddr_in6`) used to evaluate network reachability.
@return An initialized network reachability manager, actively monitoring the specified socket address.
*/
@ -108,6 +107,16 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
/**
* Unavailable initializer
*/
+ (instancetype)new NS_UNAVAILABLE;
/**
* Unavailable initializer
*/
- (instancetype)init NS_UNAVAILABLE;
///--------------------------------------------------
/// @name Starting & Stopping Reachability Monitoring
///--------------------------------------------------

View File

@ -1,5 +1,5 @@
// AFNetworkReachabilityManager.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -32,12 +32,7 @@ NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire
NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem";
typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
typedef NS_ENUM(NSUInteger, AFNetworkReachabilityAssociation) {
AFNetworkReachabilityForAddress = 1,
AFNetworkReachabilityForAddressPair = 2,
AFNetworkReachabilityForName = 3,
};
typedef AFNetworkReachabilityManager * (^AFNetworkReachabilityStatusCallback)(AFNetworkReachabilityStatus status);
NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
switch (status) {
@ -76,22 +71,32 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork
return status;
}
static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
/**
* Queue a status change notification for the main thread.
*
* This is done to ensure that the notifications are received in the same order
* as they are sent. If notifications are sent directly, it is possible that
* a queued notification (for an earlier status condition) is processed after
* the later update, resulting in the listener being left in the wrong state.
*/
static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusCallback block) {
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
AFNetworkReachabilityStatusBlock block = (__bridge AFNetworkReachabilityStatusBlock)info;
if (block) {
block(status);
}
dispatch_async(dispatch_get_main_queue(), ^{
AFNetworkReachabilityManager *manager = nil;
if (block) {
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 AFNetworkReachabilityStatusCallback)info);
}
static const void * AFNetworkReachabilityRetainCallback(const void *info) {
return Block_copy(info);
}
@ -103,8 +108,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
}
@interface AFNetworkReachabilityManager ()
@property (readwrite, nonatomic, strong) id networkReachability;
@property (readwrite, nonatomic, assign) AFNetworkReachabilityAssociation networkReachabilityAssociation;
@property (readonly, nonatomic, assign) SCNetworkReachabilityRef networkReachability;
@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock;
@end
@ -115,12 +119,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
static AFNetworkReachabilityManager *_sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
struct sockaddr_in address;
bzero(&address, sizeof(address));
address.sin_len = sizeof(address);
address.sin_family = AF_INET;
_sharedManager = [self managerForAddress:&address];
_sharedManager = [self manager];
});
return _sharedManager;
@ -130,39 +129,63 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]);
AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
manager.networkReachabilityAssociation = AFNetworkReachabilityForName;
CFRelease(reachability);
return manager;
}
+ (instancetype)managerForAddress:(const void *)address {
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address);
AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
manager.networkReachabilityAssociation = AFNetworkReachabilityForAddress;
CFRelease(reachability);
return manager;
}
+ (instancetype)manager
{
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
struct sockaddr_in6 address;
bzero(&address, sizeof(address));
address.sin6_len = sizeof(address);
address.sin6_family = AF_INET6;
#else
struct sockaddr_in address;
bzero(&address, sizeof(address));
address.sin_len = sizeof(address);
address.sin_family = AF_INET;
#endif
return [self managerForAddress:&address];
}
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
self = [super init];
if (!self) {
return nil;
}
self.networkReachability = CFBridgingRelease(reachability);
_networkReachability = CFRetain(reachability);
self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
return self;
}
- (instancetype)init NS_UNAVAILABLE
- (instancetype)init
{
@throw [NSException exceptionWithName:NSGenericException
reason:@"`-init` unavailable. Use `-initWithReachability:` instead"
userInfo:nil];
return nil;
}
- (void)dealloc {
[self stopMonitoring];
if (_networkReachability != NULL) {
CFRelease(_networkReachability);
}
}
#pragma mark -
@ -189,43 +212,27 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
}
__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;
};
id networkReachability = self.networkReachability;
SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
SCNetworkReachabilitySetCallback((__bridge SCNetworkReachabilityRef)networkReachability, AFNetworkReachabilityCallback, &context);
SCNetworkReachabilityScheduleWithRunLoop((__bridge SCNetworkReachabilityRef)networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
switch (self.networkReachabilityAssociation) {
case AFNetworkReachabilityForName:
break;
case AFNetworkReachabilityForAddress:
case AFNetworkReachabilityForAddressPair:
default: {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{
SCNetworkReachabilityFlags flags;
SCNetworkReachabilityGetFlags((__bridge SCNetworkReachabilityRef)networkReachability, &flags);
AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
dispatch_async(dispatch_get_main_queue(), ^{
callback(status);
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
});
});
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{
SCNetworkReachabilityFlags flags;
if (SCNetworkReachabilityGetFlags(self.networkReachability, &flags)) {
AFPostReachabilityStatusChange(flags, callback);
}
break;
}
});
}
- (void)stopMonitoring {
@ -233,7 +240,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
return;
}
SCNetworkReachabilityUnscheduleFromRunLoop((__bridge SCNetworkReachabilityRef)self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
SCNetworkReachabilityUnscheduleFromRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
}
#pragma mark -

View File

@ -1,5 +1,5 @@
// AFSecurityPolicy.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -36,7 +36,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
NS_ASSUME_NONNULL_BEGIN
@interface AFSecurityPolicy : NSObject
@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying>
/**
The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
@ -45,12 +45,12 @@ 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 you create an array with duplicate certificates, the duplicate certificates will be removed. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
@see policyWithPinningMode:withPinnedCertificates:
*/
@property (nonatomic, strong, nullable) NSArray *pinnedCertificates;
@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
/**
Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
@ -69,9 +69,9 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
@return The default security policy.
@return The certificates included in the given bundle.
*/
+ (NSArray *)certificatesInBundle:(NSBundle *)bundle;
+ (NSSet <NSData *> *)certificatesInBundle:(NSBundle *)bundle;
///-----------------------------------------
/// @name Getting Specific Security Policies
@ -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,26 +108,16 @@ NS_ASSUME_NONNULL_BEGIN
@param pinnedCertificates The certificates to pin against.
@return A new security policy.
*/
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSArray *)pinnedCertificates;
@see +certificatesInBundle:
@see -pinnedCertificates
*/
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
///------------------------------
/// @name Evaluating Server Trust
///------------------------------
/**
Whether or not the specified server trust should be accepted, based on the security policy.
This method should be used when responding to an authentication challenge from a server.
@param serverTrust The X.509 certificate trust of the server.
@return Whether or not to trust the server.
@warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
*/
- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE;
/**
Whether or not the specified server trust should be accepted, based on the security policy.

View File

@ -1,5 +1,5 @@
// AFSecurityPolicy.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -51,8 +51,6 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
static id AFPublicKeyForCertificate(NSData *certificate) {
id allowedPublicKey = nil;
SecCertificateRef allowedCertificate;
SecCertificateRef allowedCertificates[1];
CFArrayRef tempCertificates = nil;
SecPolicyRef policy = nil;
SecTrustRef allowedTrust = nil;
SecTrustResultType result;
@ -60,11 +58,8 @@ static id AFPublicKeyForCertificate(NSData *certificate) {
allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
__Require_Quiet(allowedCertificate != NULL, _out);
allowedCertificates[0] = allowedCertificate;
tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
policy = SecPolicyCreateBasicX509();
__Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
__Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out);
__Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
@ -78,10 +73,6 @@ _out:
CFRelease(policy);
}
if (tempCertificates) {
CFRelease(tempCertificates);
}
if (allowedCertificate) {
CFRelease(allowedCertificate);
}
@ -150,32 +141,21 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
@interface AFSecurityPolicy()
@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
@property (readwrite, nonatomic, strong) NSArray *pinnedPublicKeys;
@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys;
@end
@implementation AFSecurityPolicy
+ (NSArray *)certificatesInBundle:(NSBundle *)bundle {
+ (NSSet *)certificatesInBundle:(NSBundle *)bundle {
NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[paths count]];
NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]];
for (NSString *path in paths) {
NSData *certificateData = [NSData dataWithContentsOfFile:path];
[certificates addObject:certificateData];
}
return [[NSArray alloc] initWithArray:certificates];
}
+ (NSArray *)defaultPinnedCertificates {
static NSArray *_defaultPinnedCertificates = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
_defaultPinnedCertificates = [self certificatesInBundle:bundle];
});
return _defaultPinnedCertificates;
return [NSSet setWithSet:certificates];
}
+ (instancetype)defaultPolicy {
@ -186,10 +166,11 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
}
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];
NSSet <NSData *> *defaultPinnedCertificates = [self certificatesInBundle:[NSBundle mainBundle]];
return [self policyWithPinningMode:pinningMode withPinnedCertificates:defaultPinnedCertificates];
}
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSArray *)pinnedCertificates {
+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {
AFSecurityPolicy *securityPolicy = [[self alloc] init];
securityPolicy.SSLPinningMode = pinningMode;
@ -198,7 +179,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
return securityPolicy;
}
- (id)init {
- (instancetype)init {
self = [super init];
if (!self) {
return nil;
@ -209,11 +190,11 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
return self;
}
- (void)setPinnedCertificates:(NSArray *)pinnedCertificates {
_pinnedCertificates = [[NSOrderedSet orderedSetWithArray:pinnedCertificates] array];
- (void)setPinnedCertificates:(NSSet *)pinnedCertificates {
_pinnedCertificates = pinnedCertificates;
if (self.pinnedCertificates) {
NSMutableArray *mutablePinnedPublicKeys = [NSMutableArray arrayWithCapacity:[self.pinnedCertificates count]];
NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]];
for (NSData *certificate in self.pinnedCertificates) {
id publicKey = AFPublicKeyForCertificate(certificate);
if (!publicKey) {
@ -221,7 +202,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
}
[mutablePinnedPublicKeys addObject:publicKey];
}
self.pinnedPublicKeys = [NSArray arrayWithArray:mutablePinnedPublicKeys];
self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys];
} else {
self.pinnedPublicKeys = nil;
}
@ -229,10 +210,6 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
#pragma mark -
- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust {
return [self evaluateServerTrust:serverTrust forDomain:nil];
}
- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
forDomain:(NSString *)domain
{
@ -259,20 +236,12 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);
if (self.SSLPinningMode == AFSSLPinningModeNone) {
if (self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust)){
return YES;
} else {
return NO;
}
return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust);
} else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
return NO;
}
NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
switch (self.SSLPinningMode) {
case AFSSLPinningModeNone:
default:
return NO;
case AFSSLPinningModeCertificate: {
NSMutableArray *pinnedCertificates = [NSMutableArray array];
for (NSData *certificateData in self.pinnedCertificates) {
@ -284,13 +253,16 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
return NO;
}
NSUInteger trustedCertificateCount = 0;
for (NSData *trustChainCertificate in serverCertificates) {
// obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA)
NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) {
if ([self.pinnedCertificates containsObject:trustChainCertificate]) {
trustedCertificateCount++;
return YES;
}
}
return trustedCertificateCount > 0;
return NO;
}
case AFSSLPinningModePublicKey: {
NSUInteger trustedPublicKeyCount = 0;
@ -305,6 +277,9 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
}
return trustedPublicKeyCount > 0;
}
default:
return NO;
}
return NO;
@ -316,4 +291,44 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
return [NSSet setWithObject:@"pinnedCertificates"];
}
#pragma mark - NSSecureCoding
+ (BOOL)supportsSecureCoding {
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];
self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];
self.pinnedCertificates = [decoder decodeObjectOfClass:[NSSet class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))];
[coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
[coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))];
[coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))];
}
#pragma mark - NSCopying
- (instancetype)copyWithZone:(NSZone *)zone {
AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init];
securityPolicy.SSLPinningMode = self.SSLPinningMode;
securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates;
securityPolicy.validatesDomainName = self.validatesDomainName;
securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone];
return securityPolicy;
}
@end

View File

@ -1,5 +1,5 @@
// AFURLRequestSerialization.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -30,6 +30,31 @@
NS_ASSUME_NONNULL_BEGIN
/**
Returns a percent-escaped string following RFC 3986 for a query string key or value.
RFC 3986 states that the following characters are "reserved" characters.
- General Delimiters: ":", "#", "[", "]", "@", "?", "/"
- Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow
query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"
should be percent-escaped in the query string.
@param string The string to be percent-escaped.
@return The percent-escaped string.
*/
FOUNDATION_EXPORT NSString * AFPercentEscapedStringFromString(NSString *string);
/**
A helper method to generate encoded url query parameters for appending to the end of a URL.
@param parameters A dictionary of key/values to be encoded.
@return A url encoded query string
*/
FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameters);
/**
The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary.
@ -48,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
withParameters:(nullable id)parameters
error:(NSError * _Nullable __autoreleasing *)error;
error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW;
@end
@ -129,7 +154,7 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
@discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`.
*/
@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders;
@property (readonly, nonatomic, strong) NSDictionary <NSString *, NSString *> *HTTPRequestHeaders;
/**
Creates and returns a serializer with default configuration.
@ -163,12 +188,6 @@ forHTTPHeaderField:(NSString *)field;
- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
password:(NSString *)password;
/**
@deprecated This method has been deprecated. Use -setValue:forHTTPHeaderField: instead.
*/
- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token DEPRECATED_ATTRIBUTE;
/**
Clears any existing value for the "Authorization" HTTP header.
*/
@ -181,7 +200,7 @@ forHTTPHeaderField:(NSString *)field;
/**
HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default.
*/
@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI;
@property (nonatomic, strong) NSSet <NSString *> *HTTPMethodsEncodingParametersInURI;
/**
Set the method of query string serialization according to one of the pre-defined styles.
@ -203,13 +222,6 @@ forHTTPHeaderField:(NSString *)field;
/// @name Creating Request Objects
///-------------------------------
/**
@deprecated This method has been deprecated. Use -requestWithMethod:URLString:parameters:error: instead.
*/
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(id)parameters DEPRECATED_ATTRIBUTE;
/**
Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string.
@ -227,14 +239,6 @@ forHTTPHeaderField:(NSString *)field;
parameters:(nullable id)parameters
error:(NSError * _Nullable __autoreleasing *)error;
/**
@deprecated This method has been deprecated. Use -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error: instead.
*/
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(NSDictionary *)parameters
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block DEPRECATED_ATTRIBUTE;
/**
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
@ -250,7 +254,7 @@ forHTTPHeaderField:(NSString *)field;
*/
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(nullable NSDictionary *)parameters
parameters:(nullable NSDictionary <NSString *, id> *)parameters
constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
error:(NSError * _Nullable __autoreleasing *)error;
@ -355,7 +359,7 @@ forHTTPHeaderField:(NSString *)field;
@param headers The HTTP headers to be appended to the form data.
@param body The data to be encoded and appended to the form data. This parameter must not be `nil`.
*/
- (void)appendPartWithHeaders:(nullable NSDictionary *)headers
- (void)appendPartWithHeaders:(nullable NSDictionary <NSString *, NSString *> *)headers
body:(NSData *)body;
/**

View File

@ -1,5 +1,5 @@
// AFURLRequestSerialization.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -32,35 +32,6 @@ NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @"com.alamofir
typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error);
static NSString * AFBase64EncodedStringFromString(NSString *string) {
NSData *data = [NSData dataWithBytes:[string UTF8String] length:[string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
NSUInteger length = [data length];
NSMutableData *mutableData = [NSMutableData dataWithLength:((length + 2) / 3) * 4];
uint8_t *input = (uint8_t *)[data bytes];
uint8_t *output = (uint8_t *)[mutableData mutableBytes];
for (NSUInteger i = 0; i < length; i += 3) {
NSUInteger value = 0;
for (NSUInteger j = i; j < (i + 3); j++) {
value <<= 8;
if (j < length) {
value |= (0xFF & input[j]);
}
}
static uint8_t const kAFBase64EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
NSUInteger idx = (i / 3) * 4;
output[idx + 0] = kAFBase64EncodingTable[(value >> 18) & 0x3F];
output[idx + 1] = kAFBase64EncodingTable[(value >> 12) & 0x3F];
output[idx + 2] = (i + 1) < length ? kAFBase64EncodingTable[(value >> 6) & 0x3F] : '=';
output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '=';
}
return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding];
}
/**
Returns a percent-escaped string following RFC 3986 for a query string key or value.
RFC 3986 states that the following characters are "reserved" characters.
@ -73,7 +44,7 @@ static NSString * AFBase64EncodedStringFromString(NSString *string) {
- parameter string: The string to be percent-escaped.
- returns: The percent-escaped string.
*/
static NSString * AFPercentEscapedStringFromString(NSString *string) {
NSString * AFPercentEscapedStringFromString(NSString *string) {
static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4
static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;=";
@ -85,7 +56,7 @@ static NSString * AFPercentEscapedStringFromString(NSString *string) {
static NSUInteger const batchSize = 50;
NSInteger index = 0;
NSUInteger index = 0;
NSMutableString *escaped = @"".mutableCopy;
while (index < string.length) {
@ -111,14 +82,14 @@ static NSString * AFPercentEscapedStringFromString(NSString *string) {
@property (readwrite, nonatomic, strong) id field;
@property (readwrite, nonatomic, strong) id value;
- (id)initWithField:(id)field value:(id)value;
- (instancetype)initWithField:(id)field value:(id)value;
- (NSString *)URLEncodedStringValue;
@end
@implementation AFQueryStringPair
- (id)initWithField:(id)field value:(id)value {
- (instancetype)initWithField:(id)field value:(id)value {
self = [super init];
if (!self) {
return nil;
@ -145,7 +116,7 @@ static NSString * AFPercentEscapedStringFromString(NSString *string) {
FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary);
FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value);
static NSString * AFQueryStringFromParameters(NSDictionary *parameters) {
NSString * AFQueryStringFromParameters(NSDictionary *parameters) {
NSMutableArray *mutablePairs = [NSMutableArray array];
for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) {
[mutablePairs addObject:[pair URLEncodedStringValue]];
@ -215,6 +186,7 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
@interface AFHTTPRequestSerializer ()
@property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths;
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders;
@property (readwrite, nonatomic, strong) dispatch_queue_t requestHeaderModificationQueue;
@property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle;
@property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization;
@end
@ -234,6 +206,7 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
self.stringEncoding = NSUTF8StringEncoding;
self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary];
self.requestHeaderModificationQueue = dispatch_queue_create("requestHeaderModificationQueue", DISPATCH_QUEUE_CONCURRENT);
// Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
NSMutableArray *acceptLanguagesComponents = [NSMutableArray array];
@ -244,19 +217,17 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
}];
[self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"];
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
NSString *userAgent = nil;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
#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]];
#endif
#pragma clang diagnostic pop
if (userAgent) {
if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) {
NSMutableString *mutableUserAgent = [userAgent mutableCopy];
@ -332,32 +303,41 @@ static void *AFHTTPRequestSerializerObserverContext = &AFHTTPRequestSerializerOb
#pragma mark -
- (NSDictionary *)HTTPRequestHeaders {
return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders];
NSDictionary __block *value;
dispatch_sync(self.requestHeaderModificationQueue, ^{
value = [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders];
});
return value;
}
- (void)setValue:(NSString *)value
forHTTPHeaderField:(NSString *)field
{
[self.mutableHTTPRequestHeaders setValue:value forKey:field];
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{
[self.mutableHTTPRequestHeaders setValue:value forKey:field];
});
}
- (NSString *)valueForHTTPHeaderField:(NSString *)field {
return [self.mutableHTTPRequestHeaders valueForKey:field];
NSString __block *value;
dispatch_sync(self.requestHeaderModificationQueue, ^{
value = [self.mutableHTTPRequestHeaders valueForKey:field];
});
return value;
}
- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
password:(NSString *)password
{
NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];
[self setValue:[NSString stringWithFormat:@"Basic %@", AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField:@"Authorization"];
}
- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token {
[self setValue:[NSString stringWithFormat:@"Token token=\"%@\"", token] forHTTPHeaderField:@"Authorization"];
NSData *basicAuthCredentials = [[NSString stringWithFormat:@"%@:%@", username, password] dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64AuthCredentials = [basicAuthCredentials base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];
[self setValue:[NSString stringWithFormat:@"Basic %@", base64AuthCredentials] forHTTPHeaderField:@"Authorization"];
}
- (void)clearAuthorizationHeader {
[self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
dispatch_barrier_sync(self.requestHeaderModificationQueue, ^{
[self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
});
}
#pragma mark -
@ -373,13 +353,6 @@ forHTTPHeaderField:(NSString *)field
#pragma mark -
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(id)parameters
{
return [self requestWithMethod:method URLString:URLString parameters:parameters error:nil];
}
- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(id)parameters
@ -406,14 +379,6 @@ forHTTPHeaderField:(NSString *)field
return mutableRequest;
}
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(NSDictionary *)parameters
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
{
return [self multipartFormRequestWithMethod:method URLString:URLString parameters:parameters constructingBodyWithBlock:block error:nil];
}
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
URLString:(NSString *)URLString
parameters:(NSDictionary *)parameters
@ -544,7 +509,7 @@ forHTTPHeaderField:(NSString *)field
}
if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {
if (query) {
if (query && query.length > 0) {
mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]];
}
} else {
@ -591,28 +556,32 @@ forHTTPHeaderField:(NSString *)field
return YES;
}
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy];
self.queryStringSerializationStyle = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue];
self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue];
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
[coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
dispatch_sync(self.requestHeaderModificationQueue, ^{
[coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
});
[coder encodeObject:@(self.queryStringSerializationStyle) forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init];
serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
dispatch_sync(self.requestHeaderModificationQueue, ^{
serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
});
serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
serializer.queryStringSerialization = self.queryStringSerialization;
@ -642,7 +611,6 @@ static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) {
}
static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
#ifdef __UTTYPE__
NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL);
NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
if (!contentType) {
@ -650,10 +618,6 @@ static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
} else {
return contentType;
}
#else
#pragma unused (extension)
return @"application/octet-stream";
#endif
}
NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16;
@ -684,7 +648,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
@property (readonly, nonatomic, assign) unsigned long long contentLength;
@property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty;
- (id)initWithStringEncoding:(NSStringEncoding)encoding;
- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding;
- (void)setInitialAndFinalBoundaries;
- (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart;
@end
@ -700,8 +664,8 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
@implementation AFStreamingMultipartFormData
- (id)initWithURLRequest:(NSMutableURLRequest *)urlRequest
stringEncoding:(NSStringEncoding)encoding
- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest
stringEncoding:(NSStringEncoding)encoding
{
self = [super init];
if (!self) {
@ -716,6 +680,11 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
return self;
}
- (void)setRequest:(NSMutableURLRequest *)request
{
_request = [request mutableCopy];
}
- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
name:(NSString *)name
error:(NSError * __autoreleasing *)error
@ -884,16 +853,13 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
@end
@implementation AFMultipartBodyStream
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-atomic-properties"
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100)
@synthesize delegate;
#endif
@synthesize streamStatus;
@synthesize streamError;
#pragma clang diagnostic pop
- (id)initWithStringEncoding:(NSStringEncoding)encoding {
- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding {
self = [super init];
if (!self) {
return nil;
@ -937,15 +903,13 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
NSInteger totalNumberOfBytesRead = 0;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) {
if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) {
if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) {
break;
}
} else {
NSUInteger maxLength = length - (NSUInteger)totalNumberOfBytesRead;
NSUInteger maxLength = MIN(length, self.numberOfBytesInPacket) - (NSUInteger)totalNumberOfBytesRead;
NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength];
if (numberOfBytesRead == -1) {
self.streamError = self.currentHTTPBodyPart.inputStream.streamError;
@ -959,7 +923,6 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
}
}
}
#pragma clang diagnostic pop
return totalNumberOfBytesRead;
}
@ -1036,7 +999,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
#pragma mark - NSCopying
-(id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding];
for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) {
@ -1073,7 +1036,7 @@ typedef enum {
@implementation AFHTTPBodyPart
- (id)init {
- (instancetype)init {
self = [super init];
if (!self) {
return nil;
@ -1140,8 +1103,6 @@ typedef enum {
return YES;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default"
switch (self.inputStream.streamStatus) {
case NSStreamStatusNotOpen:
case NSStreamStatusOpening:
@ -1155,7 +1116,6 @@ typedef enum {
default:
return NO;
}
#pragma clang diagnostic pop
}
- (NSInteger)read:(uint8_t *)buffer
@ -1200,11 +1160,8 @@ typedef enum {
intoBuffer:(uint8_t *)buffer
maxLength:(NSUInteger)length
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length));
[data getBytes:buffer range:range];
#pragma clang diagnostic pop
_phaseReadOffset += range.length;
@ -1223,8 +1180,6 @@ typedef enum {
return YES;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default"
switch (_phase) {
case AFEncapsulationBoundaryPhase:
_phase = AFHeaderPhase;
@ -1244,14 +1199,13 @@ typedef enum {
break;
}
_phaseReadOffset = 0;
#pragma clang diagnostic pop
return YES;
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
bodyPart.stringEncoding = self.stringEncoding;
@ -1306,7 +1260,21 @@ typedef enum {
[mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
}
[mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]];
if (![NSJSONSerialization isValidJSONObject:parameters]) {
if (error) {
NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"The `parameters` argument is not valid JSON.", @"AFNetworking", nil)};
*error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
}
return nil;
}
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error];
if (!jsonData) {
return nil;
}
[mutableRequest setHTTPBody:jsonData];
}
return mutableRequest;
@ -1314,7 +1282,7 @@ typedef enum {
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
@ -1328,12 +1296,12 @@ typedef enum {
- (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
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFJSONRequestSerializer *serializer = [super copyWithZone:zone];
serializer.writingOptions = self.writingOptions;
@ -1385,7 +1353,13 @@ typedef enum {
[mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"];
}
[mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]];
NSData *plistData = [NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error];
if (!plistData) {
return nil;
}
[mutableRequest setHTTPBody:plistData];
}
return mutableRequest;
@ -1393,13 +1367,13 @@ typedef enum {
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue];
return self;
@ -1408,13 +1382,13 @@ typedef enum {
- (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))];
}
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone];
serializer.format = self.format;
serializer.writeOptions = self.writeOptions;

View File

@ -1,5 +1,5 @@
// AFURLResponseSerialization.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -24,6 +24,11 @@
NS_ASSUME_NONNULL_BEGIN
/**
Recursively removes `NSNull` values from a JSON object.
*/
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions);
/**
The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
@ -42,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response
data:(nullable NSData *)data
error:(NSError * _Nullable __autoreleasing *)error;
error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW;
@end
@ -57,10 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init;
/**
The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default.
*/
@property (nonatomic, assign) NSStringEncoding stringEncoding;
@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.
@ -81,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation.
*/
@property (nonatomic, copy, nullable) NSSet *acceptableContentTypes;
@property (nonatomic, copy, nullable) NSSet <NSString *> *acceptableContentTypes;
/**
Validates the specified response and data.
@ -111,6 +113,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
@ -166,7 +170,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;
@ -259,14 +263,14 @@ NS_ASSUME_NONNULL_BEGIN
/**
The component response serializers.
*/
@property (readonly, nonatomic, copy) NSArray *responseSerializers;
@property (readonly, nonatomic, copy) NSArray <id<AFURLResponseSerialization>> *responseSerializers;
/**
Creates and returns a compound serializer comprised of the specified response serializers.
@warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`.
*/
+ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers;
+ (instancetype)compoundSerializerWithResponseSerializers:(NSArray <id<AFURLResponseSerialization>> *)responseSerializers;
@end

151
AFNetworking/AFURLResponseSerialization.m Normal file → Executable file
View File

@ -1,5 +1,5 @@
// AFURLResponseSerialization.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -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];
@ -97,8 +99,6 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
return nil;
}
self.stringEncoding = NSUTF8StringEncoding;
self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
self.acceptableContentTypes = nil;
@ -114,8 +114,10 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
BOOL responseIsValid = YES;
NSError *validationError = nil;
if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) {
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] &&
!([response MIMEType] == nil && [data length] == 0)) {
if ([data length] > 0 && [response URL]) {
NSMutableDictionary *mutableUserInfo = [@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]],
@ -173,14 +175,14 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
return YES;
}
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [self init];
if (!self) {
return nil;
}
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;
}
@ -192,7 +194,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone];
serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone];
@ -242,46 +244,26 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
// Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization.
// See https://github.com/rails/rails/issues/1742
NSStringEncoding stringEncoding = self.stringEncoding;
if (response.textEncodingName) {
CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
if (encoding != kCFStringEncodingInvalidId) {
stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
}
BOOL isSpace = [data isEqualToData:[NSData dataWithBytes:" " length:1]];
if (data.length == 0 || isSpace) {
return nil;
}
id responseObject = nil;
NSError *serializationError = nil;
@autoreleasepool {
NSString *responseString = [[NSString alloc] initWithData:data encoding:stringEncoding];
if (responseString && ![responseString isEqualToString:@" "]) {
// Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character
// See http://stackoverflow.com/a/12843465/157142
data = [responseString dataUsingEncoding:NSUTF8StringEncoding];
id responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
if (data) {
if ([data length] > 0) {
responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
} else {
return nil;
}
} else {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"Data failed decoding as a UTF-8 string", @"AFNetworking", nil),
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Could not decode string: %@", @"AFNetworking", nil), responseString]
};
serializationError = [NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
}
if (!responseObject)
{
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
}
return nil;
}
if (self.removesKeysWithNullValues && responseObject) {
responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
}
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
if (self.removesKeysWithNullValues) {
return AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
}
return responseObject;
@ -289,7 +271,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
@ -310,8 +292,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
- (instancetype)copyWithZone:(NSZone *)zone {
AFJSONResponseSerializer *serializer = [super copyWithZone:zone];
serializer.readingOptions = self.readingOptions;
serializer.removesKeysWithNullValues = self.removesKeysWithNullValues;
@ -401,16 +383,20 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
NSError *serializationError = nil;
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError];
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
if (!document)
{
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
}
return nil;
}
return document;
}
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
@ -429,8 +415,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
- (instancetype)copyWithZone:(NSZone *)zone {
AFXMLDocumentResponseSerializer *serializer = [super copyWithZone:zone];
serializer.options = self.options;
return serializer;
@ -481,15 +467,20 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
}
}
id responseObject;
NSError *serializationError = nil;
if (data) {
responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
if (!data) {
return nil;
}
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
NSError *serializationError = nil;
id responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
if (!responseObject)
{
if (error) {
*error = AFErrorWithUnderlyingError(serializationError, *error);
}
return nil;
}
return responseObject;
@ -497,13 +488,13 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue];
return self;
@ -518,8 +509,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
- (instancetype)copyWithZone:(NSZone *)zone {
AFPropertyListResponseSerializer *serializer = [super copyWithZone:zone];
serializer.format = self.format;
serializer.readOptions = self.readOptions;
@ -530,7 +521,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
#pragma mark -
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>
@ -670,10 +661,10 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil];
#if TARGET_OS_IOS
#if TARGET_OS_IOS || TARGET_OS_TV
self.imageScale = [[UIScreen mainScreen] scale];
self.automaticallyInflatesResponseImage = YES;
#elif TARGET_OS_WATCH
#elif TARGET_OS_WATCH
self.imageScale = [[WKInterfaceDevice currentDevice] screenScale];
self.automaticallyInflatesResponseImage = YES;
#endif
@ -693,13 +684,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
}
}
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
if (self.automaticallyInflatesResponseImage) {
return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale);
} else {
return AFImageWithDataAtScale(data, self.imageScale);
}
#elif !TARGET_OS_WATCH
#else
// Ensure that the image is set to it's correct pixel width and height
NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data];
NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])];
@ -713,13 +704,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
}
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))];
#if CGFLOAT_IS_DOUBLE
self.imageScale = [imageScale doubleValue];
@ -736,7 +727,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
[coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))];
[coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
#endif
@ -744,10 +735,10 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
- (instancetype)copyWithZone:(NSZone *)zone {
AFImageResponseSerializer *serializer = [super copyWithZone:zone];
#if TARGET_OS_IOS || TARGET_OS_TV
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
serializer.imageScale = self.imageScale;
serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage;
#endif
@ -799,7 +790,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSSecureCoding
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
self = [super initWithCoder:decoder];
if (!self) {
return nil;
@ -818,8 +809,8 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
- (instancetype)copyWithZone:(NSZone *)zone {
AFCompoundResponseSerializer *serializer = [super copyWithZone:zone];
serializer.responseSerializers = self.responseSerializers;
return serializer;

View File

@ -1,5 +1,5 @@
// AFURLSessionManager.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -25,18 +25,11 @@
#import "AFURLResponseSerialization.h"
#import "AFURLRequestSerialization.h"
#import "AFSecurityPolicy.h"
#import "AFCompatibilityMacros.h"
#if !TARGET_OS_WATCH
#import "AFNetworkReachabilityManager.h"
#endif
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif
/**
`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to `<NSURLSessionTaskDelegate>`, `<NSURLSessionDataDelegate>`, `<NSURLSessionDownloadDelegate>`, and `<NSURLSessionDelegate>`.
@ -59,6 +52,7 @@
- `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`
- `URLSession:task:didReceiveChallenge:completionHandler:`
- `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`
- `URLSession:task:needNewBodyStream:`
- `URLSession:task:didCompleteWithError:`
### `NSURLSessionDataDelegate`
@ -71,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.
@ -140,22 +134,22 @@ NS_ASSUME_NONNULL_BEGIN
/**
The data, upload, and download tasks currently run by the managed session.
*/
@property (readonly, nonatomic, strong) NSArray *tasks;
@property (readonly, nonatomic, strong) NSArray <NSURLSessionTask *> *tasks;
/**
The data tasks currently run by the managed session.
*/
@property (readonly, nonatomic, strong) NSArray *dataTasks;
@property (readonly, nonatomic, strong) NSArray <NSURLSessionDataTask *> *dataTasks;
/**
The upload tasks currently run by the managed session.
*/
@property (readonly, nonatomic, strong) NSArray *uploadTasks;
@property (readonly, nonatomic, strong) NSArray <NSURLSessionUploadTask *> *uploadTasks;
/**
The download tasks currently run by the managed session.
*/
@property (readonly, nonatomic, strong) NSArray *downloadTasks;
@property (readonly, nonatomic, strong) NSArray <NSURLSessionDownloadTask *> *downloadTasks;
///-------------------------------
/// @name Managing Callback Queues
@ -164,20 +158,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used.
*/
#if OS_OBJECT_HAVE_OBJC_SUPPORT
@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue;
#else
@property (nonatomic, assign, nullable) dispatch_queue_t completionQueue;
#endif
/**
The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used.
*/
#if OS_OBJECT_HAVE_OBJC_SUPPORT
@property (nonatomic, strong, nullable) dispatch_group_t completionGroup;
#else
@property (nonatomic, assign, nullable) dispatch_group_t completionGroup;
#endif
///---------------------------------
/// @name Working Around System Bugs
@ -210,7 +196,15 @@ NS_ASSUME_NONNULL_BEGIN
@param cancelPendingTasks Whether or not to cancel pending tasks.
*/
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks;
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks DEPRECATED_ATTRIBUTE;
/**
Invalidates the managed session, optionally canceling pending tasks and optionally resets given session.
@param cancelPendingTasks Whether or not to cancel pending tasks.
@param resetSession Whether or not to reset the session of the manager.
*/
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession;
///-------------------------
/// @name Running Data Tasks
@ -223,6 +217,19 @@ NS_ASSUME_NONNULL_BEGIN
@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.
@param request The HTTP request for the request.
@param uploadProgressBlock 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 downloadProgressBlock 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 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
uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock
completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
///---------------------------
@ -234,14 +241,14 @@ NS_ASSUME_NONNULL_BEGIN
@param request The HTTP request for the request.
@param fileURL A URL to the local file to be uploaded.
@param progress A progress object monitoring the current upload progress.
@param uploadProgressBlock 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 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.
@see `attemptsToRecreateUploadTasksForBackgroundSessions`
*/
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
fromFile:(NSURL *)fileURL
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
/**
@ -249,23 +256,23 @@ NS_ASSUME_NONNULL_BEGIN
@param request The HTTP request for the request.
@param bodyData A data object containing the HTTP body to be uploaded.
@param progress A progress object monitoring the current upload progress.
@param uploadProgressBlock 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 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.
*/
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
fromData:(nullable NSData *)bodyData
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
/**
Creates an `NSURLSessionUploadTask` with the specified streaming request.
@param request The HTTP request for the request.
@param progress A progress object monitoring the current upload progress.
@param uploadProgressBlock 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 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.
*/
- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock
completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
///-----------------------------
@ -276,14 +283,14 @@ NS_ASSUME_NONNULL_BEGIN
Creates an `NSURLSessionDownloadTask` with the specified request.
@param request The HTTP request for the request.
@param progress A progress object monitoring the current download progress.
@param downloadProgressBlock 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 destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
@param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
@warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method.
*/
- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock
destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler;
@ -291,12 +298,12 @@ NS_ASSUME_NONNULL_BEGIN
Creates an `NSURLSessionDownloadTask` with the specified resume data.
@param resumeData The data used to resume downloading.
@param progress A progress object monitoring the current download progress.
@param downloadProgressBlock 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 destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
@param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
*/
- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock
destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler;
@ -304,32 +311,23 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Getting Progress for Tasks
///---------------------------------
/**
Returns the response download progress of the specified task.
@param dataTask The session data task. Must not be `nil`.
@return An `NSProgress` object reporting the response download progress of a task, or `nil` if the progress is unavailable.
*/
- (nullable NSProgress *)progressForDataTask:(NSURLSessionDataTask *)dataTask;
/**
Returns the upload progress of the specified task.
@param uploadTask The session upload task. Must not be `nil`.
@param task The session task. Must not be `nil`.
@return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable.
*/
- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask;
- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task;
/**
Returns the download progress of the specified task.
@param downloadTask The session download task. Must not be `nil`.
@param task The session task. Must not be `nil`.
@return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable.
*/
- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask;
- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task;
///-----------------------------------------
/// @name Setting Session Delegate Callbacks
@ -365,7 +363,7 @@ NS_ASSUME_NONNULL_BEGIN
@param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response.
*/
- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(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:`.
@ -388,6 +386,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;
#endif
///-------------------------------------------
/// @name Setting Data Task Delegate Callbacks
///-------------------------------------------
@ -425,7 +431,7 @@ NS_ASSUME_NONNULL_BEGIN
@param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session.
*/
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block;
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block AF_API_UNAVAILABLE(macos);
///-----------------------------------------------
/// @name Setting Download Task Delegate Callbacks
@ -436,10 +442,10 @@ NS_ASSUME_NONNULL_BEGIN
@param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error.
*/
- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block;
- (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.
*/
@ -458,25 +464,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @name Notifications
///--------------------
/**
Posted when a task begins executing.
@deprecated Use `AFNetworkingTaskDidResumeNotification` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidStartNotification DEPRECATED_ATTRIBUTE;
/**
Posted when a task resumes.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification;
/**
Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
@deprecated Use `AFNetworkingTaskDidCompleteNotification` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishNotification DEPRECATED_ATTRIBUTE;
/**
Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
*/
@ -498,63 +490,33 @@ FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification;
FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification;
/**
The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
@deprecated Use `AFNetworkingTaskDidCompleteResponseDataKey` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishResponseDataKey DEPRECATED_ATTRIBUTE;
/**
The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey;
/**
The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
@deprecated Use `AFNetworkingTaskDidCompleteSerializedResponseKey` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishSerializedResponseKey DEPRECATED_ATTRIBUTE;
/**
The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey;
/**
The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
@deprecated Use `AFNetworkingTaskDidCompleteResponseSerializerKey` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishResponseSerializerKey DEPRECATED_ATTRIBUTE;
/**
The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey;
/**
The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
@deprecated Use `AFNetworkingTaskDidCompleteAssetPathKey` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishAssetPathKey DEPRECATED_ATTRIBUTE;
/**
The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey;
/**
Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
@deprecated Use `AFNetworkingTaskDidCompleteErrorKey` instead.
*/
FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidFinishErrorKey DEPRECATED_ATTRIBUTE;
/**
Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists.
*/
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

View File

@ -1,5 +1,5 @@
// AFURLSessionManager.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -22,6 +22,12 @@
#import "AFURLSessionManager.h"
#import <objc/runtime.h>
#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;
@ -32,6 +38,19 @@ static dispatch_queue_t url_session_manager_creation_queue() {
return af_url_session_manager_creation_queue;
}
static void url_session_manager_create_task_safely(dispatch_block_t _Nonnull block) {
if (block != NULL) {
if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) {
// Fix of bug
// Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8)
// Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093
dispatch_sync(url_session_manager_creation_queue(), block);
} else {
block();
}
}
}
static dispatch_queue_t url_session_manager_processing_queue() {
static dispatch_queue_t af_url_session_manager_processing_queue;
static dispatch_once_t onceToken;
@ -58,27 +77,17 @@ NSString * const AFNetworkingTaskDidSuspendNotification = @"com.alamofire.networ
NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate";
NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error";
NSString * const AFNetworkingTaskDidStartNotification = @"com.alamofire.networking.task.resume"; // Deprecated
NSString * const AFNetworkingTaskDidFinishNotification = @"com.alamofire.networking.task.complete"; // Deprecated
NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse";
NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer";
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 AFNetworkingTaskDidFinishSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; // Deprecated
NSString * const AFNetworkingTaskDidFinishResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; // Deprecated
NSString * const AFNetworkingTaskDidFinishResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; // Deprecated
NSString * const AFNetworkingTaskDidFinishErrorKey = @"com.alamofire.networking.task.complete.error"; // Deprecated
NSString * const AFNetworkingTaskDidFinishAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; // Deprecated
NSString * const AFNetworkingTaskDidCompleteSessionTaskMetrics = @"com.alamofire.networking.complete.sessiontaskmetrics";
static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock";
static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3;
static void * AFTaskStateChangedContext = &AFTaskStateChangedContext;
typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error);
typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential);
@ -89,6 +98,9 @@ typedef void (^AFURLSessionDidFinishEventsForBackgroundURLSessionBlock)(NSURLSes
typedef NSInputStream * (^AFURLSessionTaskNeedNewBodyStreamBlock)(NSURLSession *session, NSURLSessionTask *task);
typedef void (^AFURLSessionTaskDidSendBodyDataBlock)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
typedef void (^AFURLSessionTaskDidCompleteBlock)(NSURLSession *session, NSURLSessionTask *task, NSError *error);
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
typedef void (^AFURLSessionTaskDidFinishCollectingMetricsBlock)(NSURLSession *session, NSURLSessionTask *task, NSURLSessionTaskMetrics * metrics);
#endif
typedef NSURLSessionResponseDisposition (^AFURLSessionDataTaskDidReceiveResponseBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response);
typedef void (^AFURLSessionDataTaskDidBecomeDownloadTaskBlock)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask);
@ -98,53 +110,98 @@ typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSUR
typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location);
typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes);
typedef void (^AFURLSessionTaskProgressBlock)(NSProgress *);
typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error);
#pragma mark -
@interface AFURLSessionManagerTaskDelegate : NSObject <NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate>
- (instancetype)initWithTask:(NSURLSessionTask *)task;
@property (nonatomic, weak) AFURLSessionManager *manager;
@property (nonatomic, strong) NSMutableData *mutableData;
@property (nonatomic, strong) NSProgress *progress;
@property (nonatomic, strong) NSProgress *uploadProgress;
@property (nonatomic, strong) NSProgress *downloadProgress;
@property (nonatomic, copy) NSURL *downloadFileURL;
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
@property (nonatomic, strong) NSURLSessionTaskMetrics *sessionTaskMetrics;
#endif
@property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading;
@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock;
@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock;
@property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler;
@end
@implementation AFURLSessionManagerTaskDelegate
- (instancetype)init {
- (instancetype)initWithTask:(NSURLSessionTask *)task {
self = [super init];
if (!self) {
return nil;
}
self.mutableData = [NSMutableData data];
self.progress = [NSProgress progressWithTotalUnitCount:0];
_mutableData = [NSMutableData data];
_uploadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil];
_downloadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil];
__weak __typeof__(task) weakTask = task;
for (NSProgress *progress in @[ _uploadProgress, _downloadProgress ])
{
progress.totalUnitCount = NSURLSessionTransferSizeUnknown;
progress.cancellable = YES;
progress.cancellationHandler = ^{
[weakTask cancel];
};
progress.pausable = YES;
progress.pausingHandler = ^{
[weakTask suspend];
};
#if AF_CAN_USE_AT_AVAILABLE
if (@available(iOS 9, macOS 10.11, *))
#else
if ([progress respondsToSelector:@selector(setResumingHandler:)])
#endif
{
progress.resumingHandler = ^{
[weakTask resume];
};
}
[progress addObserver:self
forKeyPath:NSStringFromSelector(@selector(fractionCompleted))
options:NSKeyValueObservingOptionNew
context:NULL];
}
return self;
}
- (void)dealloc {
[self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))];
[self.uploadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))];
}
#pragma mark - NSProgress Tracking
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context {
if ([object isEqual:self.downloadProgress]) {
if (self.downloadProgressBlock) {
self.downloadProgressBlock(object);
}
}
else if ([object isEqual:self.uploadProgress]) {
if (self.uploadProgressBlock) {
self.uploadProgressBlock(object);
}
}
}
#pragma mark - NSURLSessionTaskDelegate
- (void)URLSession:(__unused NSURLSession *)session
task:(__unused NSURLSessionTask *)task
didSendBodyData:(__unused int64_t)bytesSent
totalBytesSent:(int64_t)totalBytesSent
totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
{
self.progress.totalUnitCount = totalBytesExpectedToSend;
self.progress.completedUnitCount = totalBytesSent;
}
- (void)URLSession:(__unused NSURLSession *)session
task:(NSURLSessionTask *)task
didCompleteWithError:(NSError *)error
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu"
__strong AFURLSessionManager *manager = self.manager;
__block id responseObject = nil;
@ -160,6 +217,14 @@ didCompleteWithError:(NSError *)error
self.mutableData = nil;
}
#if AF_CAN_USE_AT_AVAILABLE && AF_CAN_INCLUDE_SESSION_TASK_METRICS
if (@available(iOS 10, macOS 10.12, watchOS 3, tvOS 10, *)) {
if (self.sessionTaskMetrics) {
userInfo[AFNetworkingTaskDidCompleteSessionTaskMetrics] = self.sessionTaskMetrics;
}
}
#endif
if (self.downloadFileURL) {
userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL;
} else if (data) {
@ -206,63 +271,74 @@ didCompleteWithError:(NSError *)error
});
});
}
#pragma clang diagnostic pop
}
#pragma mark - NSURLSessionDataTaskDelegate
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
- (void)URLSession:(NSURLSession *)session
task:(NSURLSessionTask *)task
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics {
self.sessionTaskMetrics = metrics;
}
#endif
#pragma mark - NSURLSessionDataDelegate
- (void)URLSession:(__unused NSURLSession *)session
dataTask:(__unused NSURLSessionDataTask *)dataTask
didReceiveData:(NSData *)data
{
NSUInteger length = data.length;
long long expectedLength = dataTask.response.expectedContentLength;
if(expectedLength != -1) {
self.progress.totalUnitCount = expectedLength;
self.progress.completedUnitCount += length;
}
self.downloadProgress.totalUnitCount = dataTask.countOfBytesExpectedToReceive;
self.downloadProgress.completedUnitCount = dataTask.countOfBytesReceived;
[self.mutableData appendData:data];
}
#pragma mark - NSURLSessionDownloadTaskDelegate
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
didSendBodyData:(int64_t)bytesSent
totalBytesSent:(int64_t)totalBytesSent
totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend{
self.uploadProgress.totalUnitCount = task.countOfBytesExpectedToSend;
self.uploadProgress.completedUnitCount = task.countOfBytesSent;
}
#pragma mark - NSURLSessionDownloadDelegate
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
didWriteData:(int64_t)bytesWritten
totalBytesWritten:(int64_t)totalBytesWritten
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite{
self.downloadProgress.totalUnitCount = totalBytesExpectedToWrite;
self.downloadProgress.completedUnitCount = totalBytesWritten;
}
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
didResumeAtOffset:(int64_t)fileOffset
expectedTotalBytes:(int64_t)expectedTotalBytes{
self.downloadProgress.totalUnitCount = expectedTotalBytes;
self.downloadProgress.completedUnitCount = fileOffset;
}
- (void)URLSession:(NSURLSession *)session
downloadTask:(NSURLSessionDownloadTask *)downloadTask
didFinishDownloadingToURL:(NSURL *)location
{
NSError *fileManagerError = nil;
self.downloadFileURL = nil;
if (self.downloadTaskDidFinishDownloading) {
self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location);
if (self.downloadFileURL) {
[[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError];
NSError *fileManagerError = nil;
if (fileManagerError) {
if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]) {
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo];
}
}
}
}
- (void)URLSession:(__unused NSURLSession *)session
downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
didWriteData:(__unused int64_t)bytesWritten
totalBytesWritten:(int64_t)totalBytesWritten
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
{
self.progress.totalUnitCount = totalBytesExpectedToWrite;
self.progress.completedUnitCount = totalBytesWritten;
}
- (void)URLSession:(__unused NSURLSession *)session
downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
didResumeAtOffset:(int64_t)fileOffset
expectedTotalBytes:(int64_t)expectedTotalBytes {
self.progress.totalUnitCount = expectedTotalBytes;
self.progress.completedUnitCount = fileOffset;
}
@end
#pragma mark -
@ -276,17 +352,16 @@ expectedTotalBytes:(int64_t)expectedTotalBytes {
* - https://github.com/AFNetworking/AFNetworking/pull/2702
*/
static inline void af_swizzleSelector(Class class, SEL originalSelector, SEL swizzledSelector) {
Method originalMethod = class_getInstanceMethod(class, originalSelector);
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
static inline void af_swizzleSelector(Class theClass, SEL originalSelector, SEL swizzledSelector) {
Method originalMethod = class_getInstanceMethod(theClass, originalSelector);
Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector);
method_exchangeImplementations(originalMethod, swizzledMethod);
}
static inline BOOL af_addMethod(Class class, SEL selector, Method method) {
return class_addMethod(class, selector, method_getImplementation(method), method_getTypeEncoding(method));
static inline BOOL af_addMethod(Class theClass, SEL selector, Method method) {
return class_addMethod(theClass, selector, method_getImplementation(method), method_getTypeEncoding(method));
}
static void *AFNSURLSessionTaskSessionManagerKey = &AFNSURLSessionTaskSessionManagerKey;
static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume";
static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofire.networking.nsurlsessiontask.suspend";
@ -329,9 +404,11 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods
8) Set the current class to the super class, and repeat steps 3-8
*/
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnonnull"
NSURLSessionDataTask *localDataTask = [[NSURLSession sessionWithConfiguration:nil] dataTaskWithURL:nil];
NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil];
#pragma clang diagnostic pop
IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(af_resume)));
Class currentClass = [localDataTask class];
@ -348,19 +425,20 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
}
[localDataTask cancel];
[session finishTasksAndInvalidate];
}
}
+ (void)swizzleResumeAndSuspendMethodForClass:(Class)class {
+ (void)swizzleResumeAndSuspendMethodForClass:(Class)theClass {
Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume));
Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend));
if (af_addMethod(class, @selector(af_resume), afResumeMethod)) {
af_swizzleSelector(class, @selector(resume), @selector(af_resume));
if (af_addMethod(theClass, @selector(af_resume), afResumeMethod)) {
af_swizzleSelector(theClass, @selector(resume), @selector(af_resume));
}
if (af_addMethod(class, @selector(af_suspend), afSuspendMethod)) {
af_swizzleSelector(class, @selector(suspend), @selector(af_suspend));
if (af_addMethod(theClass, @selector(af_suspend), afSuspendMethod)) {
af_swizzleSelector(theClass, @selector(suspend), @selector(af_suspend));
}
}
@ -397,15 +475,19 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
@property (readwrite, nonatomic, strong) NSOperationQueue *operationQueue;
@property (readwrite, nonatomic, strong) NSURLSession *session;
@property (readwrite, nonatomic, strong) NSMutableDictionary *mutableTaskDelegatesKeyedByTaskIdentifier;
@property (readonly, nonatomic, copy) NSString *taskDescriptionForSessionTasks;
@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) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream;
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData;
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidCompleteBlock taskDidComplete;
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
@property (readwrite, nonatomic, copy) AFURLSessionTaskDidFinishCollectingMetricsBlock taskDidFinishCollectingMetrics;
#endif
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveResponseBlock dataTaskDidReceiveResponse;
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidBecomeDownloadTaskBlock dataTaskDidBecomeDownloadTask;
@property (readwrite, nonatomic, copy) AFURLSessionDataTaskDidReceiveDataBlock dataTaskDidReceiveData;
@ -436,8 +518,6 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
self.operationQueue = [[NSOperationQueue alloc] init];
self.operationQueue.maxConcurrentOperationCount = 1;
self.session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue];
self.responseSerializer = [AFJSONResponseSerializer serializer];
self.securityPolicy = [AFSecurityPolicy defaultPolicy];
@ -453,7 +533,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
[self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
for (NSURLSessionDataTask *task in dataTasks) {
[self addDelegateForDataTask:task completionHandler:nil];
[self addDelegateForDataTask:task uploadProgress:nil downloadProgress:nil completionHandler:nil];
}
for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
@ -465,9 +545,6 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
}
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:nil];
return self;
}
@ -477,23 +554,42 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
#pragma mark -
- (NSURLSession *)session {
@synchronized (self) {
if (!_session) {
_session = [NSURLSession sessionWithConfiguration:self.sessionConfiguration delegate:self delegateQueue:self.operationQueue];
}
}
return _session;
}
#pragma mark -
- (NSString *)taskDescriptionForSessionTasks {
return [NSString stringWithFormat:@"%p", self];
}
- (void)taskDidResume:(NSNotification *)notification {
NSURLSessionTask *task = notification.object;
AFURLSessionManager *manager = [self managerForTask:task];
if (self == manager) {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task];
});
if ([task respondsToSelector:@selector(taskDescription)]) {
if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidResumeNotification object:task];
});
}
}
}
- (void)taskDidSuspend:(NSNotification *)notification {
NSURLSessionTask *task = notification.object;
AFURLSessionManager *manager = [self managerForTask:task];
if (self == manager) {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task];
});
if ([task respondsToSelector:@selector(taskDescription)]) {
if ([task.taskDescription isEqualToString:self.taskDescriptionForSessionTasks]) {
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingTaskDidSuspendNotification object:task];
});
}
}
}
@ -518,63 +614,47 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
[self.lock lock];
self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate;
[self addNotificationObserverForTask:task];
[self.lock unlock];
}
- (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask
uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock
downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock
completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
{
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:dataTask];
delegate.manager = self;
delegate.completionHandler = completionHandler;
[self setManagerForTask:dataTask];
dataTask.taskDescription = self.taskDescriptionForSessionTasks;
[self setDelegate:delegate forTask:dataTask];
delegate.uploadProgressBlock = uploadProgressBlock;
delegate.downloadProgressBlock = downloadProgressBlock;
}
- (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock
completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
{
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:uploadTask];
delegate.manager = self;
delegate.completionHandler = completionHandler;
int64_t totalUnitCount = uploadTask.countOfBytesExpectedToSend;
if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
NSString *contentLength = [uploadTask.originalRequest valueForHTTPHeaderField:@"Content-Length"];
if(contentLength) {
totalUnitCount = (int64_t)[contentLength longLongValue];
}
}
uploadTask.taskDescription = self.taskDescriptionForSessionTasks;
if (delegate.progress) {
delegate.progress.totalUnitCount = totalUnitCount;
} else {
delegate.progress = [NSProgress progressWithTotalUnitCount:totalUnitCount];
}
delegate.progress.pausingHandler = ^{
[uploadTask suspend];
};
delegate.progress.cancellationHandler = ^{
[uploadTask cancel];
};
if (progress) {
*progress = delegate.progress;
}
[self setManagerForTask:uploadTask];
[self setDelegate:delegate forTask:uploadTask];
delegate.uploadProgressBlock = uploadProgressBlock;
}
- (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock
destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
{
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:downloadTask];
delegate.manager = self;
delegate.completionHandler = completionHandler;
@ -584,28 +664,22 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
};
}
if (progress) {
*progress = delegate.progress;
}
downloadTask.taskDescription = self.taskDescriptionForSessionTasks;
[self setManagerForTask:downloadTask];
[self setDelegate:delegate forTask:downloadTask];
delegate.downloadProgressBlock = downloadProgressBlock;
}
- (void)removeDelegateForTask:(NSURLSessionTask *)task {
NSParameterAssert(task);
[self.lock lock];
[self removeNotificationObserverForTask:task];
[self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)];
[self.lock unlock];
}
- (void)removeAllDelegates {
[self.lock lock];
[self.mutableTaskDelegatesKeyedByTaskIdentifier removeAllObjects];
[self.lock unlock];
}
#pragma mark -
- (NSArray *)tasksForKeyPath:(NSString *)keyPath {
@ -649,13 +723,18 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
#pragma mark -
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks {
dispatch_async(dispatch_get_main_queue(), ^{
if (cancelPendingTasks) {
[self.session invalidateAndCancel];
} else {
[self.session finishTasksAndInvalidate];
}
});
[self invalidateSessionCancelingTasks:cancelPendingTasks resetSession:NO];
}
- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession {
if (cancelPendingTasks) {
[self.session invalidateAndCancel];
} else {
[self.session finishTasksAndInvalidate];
}
if (resetSession) {
self.session = nil;
}
}
#pragma mark -
@ -666,17 +745,36 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
_responseSerializer = responseSerializer;
}
#pragma mark -
- (void)addNotificationObserverForTask:(NSURLSessionTask *)task {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:task];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:task];
}
- (void)removeNotificationObserverForTask:(NSURLSessionTask *)task {
[[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidSuspendNotification object:task];
[[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidResumeNotification object: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;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
dataTask = [self.session dataTaskWithRequest:request];
});
[self addDelegateForDataTask:dataTask completionHandler:completionHandler];
[self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler];
return dataTask;
}
@ -685,50 +783,55 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
fromFile:(NSURL *)fileURL
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock
completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
{
__block NSURLSessionUploadTask *uploadTask = nil;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
});
if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
// uploadTask may be nil on iOS7 because uploadTaskWithRequest:fromFile: may return nil despite being documented as nonnull (https://devforums.apple.com/message/926113#926113)
if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
}
}
});
if (uploadTask) {
[self addDelegateForUploadTask:uploadTask
progress:uploadProgressBlock
completionHandler:completionHandler];
}
[self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
return uploadTask;
}
- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
fromData:(NSData *)bodyData
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock
completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
{
__block NSURLSessionUploadTask *uploadTask = nil;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData];
});
[self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
[self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler];
return uploadTask;
}
- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock
completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
{
__block NSURLSessionUploadTask *uploadTask = nil;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
uploadTask = [self.session uploadTaskWithStreamedRequest:request];
});
[self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
[self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler];
return uploadTask;
}
@ -736,46 +839,42 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
#pragma mark -
- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock
destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
{
__block NSURLSessionDownloadTask *downloadTask = nil;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
downloadTask = [self.session downloadTaskWithRequest:request];
});
[self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
[self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler];
return downloadTask;
}
- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
progress:(NSProgress * __autoreleasing *)progress
progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock
destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
{
__block NSURLSessionDownloadTask *downloadTask = nil;
dispatch_sync(url_session_manager_creation_queue(), ^{
url_session_manager_create_task_safely(^{
downloadTask = [self.session downloadTaskWithResumeData:resumeData];
});
[self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
[self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler];
return downloadTask;
}
#pragma mark -
- (NSProgress *)progressForDataTask:(NSURLSessionDataTask *)dataTask {
return [[self delegateForTask:dataTask] progress];
- (NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task {
return [[self delegateForTask:task] uploadProgress];
}
- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask {
return [[self delegateForTask:uploadTask] progress];
}
- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask {
return [[self delegateForTask:downloadTask] progress];
- (NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task {
return [[self delegateForTask:task] downloadProgress];
}
#pragma mark -
@ -788,9 +887,11 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
self.sessionDidReceiveAuthenticationChallenge = block;
}
#if !TARGET_OS_OSX
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block {
self.didFinishEventsForBackgroundURLSession = block;
}
#endif
#pragma mark -
@ -814,6 +915,12 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
self.taskDidComplete = block;
}
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
- (void)setTaskDidFinishCollectingMetricsBlock:(void (^)(NSURLSession * _Nonnull, NSURLSessionTask * _Nonnull, NSURLSessionTaskMetrics * _Nullable))block {
self.taskDidFinishCollectingMetrics = block;
}
#endif
#pragma mark -
- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block {
@ -846,15 +953,6 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
self.downloadTaskDidResume = block;
}
#pragma mark -
- (void)setManagerForTask:(NSURLSessionTask *)task {
objc_setAssociatedObject(task, AFNSURLSessionTaskSessionManagerKey, self, OBJC_ASSOCIATION_ASSIGN);
}
- (nullable instancetype)managerForTask:(NSURLSessionTask *)task {
return objc_getAssociatedObject(task, AFNSURLSessionTaskSessionManagerKey);
}
#pragma mark - NSObject
- (NSString *)description {
@ -868,9 +966,12 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
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];
}
@ -884,7 +985,6 @@ didBecomeInvalidWithError:(NSError *)error
self.sessionDidBecomeInvalid(session, error);
}
[self removeAllDelegates];
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session];
}
@ -991,15 +1091,18 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
{
int64_t totalUnitCount = totalBytesExpectedToSend;
if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
if (totalUnitCount == NSURLSessionTransferSizeUnknown) {
NSString *contentLength = [task.originalRequest valueForHTTPHeaderField:@"Content-Length"];
if(contentLength) {
if (contentLength) {
totalUnitCount = (int64_t) [contentLength longLongValue];
}
}
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
[delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
if (delegate) {
[delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalBytesExpectedToSend];
}
if (self.taskDidSendBodyData) {
self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount);
@ -1022,9 +1125,25 @@ didCompleteWithError:(NSError *)error
if (self.taskDidComplete) {
self.taskDidComplete(session, task, error);
}
}
#if AF_CAN_INCLUDE_SESSION_TASK_METRICS
- (void)URLSession:(NSURLSession *)session
task:(NSURLSessionTask *)task
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
{
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
// Metrics may fire after URLSession:task:didCompleteWithError: is called, delegate may be nil
if (delegate) {
[delegate URLSession:session task:task didFinishCollectingMetrics:metrics];
}
if (self.taskDidFinishCollectingMetrics) {
self.taskDidFinishCollectingMetrics(session, task, metrics);
}
}
#endif
#pragma mark - NSURLSessionDataDelegate
- (void)URLSession:(NSURLSession *)session
@ -1063,7 +1182,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
didReceiveData:(NSData *)data
{
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask];
[delegate URLSession:session dataTask:dataTask didReceiveData:data];
@ -1088,6 +1206,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
}
}
#if !TARGET_OS_OSX
- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session {
if (self.didFinishEventsForBackgroundURLSession) {
dispatch_async(dispatch_get_main_queue(), ^{
@ -1095,6 +1214,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
});
}
}
#endif
#pragma mark - NSURLSessionDownloadDelegate
@ -1108,8 +1228,8 @@ didFinishDownloadingToURL:(NSURL *)location
if (fileURL) {
delegate.downloadFileURL = fileURL;
NSError *error = nil;
[[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error];
if (error) {
if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]) {
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo];
}
@ -1128,8 +1248,12 @@ didFinishDownloadingToURL:(NSURL *)location
totalBytesWritten:(int64_t)totalBytesWritten
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
{
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
[delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
if (delegate) {
[delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
}
if (self.downloadTaskDidWriteData) {
self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
@ -1141,8 +1265,12 @@ totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
didResumeAtOffset:(int64_t)fileOffset
expectedTotalBytes:(int64_t)expectedTotalBytes
{
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
[delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes];
if (delegate) {
[delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes];
}
if (self.downloadTaskDidResume) {
self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes);
@ -1155,7 +1283,7 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
return YES;
}
- (id)initWithCoder:(NSCoder *)decoder {
- (instancetype)initWithCoder:(NSCoder *)decoder {
NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
self = [self initWithSessionConfiguration:configuration];
@ -1172,7 +1300,7 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {
- (instancetype)copyWithZone:(NSZone *)zone {
return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration];
}

View File

@ -2,22 +2,358 @@
All notable changes to this project will be documented in this file.
`AFNetworking` adheres to [Semantic Versioning](http://semver.org/).
---
---
## [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).
#### Added
* Improved `AFImageResponseSerializer` test coverage
* Implemented by quellish in [#3367](https://github.com/AFNetworking/AFNetworking/pull/3367).
* Exposed `AFQueryStringFromParameters` and `AFPercentEscapedStringFromString` for public use.
* Implemented by Kevin Harwood in [#3160](https://github.com/AFNetworking/AFNetworking/pull/3160).
#### Updated
* Updated Test Suite to run on Xcode 7.3
* Implemented by Kevin Harwood in [#3418](https://github.com/AFNetworking/AFNetworking/pull/3418).
* Added white space to URLs in code comment to allow Xcode to properly parse them
* Implemented by Draveness in [#3384](https://github.com/AFNetworking/AFNetworking/pull/3384).
* Updated documentation to match method names and correct compiler warnings
* Implemented by Hakon Hanesand in [#3369](https://github.com/AFNetworking/AFNetworking/pull/3369).
* Use `NSKeyValueChangeNewKey` constant in change dictionary rather than hardcoded string.
* Implemented by Wenbin Zhang in [#3360](https://github.com/AFNetworking/AFNetworking/pull/3360).
* Resolved compiler warnings for documentation errors
* Implemented by Ricardo Santos in [#3336](https://github.com/AFNetworking/AFNetworking/pull/3336).
#### Changed
* Reverted `NSURLSessionAuthChallengeDisposition` to `NSURLSessionAuthChallengeCancelAuthenticationChallenge` for SSL Pinning
* Implemented by Kevin Harwood in [#3417](https://github.com/AFNetworking/AFNetworking/pull/3417).
#### Fixed
* Removed trailing question mark in query string if parameters are empty
* Implemented by Kevin Harwood in [#3386](https://github.com/AFNetworking/AFNetworking/pull/3386).
* Fixed crash if bad URL was passed into the image downloader
* Implemented by Christian Wen and Kevin Harwood in [#3385](https://github.com/AFNetworking/AFNetworking/pull/3385).
* Fixed image memory calculation
* Implemented by 周明宇 in [#3344](https://github.com/AFNetworking/AFNetworking/pull/3344).
* Fixed issue where UIButton image downloading called wrong cancel method
* Implemented by duanhong in [#3332](https://github.com/AFNetworking/AFNetworking/pull/3332).
* Fixed image downloading cancellation race condition
* Implemented by Kevin Harwood in [#3325](https://github.com/AFNetworking/AFNetworking/pull/3325).
* Fixed static analyzer warnings on AFNetworkReachabilityManager
* Implemented by Jeff Kelley in [#3315](https://github.com/AFNetworking/AFNetworking/pull/3315).
* Fixed issue where download progress would not be reported in iOS 7
* Implemented by zwm in [#3294](https://github.com/AFNetworking/AFNetworking/pull/3294).
* Fixed status code 204/205 handling
* Implemented by Kevin Harwood in [#3292](https://github.com/AFNetworking/AFNetworking/pull/3292).
* Fixed crash when passing nil/null for progress in UIWebView extension
* Implemented by Kevin Harwood in [#3289](https://github.com/AFNetworking/AFNetworking/pull/3289).
#### Removed
* Removed workaround for NSJSONSerialization bug that was fixed in iOS 7
* Implemented by Cédric Luthi in [#3253](https://github.com/AFNetworking/AFNetworking/pull/3253).
## [3.0.4](https://github.com/AFNetworking/AFNetworking/releases/tag/3.0.4) (12/18/2015)
Released on Friday, December 18, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.4+is%3Aclosed).
#### Fixed
* Fixed issue where `AFNSURLSessionTaskDidResumeNotification` was removed twice
* Implemented by Kevin Harwood in [#3236](https://github.com/AFNetworking/AFNetworking/pull/3236).
## [3.0.3](https://github.com/AFNetworking/AFNetworking/releases/tag/3.0.3) (12/16/2015)
Released on Wednesday, December 16, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.3+is%3Aclosed).
#### Added
* Added tests for response serializers to increase test coverage
* Implemented by Kevin Harwood in [#3233](https://github.com/AFNetworking/AFNetworking/pull/3233).
#### Fixed
* Fixed `AFImageResponseSerializer` serialization macros on watchOS and tvOS
* Implemented by Charles Joseph in [#3229](https://github.com/AFNetworking/AFNetworking/pull/3229).
## [3.0.2](https://github.com/AFNetworking/AFNetworking/releases/tag/3.0.2) (12/14/2015)
Released on Monday, December 14, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.2+is%3Aclosed).
#### Fixed
* Fixed a crash in `AFURLSessionManager` when resuming download tasks
* Implemented by Chongyu Zhu in [#3222](https://github.com/AFNetworking/AFNetworking/pull/3222).
* Fixed issue where background button image would not be updated
* Implemented by eofs in [#3220](https://github.com/AFNetworking/AFNetworking/pull/3220).
## [3.0.1](https://github.com/AFNetworking/AFNetworking/releases/tag/3.0.1) (12/11/2015)
Released on Friday, December 11, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.1+is%3Aclosed).
#### Added
* Added Xcode 7.2 support to Travis
* Implemented by Kevin Harwood in [#3216](https://github.com/AFNetworking/AFNetworking/pull/3216).
#### Fixed
* Fixed race condition with ImageView/Button image downloading when starting/cancelling/starting the same request
* Implemented by Kevin Harwood in [#3215](https://github.com/AFNetworking/AFNetworking/pull/3215).
## [3.0.0](https://github.com/AFNetworking/AFNetworking/releases/tag/3.0.0) (12/10/2015)
Released on Thursday, December 10, 2015. All issues associated with this milestone can be found using this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.0+is%3Aclosed).
For detailed information about migrating to AFNetworking 3.0.0, please reference the [migration guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide). All 3.0.0 beta changes will be tracked with this [filter](https://github.com/AFNetworking/AFNetworking/issues?q=milestone%3A3.0.0+is%3Aclosed).
#### Added
* Added support for older versions of Xcode to Travis
* Implemented by Kevin Harwood in [#3209](https://github.com/AFNetworking/AFNetworking/pull/3209).
* Added support for [Codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/AFNetworking?branch=master#sort=coverage&dir=desc)
* Implemented by Cédric Luthi and Kevin Harwood in [#3196](https://github.com/AFNetworking/AFNetworking/pull/3196).
* * **Please help us increase overall coverage by submitting a pull request!**
* Added support for IPv6 to Reachability
* Implemented by SAMUKEI and Kevin Harwood in [#3174](https://github.com/AFNetworking/AFNetworking/pull/3174).
* Added support for Objective-C light weight generics
* Implemented by Kevin Harwood in [#3166](https://github.com/AFNetworking/AFNetworking/pull/3166).
* Added nullability attributes to response object in success block
* Implemented by Nathan Racklyeft in [#3154](https://github.com/AFNetworking/AFNetworking/pull/3154).
* Migrated to Fastlane for CI and Deployment
* Implemented by Kevin Harwood in [#3148](https://github.com/AFNetworking/AFNetworking/pull/3148).
* Added support for tvOS
* Implemented by Kevin Harwood in [#3128](https://github.com/AFNetworking/AFNetworking/issues/3128).
* New image downloading architecture
* Implemented by Kevin Harwood in [#3122](https://github.com/AFNetworking/AFNetworking/issues/3122).
* Added Carthage Support
* Implemented by Kevin Harwood in [#3121](https://github.com/AFNetworking/AFNetworking/issues/3121).
* Added a method to create a unique reachability manager
* Implemented by Mo Bitar in [#3111](https://github.com/AFNetworking/AFNetworking/pull/3111).
* Added a initial delay to the network indicator per the Apple HIG
* Implemented by Kevin Harwood in [#3094](https://github.com/AFNetworking/AFNetworking/pull/3094).
#### Updated
* Improved testing reliability for continuous integration
* Implemented by Kevin Harwood in [#3124](https://github.com/AFNetworking/AFNetworking/pull/3124).
* Example project now consumes AFNetworking as a library.
* Implemented by Kevin Harwood in [#3068](https://github.com/AFNetworking/AFNetworking/pull/3068).
* Migrated to using `instancetype` where applicable
* Implemented by Kyle Fuller in [#3064](https://github.com/AFNetworking/AFNetworking/pull/3064).
* Tweaks to project to support Framework Project
* Implemented by Christian Noon in [#3062](https://github.com/AFNetworking/AFNetworking/pull/3062).
#### Changed
* Split the iOS and OS X AppDelegate classes in the Example Project
* Implemented by Cédric Luthi in [#3193](https://github.com/AFNetworking/AFNetworking/pull/3193).
* Changed SSL Pinning Error to be `NSURLErrorServerCertificateUntrusted`
* Implemented by Cédric Luthi and Kevin Harwood in [#3191](https://github.com/AFNetworking/AFNetworking/pull/3191).
* New Progress Reporting API using `NSProgress`
* Implemented by Kevin Harwood in [#3187](https://github.com/AFNetworking/AFNetworking/pull/3187).
* Changed `pinnedCertificates` type in `AFSecurityPolicy` from `NSArray` to `NSSet`
* Implemented by Cédric Luthi in [#3164](https://github.com/AFNetworking/AFNetworking/pull/3164).
#### Fixed
* Improved task creation performance for iOS 8+
* Implemented by nikitahils, Nikita G and Kevin Harwood in [#3208](https://github.com/AFNetworking/AFNetworking/pull/3208).
* Fixed certificate validation for servers providing incomplete chains
* Implemented by André Pacheco Neves in [#3159](https://github.com/AFNetworking/AFNetworking/pull/3159).
* Fixed bug in `AFMultipartBodyStream` that may cause the input stream to read more bytes than required.
* Implemented by bang in [#3153](https://github.com/AFNetworking/AFNetworking/pull/3153).
* Fixed race condition crash from Resume/Suspend task notifications
* Implemented by Kevin Harwood in [#3152](https://github.com/AFNetworking/AFNetworking/pull/3152).
* Fixed `AFImageDownloader` stalling after numerous failures
* Implemented by Rick Silva in [#3150](https://github.com/AFNetworking/AFNetworking/pull/3150).
* Fixed warnings generated in UIWebView category
* Implemented by Kevin Harwood in [#3126](https://github.com/AFNetworking/AFNetworking/pull/3126).
#### Removed
* Removed AFBase64EncodedStringFromString static function
* Implemented by Cédric Luthi in [#3188](https://github.com/AFNetworking/AFNetworking/pull/3188).
* Removed code supporting conditional compilation for unsupported development configurations.
* Implemented by Cédric Luthi in [#3177](https://github.com/AFNetworking/AFNetworking/pull/3177).
* Removed deprecated methods, properties, and notifications from AFN 2.x
* Implemented by Kevin Harwood in [#3168](https://github.com/AFNetworking/AFNetworking/pull/3168).
* Removed support for `NSURLConnection`
* Implemented by Kevin Harwood in [#3120](https://github.com/AFNetworking/AFNetworking/issues/3120).
* Removed `UIAlertView` category support since it is now deprecated
* 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)
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
* Fixed clang analyzer warning suppression that prevented building under some project configurations
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3142](https://github.com/AFNetworking/AFNetworking/pull/3142).
* Restored Xcode 6 compatibility
* 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)
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
* [#3130](https://github.com/AFNetworking/AFNetworking/pull/3130) fixes a swift interop error that does have a breaking API change if you are using Swift. This was [identified](https://github.com/AFNetworking/AFNetworking/issues/3137) after 2.6.2 was released. It changes the method from `throws` to an error pointer, since that method does return an object and also handles an error pointer, which does not play nicely with the Swift/Objective-C error conversion. See [#2810](https://github.com/AFNetworking/AFNetworking/issues/2810) for additional notes. This affects `AFURLRequestionSerializer` and `AFURLResponseSerializer`.
#### Added
* `AFHTTPSessionManager` now copies its `securityPolicy`
* Fixed by [mohamede1945](https://github.com/mohamede1945) in [#2887](https://github.com/AFNetworking/AFNetworking/pull/2887).
#### Updated
* Updated travis to run on 7.1
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3132](https://github.com/AFNetworking/AFNetworking/pull/3132).
* Simplifications of if and return statements in `AFSecurityPolicy`
* Fixed by [TorreyBetts](https://github.com/TorreyBetts) in [#3063](https://github.com/AFNetworking/AFNetworking/pull/3063).
#### Fixed
* Fixed swift interop issue that prevented returning a nil NSURL for a download task
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3133](https://github.com/AFNetworking/AFNetworking/pull/3133).
* Suppressed false positive memory leak warning in Reachability Manager
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3131](https://github.com/AFNetworking/AFNetworking/pull/3131).
* Fixed swift interop issue with throws and Request/Response serialization.
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3130](https://github.com/AFNetworking/AFNetworking/pull/3130).
* Fixed race condition in reachability callback delivery
* Fixed by [MichaelHackett](https://github.com/MichaelHackett) in [#3117](https://github.com/AFNetworking/AFNetworking/pull/3117).
* Fixed URLs that were redirecting in the README
* Fixed by [frankenbot](https://github.com/frankenbot) in [#3109](https://github.com/AFNetworking/AFNetworking/pull/3109).
* Fixed Project Warnings
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3102](https://github.com/AFNetworking/AFNetworking/pull/3102).
* Fixed README link to WWDC session
* Fixed by [wrtsprt](https://github.com/wrtsprt) in [#3099](https://github.com/AFNetworking/AFNetworking/pull/3099).
* Switched from `OS_OBJECT_HAVE_OBJC_SUPPORT` to `OS_OBJECT_USE_OBJC` for watchOS 2 support.
* Fixed by [kylef](https://github.com/kylef) in [#3065](https://github.com/AFNetworking/AFNetworking/pull/3065).
* Added missing __nullable attributes to failure blocks in `AFHTTPRequestOperationManager` and `AFHTTPSessionManager`
* Fixed by [hoppenichu](https://github.com/hoppenichu) in [#3057](https://github.com/AFNetworking/AFNetworking/pull/3057).
* Fixed memory leak in NSURLSession handling
* Fixed by [olegnaumenko](https://github.com/olegnaumenko) in [#2794](https://github.com/AFNetworking/AFNetworking/pull/2794).
## [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
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 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.
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2909](https://github.com/AFNetworking/AFNetworking/issues/2909).
* Added missing nullable attributes to `AFURLRequestSerialization` and `AFURLSessionManager`.
* Fixed by [andrewtoth](https://github.com/andrewtoth) in [#2911](https://github.com/AFNetworking/AFNetworking/pull/2911).
* Migrated to `OS_OBJECT_USE_OBJC`.
* Fixed by [canius](https://github.com/canius) in [#2930](https://github.com/AFNetworking/AFNetworking/pull/2930).
* Added missing nullable tags to UIKit extensions.
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3000](https://github.com/AFNetworking/AFNetworking/pull/3000).
* Fixed potential infinite recursion loop if multiple versions of AFNetworking are loaded in a target.
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2743](https://github.com/AFNetworking/AFNetworking/issues/2743).
* Updated Travis CI test script
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#3032](https://github.com/AFNetworking/AFNetworking/issues/3032).
* Migrated to `FOUNDATION_EXPORT` from `extern`.
* Fixed by [Andrey Mikhaylov](https://github.com/pronebird) in [#3041](https://github.com/AFNetworking/AFNetworking/pull/3041).
* Fixed issue where `AFURLConnectionOperation` could get stuck in an infinite loop.
* Fixed by [Mattt Thompson](https://github.com/mattt) in [#2496](https://github.com/AFNetworking/AFNetworking/pull/2496).
* Fixed regression where URL request serialization would crash on iOS 8 for long URLs.
* Fixed by [softenhard](https://github.com/softenhard) in [#3028](https://github.com/AFNetworking/AFNetworking/pull/3028).
## [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 support has now been removed from the podspec. Note that iOS 6 support has not been removed explicitly from the project, but it will be removed in a future update.
* 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.
* **Full Certificate Chain Validation has been removed** from `AFSecurityPolicy`. As discussed in [#2744](https://github.com/AFNetworking/AFNetworking/issues/2744), there was no documented security advantage to pinning against an entire certificate chain. If you were using full certificate chain, please determine and select the most ideal certificate in your chain to pin against.
* Implemented by [Kevin Harwood](https://github.com/kcharwood) in [#2856](https://github.com/AFNetworking/AFNetworking/pull/2856).
* Implemented by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2856](https://github.com/AFNetworking/AFNetworking/pull/2856).
* **The request url will now be returned by the `UIImageView` category if the image is returned from cache.** In previous releases, both the request and the response were nil. Going forward, only the response will be nil.
* Implemented by [Chris Gibbs](https://github.com/chrisgibbs) in [#2771](https://github.com/AFNetworking/AFNetworking/pull/2771).
* **Support for App Extension Targets is now baked in using `NS_EXTENSION_UNAVAILABLE_IOS`.** You no longer need to define `AF_APP_EXTENSIONS` in order to include code in a extension target.
* Implemented by [bnickel](https://github.com/bnickel) in [#2737](https://github.com/AFNetworking/AFNetworking/pull/2737).
* This release now supports watchOS 2.0, which relys on target conditionals that are only present in Xcode 7 and iOS 9/watchOS 2.0/OS X 10.10. If you install the library using CocoaPods, AFNetworking will define these target conditionals for on older platforms, allowing your code to complile. If you do not use Cocoapods, you will need to add the following code your to PCH file.
* This release now supports watchOS 2.0, which relys on target conditionals that are only present in Xcode 7 and iOS 9/watchOS 2.0/OS X 10.10. If you install the library using CocoaPods, AFNetworking will define these target conditionals for on older platforms, allowing your code to compile. If you do not use Cocoapods, you will need to add the following code your to PCH file.
```
#ifndef TARGET_OS_IOS
@ -28,63 +364,63 @@ Please note the following API/project changes have been made:
#endif
```
* This release migrates query parameter serialization to model AlamoFire and adhere to RFC standards. Note that `/` and `?` are no longer encoded by default.
* Implemented by [Kevin Harwood](https://github.com/kcharwood) in [#2908](https://github.com/AFNetworking/AFNetworking/pull/2908).
* Implemented by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2908](https://github.com/AFNetworking/AFNetworking/pull/2908).
**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/kcharwood) in [#2837](https://github.com/AFNetworking/AFNetworking/issues/2837).
* 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.
* Added by [Frank LSF](https://github.com/franklsf95) and [Kevin Harwood](https://github.com/kcharwood) in [#2814](https://github.com/AFNetworking/AFNetworking/pull/2814).
* Added by [Frank LSF](https://github.com/franklsf95) and [Kevin Harwood](https://github.com/Kevin Harwood) in [#2814](https://github.com/AFNetworking/AFNetworking/pull/2814).
* Converted source to Modern Objective-C Syntax.
* Implemented by [Matt Shedlick](https://github.com/mattshedlick) and [Kevin Harwood](https://github.com/kcharwood) in [#2688](https://github.com/AFNetworking/AFNetworking/pull/2688).
* Implemented by [Matt Shedlick](https://github.com/mattshedlick) and [Kevin Harwood](https://github.com/Kevin Harwood) in [#2688](https://github.com/AFNetworking/AFNetworking/pull/2688).
* Improved memory performance when download large objects.
* Fixed by [Gabe Zabrino](https://github.com/gfzabarino) and [Kevin Harwood](https://github.com/kcharwood) in [#2672](https://github.com/AFNetworking/AFNetworking/pull/2672).
* 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/kcharwood) and [bnickle](https://github.com/bnickel) in [#2741](https://github.com/AFNetworking/AFNetworking/pull/2741).
* 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`.
* Fixed by [Paulo Ferreria](https://github.com/paulosotu) and [Kevin Harwood](https://github.com/kcharwood) in [#2815](https://github.com/AFNetworking/AFNetworking/pull/2815).
* Fixed by [Paulo Ferreria](https://github.com/paulosotu) and [Kevin Harwood](https://github.com/Kevin Harwood) in [#2815](https://github.com/AFNetworking/AFNetworking/pull/2815).
* Fixed an issue where tests failed to run on CI due to unavailable simulators.
* Fixed by [Kevin Harwood](https://github.com/kcharwood) in [#2834](https://github.com/AFNetworking/AFNetworking/pull/2834).
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2834](https://github.com/AFNetworking/AFNetworking/pull/2834).
* Fixed "method override not found" warnings in Xcode 7 Betas
* Fixed by [Ben Guo](https://github.com/benzguo) in [#2822](https://github.com/AFNetworking/AFNetworking/pull/2822)
* Removed Duplicate Import and UIKit Header file.
* Fixed by [diehardest](https://github.com/diehardest) in [#2813](https://github.com/AFNetworking/AFNetworking/pull/2813)
* Removed the ability to include duplicate certificates in the pinned certificate chain.
* Fixed by [Kevin Harwood](https://github.com/kcharwood) in [#2756](https://github.com/AFNetworking/AFNetworking/pull/2756).
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2756](https://github.com/AFNetworking/AFNetworking/pull/2756).
* 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
* Added by [Jawwad Ahmad](https://github.com/jawwad) in [#2831](https://github.com/AFNetworking/AFNetworking/pull/2831).
* Fixed documentation error around how `baseURL` is used for reachability monitoring.
* Fixed by [Kevin Harwood](https://github.com/kcharwood) in [#2761](https://github.com/AFNetworking/AFNetworking/pull/2761).
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2761](https://github.com/AFNetworking/AFNetworking/pull/2761).
* Numerous spelling corrections in the documentation.
* Fixed by [Antoine Cœur](https://github.com/Coeur) in [#2732](https://github.com/AFNetworking/AFNetworking/pull/2732) and [#2898](https://github.com/AFNetworking/AFNetworking/pull/2898).
## [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/kcharwood) in [#2716](https://github.com/AFNetworking/AFNetworking/pull/2716).
* 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/kcharwood) in [#2702](https://github.com/AFNetworking/AFNetworking/pull/2702).
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2702](https://github.com/AFNetworking/AFNetworking/pull/2702).
* Fixed an issue where the OS X test linker would throw a warning during tests.
* Fixed by [Christian Noon](https://github.com/cnoon) in [#2719](https://github.com/AFNetworking/AFNetworking/pull/2719).
* Fixed an issue where tests would randomly fail due to mocked objects not being cleaned up.
* Fixed by [Kevin Harwood](https://github.com/kcharwood) in [#2717](https://github.com/AFNetworking/AFNetworking/pull/2717).
* Fixed by [Kevin Harwood](https://github.com/Kevin Harwood) in [#2717](https://github.com/AFNetworking/AFNetworking/pull/2717).
## [2.5.3](https://github.com/AFNetworking/AFNetworking/releases/tag/2.5.3) (2015-04-20)
@ -819,7 +1155,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)
@ -1523,7 +1859,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)
@ -1588,7 +1924,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
@ -1608,7 +1944,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)
@ -1653,7 +1989,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)
@ -1711,7 +2047,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)

View File

@ -8,6 +8,7 @@ Please read it before you start participating.
* [Asking Questions](#asking-questions)
* [Reporting Security Issues](#reporting-security-issues)
* [Reporting Issues](#reporting-other-issues)
* [Submitting Pull Requests](#submitting-pull-requests)
* [Developers Certificate of Origin](#developers-certificate-of-origin)
* [Code of Conduct](#code-of-conduct)
@ -52,6 +53,10 @@ When reporting issues, please include the following:
This information will help us review and fix your issue faster.
## Submitting Pull Requests
Pull requests are welcome, and greatly encouraged. When submitting a pull request, please create proper test cases demonstrating the issue to be fixed or the new feature.
## Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:

97
CONTRIBUTING_CH.md Normal file
View File

@ -0,0 +1,97 @@
# 贡献指南
本文档包含有关为此项目做出贡献的信息和指南。
请在开始参加之前阅读。
**主题**
* [提问](#提问)
* [报告安全问题](#报告安全问题)
* [报告其他问题](#报告其他问题)
* [提交拉取请求](#提交拉取请求)
* [开发人员原产地证书](#开发人员原产地证书-1.1)
* [行为守则](#行为守则)
## 提问
我们不使用GitHub的论坛发表问题
对于任何非特定于项目本身的使用问题,
请直接在[Stack Overflow](https://stackoverflow.com)上询问。
通过此方法,你可以快速解决您的问题,
并且任何有相同问题的人可以找到答案。
这也使维护人员能够专注于为其他人改进项目。
## 报告安全问题
Alamofire Software Foundation 认真对待安全问题。
如果您发现任何关于安全的问题,请立即通知我们!
请**不要**公然公开发布问题,
而是将您的问题私下发送到<security@alamofire.org>
这将有于帮助确保发现的任何漏洞
可以[披露制度](http://en.wikipedia.org/wiki/Responsible_disclosure)
对任何受影响的各方
## 报告其他问题
为此项目贡献的方法
是当遇到问题时,请发送一篇详细的错误报告。
我们会感谢您写出的一份精心编写的详尽错误报告。
在提交问题之前,请检查项目里的问题数据库是否已存在此问题。
如果您找到匹配项,请添加“+1”或“我也遇到此问题”。
这样做有助于确定最常见问题和请求的优先级。
报告问题时,请包含以下内容:
* 您正在使用的Xcode版本
* 您的iOS或OS X版本
* 任何堆栈轨迹或编译器错误的完整输出
* 如果代码段可再现所描述的行为
* 任何其他有助于理解问题的细节
此信息有助于我们更快地查看和修复您的问题。
## 提交拉取请求
大力鼓励和欢迎拉取请求。在提交拉取请求时,请创建适当的测试用例,说明修复的问题或新功能。
## 开发人员原产地证书 1.1
为了项目做出贡献,我保证:
- (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
- (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
- (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
- (d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
## 行为守则
该项目采取贡献者公约为准则。
这项目的成果将会被我们的行为或行动影响。
我们期望每个为此项目做出贡献的人都会对此表示敬意。
详情请阅读 [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md)。
----
*上述陈述的一些想法和措辞是基于 [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) 和 [Linux](http://elinux.org/Developer_Certificate_Of_Origin) 社区.
我们表彰和感激他们为促进项目合作所做的付出。*

View File

@ -9,24 +9,11 @@
/* Begin PBXBuildFile section */
291BFDC61BB9E85500FFB029 /* watchOS Example Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 291BFDC51BB9E85500FFB029 /* watchOS Example Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
291BFDD51BB9E85500FFB029 /* watchOS Example.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 291BFDB91BB9E85400FFB029 /* watchOS Example.app */; };
291BFDDD1BB9E86000FFB029 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */; };
291BFDDE1BB9E86000FFB029 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */; };
291BFDDF1BB9E86000FFB029 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */; };
291BFDE01BB9E86000FFB029 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */; };
291BFDE11BB9E86000FFB029 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */; };
291BFDE21BB9E86400FFB029 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */; };
291BFDEE1BB9E8C700FFB029 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 291BFDED1BB9E8C700FFB029 /* main.m */; };
291BFDF31BB9E8C700FFB029 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 291BFDF21BB9E8C700FFB029 /* Assets.xcassets */; };
291BFDFB1BB9E8DC00FFB029 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1A91BB9DD9400A4466C /* AppDelegate.m */; };
291BFDFD1BB9E8E500FFB029 /* Post.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19A1BB9DD7300A4466C /* Post.m */; };
291BFDFE1BB9E8E900FFB029 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19C1BB9DD7300A4466C /* User.m */; };
291BFDFF1BB9E8EC00FFB029 /* AFAppDotNetAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */; };
291BFE011BB9EA5800FFB029 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */; };
291BFE021BB9EA5800FFB029 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */; };
291BFE031BB9EA5800FFB029 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */; };
291BFE041BB9EA5800FFB029 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */; };
291BFE051BB9EA5800FFB029 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */; };
291BFE061BB9EA5800FFB029 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */; };
291BFE0D1BB9EB3400FFB029 /* GlobalTimelineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 291BFE091BB9EB3400FFB029 /* GlobalTimelineViewController.m */; };
291BFE0E1BB9EB3400FFB029 /* PostTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 291BFE0C1BB9EB3400FFB029 /* PostTableViewCell.m */; };
291BFE101BB9EC4900FFB029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 291BFE0F1BB9EC4900FFB029 /* MainMenu.xib */; };
@ -34,67 +21,28 @@
291BFE1A1BB9ECEE00FFB029 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291BFE191BB9ECEE00FFB029 /* ViewController.swift */; };
291BFE1D1BB9ECEE00FFB029 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 291BFE1B1BB9ECEE00FFB029 /* Main.storyboard */; };
291BFE1F1BB9ECEE00FFB029 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 291BFE1E1BB9ECEE00FFB029 /* Assets.xcassets */; };
291BFE251BB9ED4F00FFB029 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */; };
291BFE261BB9ED4F00FFB029 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */; };
291BFE271BB9ED4F00FFB029 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */; };
291BFE281BB9ED4F00FFB029 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */; };
291BFE291BB9ED4F00FFB029 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */; };
291BFE2A1BB9ED4F00FFB029 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */; };
291BFE2B1BB9ED4F00FFB029 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */; };
291BFE2C1BB9ED4F00FFB029 /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */; };
291BFE2D1BB9ED4F00FFB029 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C21BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m */; };
291BFE2E1BB9ED4F00FFB029 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C41BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m */; };
291BFE301BB9ED4F00FFB029 /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C81BB9DE1100A4466C /* UIButton+AFNetworking.m */; };
291BFE311BB9ED4F00FFB029 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CB1BB9DE1100A4466C /* UIImageView+AFNetworking.m */; };
291BFE321BB9ED4F00FFB029 /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m */; };
291BFE331BB9ED4F00FFB029 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1D01BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m */; };
291BFE351BB9ED7F00FFB029 /* Gravatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291BFE341BB9ED7F00FFB029 /* Gravatar.swift */; };
291BFE371BB9EDD700FFB029 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 291BFE361BB9EDD700FFB029 /* UIKit.framework */; };
291BFE3A1BBAD2FF00FFB029 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 291BFE391BBAD2FF00FFB029 /* UIWebView+AFNetworking.m */; };
291BFE611BBB396800FFB029 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */; };
291BFE621BBB396B00FFB029 /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */; };
293206F41BD14AB50019EB9E /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 293206F31BD14AB50019EB9E /* AFNetworking.framework */; };
293206F51BD14AF50019EB9E /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 293206F31BD14AB50019EB9E /* AFNetworking.framework */; };
293206F61BD14B480019EB9E /* AFAppDotNetAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */; };
293206F71BD14B5C0019EB9E /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 293206F31BD14AB50019EB9E /* AFNetworking.framework */; };
29A3A1891BD14B8B00BB357F /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 293206F31BD14AB50019EB9E /* AFNetworking.framework */; };
29A3A18A1BD14BAA00BB357F /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 293206F31BD14AB50019EB9E /* AFNetworking.framework */; };
29E6F17A1BB9DCB500A4466C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1791BB9DCB500A4466C /* main.m */; };
29E6F1A41BB9DD7300A4466C /* Post.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19A1BB9DD7300A4466C /* Post.m */; };
29E6F1A51BB9DD7300A4466C /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19C1BB9DD7300A4466C /* User.m */; };
29E6F1A61BB9DD7300A4466C /* AFAppDotNetAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */; };
29E6F1AA1BB9DD9400A4466C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1A91BB9DD9400A4466C /* AppDelegate.m */; };
29E6F1AC1BB9DDB600A4466C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */; };
29E6F1D11BB9DE1100A4466C /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */; };
29E6F1D21BB9DE1100A4466C /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */; };
29E6F1D31BB9DE1100A4466C /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */; };
29E6F1D41BB9DE1100A4466C /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */; };
29E6F1D51BB9DE1100A4466C /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */; };
29E6F1D61BB9DE1100A4466C /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */; };
29E6F1D71BB9DE1100A4466C /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */; };
29E6F1D81BB9DE1100A4466C /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */; };
29E6F1D91BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C21BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m */; };
29E6F1DA1BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C41BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m */; };
29E6F1DC1BB9DE1100A4466C /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C81BB9DE1100A4466C /* UIButton+AFNetworking.m */; };
29E6F1DD1BB9DE1100A4466C /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CB1BB9DE1100A4466C /* UIImageView+AFNetworking.m */; };
29E6F1DE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m */; };
29E6F1DF1BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1D01BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m */; };
29E6F1E11BB9E03600A4466C /* Launchscreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 29E6F1E01BB9E03600A4466C /* Launchscreen.storyboard */; };
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 */; };
29E6F1FB1BB9E56800A4466C /* AFAppDotNetAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */; };
29E6F1FC1BB9E59400A4466C /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */; };
29E6F1FD1BB9E59400A4466C /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */; };
29E6F1FE1BB9E59400A4466C /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */; };
29E6F1FF1BB9E59400A4466C /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */; };
29E6F2001BB9E59400A4466C /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */; };
29E6F2011BB9E59400A4466C /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */; };
29E6F2021BB9E59400A4466C /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */; };
29E6F2031BB9E59400A4466C /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */; };
29E6F2041BB9E59400A4466C /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C21BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m */; };
29E6F2051BB9E59400A4466C /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C41BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m */; };
29E6F2071BB9E59400A4466C /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1C81BB9DE1100A4466C /* UIButton+AFNetworking.m */; };
29E6F2081BB9E59400A4466C /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CB1BB9DE1100A4466C /* UIImageView+AFNetworking.m */; };
29E6F2091BB9E59400A4466C /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1CE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m */; };
29E6F20A1BB9E59400A4466C /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E6F1D01BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m */; };
C2BFE0251C11870800BB258D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2BFE0241C11870800BB258D /* AppDelegate.m */; };
C2BFE0281C11872D00BB258D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2BFE0271C11872D00BB258D /* AppDelegate.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -139,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;
@ -160,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 = "<group>"; };
291BFDF21BB9E8C700FFB029 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
291BFDF71BB9E8C700FFB029 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -178,8 +126,7 @@
291BFE241BB9ED1500FFB029 /* AFNetworking tvOS Example-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFNetworking tvOS Example-Bridging-Header.h"; sourceTree = "<group>"; };
291BFE341BB9ED7F00FFB029 /* Gravatar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Gravatar.swift; sourceTree = "<group>"; };
291BFE361BB9EDD700FFB029 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
291BFE381BBAD2FF00FFB029 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+AFNetworking.h"; sourceTree = "<group>"; };
291BFE391BBAD2FF00FFB029 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = "<group>"; };
293206F31BD14AB50019EB9E /* AFNetworking.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AFNetworking.framework; path = "../../../Library/Developer/Xcode/DerivedData/AFNetworking-hbehydqutbohligoayuglkztxayp/Build/Products/Debug-iphoneos/AFNetworking.framework"; sourceTree = "<group>"; };
29E6F1751BB9DCB500A4466C /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
29E6F1791BB9DCB500A4466C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../main.m; sourceTree = "<group>"; };
29E6F1991BB9DD7300A4466C /* Post.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Post.h; sourceTree = "<group>"; };
@ -188,42 +135,9 @@
29E6F19C1BB9DD7300A4466C /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
29E6F19E1BB9DD7300A4466C /* AFAppDotNetAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFAppDotNetAPIClient.h; sourceTree = "<group>"; };
29E6F19F1BB9DD7300A4466C /* AFAppDotNetAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAppDotNetAPIClient.m; sourceTree = "<group>"; };
29E6F1A81BB9DD9400A4466C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
29E6F1A91BB9DD9400A4466C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29E6F1AF1BB9DE1100A4466C /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPSessionManager.h; sourceTree = "<group>"; };
29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPSessionManager.m; sourceTree = "<group>"; };
29E6F1B11BB9DE1100A4466C /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = "<group>"; };
29E6F1B21BB9DE1100A4466C /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkReachabilityManager.h; sourceTree = "<group>"; };
29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkReachabilityManager.m; sourceTree = "<group>"; };
29E6F1B41BB9DE1100A4466C /* AFSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFSecurityPolicy.h; sourceTree = "<group>"; };
29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFSecurityPolicy.m; sourceTree = "<group>"; };
29E6F1B61BB9DE1100A4466C /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLRequestSerialization.h; sourceTree = "<group>"; };
29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLRequestSerialization.m; sourceTree = "<group>"; };
29E6F1B81BB9DE1100A4466C /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLResponseSerialization.h; sourceTree = "<group>"; };
29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLResponseSerialization.m; sourceTree = "<group>"; };
29E6F1BA1BB9DE1100A4466C /* AFURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLSessionManager.h; sourceTree = "<group>"; };
29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLSessionManager.m; sourceTree = "<group>"; };
29E6F1BD1BB9DE1100A4466C /* AFAutoPurgingImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFAutoPurgingImageCache.h; sourceTree = "<group>"; };
29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAutoPurgingImageCache.m; sourceTree = "<group>"; };
29E6F1BF1BB9DE1100A4466C /* AFImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFImageDownloader.h; sourceTree = "<group>"; };
29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageDownloader.m; sourceTree = "<group>"; };
29E6F1C11BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkActivityIndicatorManager.h; sourceTree = "<group>"; };
29E6F1C21BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkActivityIndicatorManager.m; sourceTree = "<group>"; };
29E6F1C31BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActivityIndicatorView+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1C41BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActivityIndicatorView+AFNetworking.m"; sourceTree = "<group>"; };
29E6F1C71BB9DE1100A4466C /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1C81BB9DE1100A4466C /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+AFNetworking.m"; sourceTree = "<group>"; };
29E6F1C91BB9DE1100A4466C /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1CA1BB9DE1100A4466C /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1CB1BB9DE1100A4466C /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+AFNetworking.m"; sourceTree = "<group>"; };
29E6F1CC1BB9DE1100A4466C /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIKit+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1CD1BB9DE1100A4466C /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIProgressView+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1CE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIProgressView+AFNetworking.m"; sourceTree = "<group>"; };
29E6F1CF1BB9DE1100A4466C /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIRefreshControl+AFNetworking.h"; sourceTree = "<group>"; };
29E6F1D01BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+AFNetworking.m"; sourceTree = "<group>"; };
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 = "<group>"; };
29E6F1EC1BB9E37200A4466C /* TodayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TodayViewController.m; sourceTree = "<group>"; };
@ -239,6 +153,10 @@
29E6F2231BB9E76A00A4466C /* ExtensionDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExtensionDelegate.m; sourceTree = "<group>"; };
29E6F2251BB9E76A00A4466C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
29E6F2271BB9E76B00A4466C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C2BFE0231C11870800BB258D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
C2BFE0241C11870800BB258D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
C2BFE0261C11872D00BB258D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
C2BFE0271C11872D00BB258D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -246,6 +164,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
293206F71BD14B5C0019EB9E /* AFNetworking.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -253,6 +172,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
29A3A1891BD14B8B00BB357F /* AFNetworking.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -260,6 +180,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
29A3A18A1BD14BAA00BB357F /* AFNetworking.framework in Frameworks */,
291BFE371BB9EDD700FFB029 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -268,6 +189,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
293206F41BD14AB50019EB9E /* AFNetworking.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -276,21 +198,24 @@
buildActionMask = 2147483647;
files = (
29E6F1E91BB9E37200A4466C /* NotificationCenter.framework in Frameworks */,
293206F51BD14AF50019EB9E /* AFNetworking.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
291BFDE81BB9E8C700FFB029 /* OS X Example */ = {
291BFDE81BB9E8C700FFB029 /* macOS Example */ = {
isa = PBXGroup;
children = (
C2BFE0231C11870800BB258D /* AppDelegate.h */,
C2BFE0241C11870800BB258D /* AppDelegate.m */,
291BFE0F1BB9EC4900FFB029 /* MainMenu.xib */,
291BFDF21BB9E8C700FFB029 /* Assets.xcassets */,
291BFDF71BB9E8C700FFB029 /* Info.plist */,
291BFDEC1BB9E8C700FFB029 /* Supporting Files */,
);
path = "OS X Example";
path = "macOS Example";
sourceTree = "<group>";
};
291BFDEC1BB9E8C700FFB029 /* Supporting Files */ = {
@ -336,28 +261,30 @@
29E6F16A1BB9DA2E00A4466C = {
isa = PBXGroup;
children = (
29E6F1AD1BB9DDFA00A4466C /* Vendor */,
29E6F1AB1BB9DDB600A4466C /* Assets.xcassets */,
29E6F1941BB9DD7300A4466C /* Classes */,
29E6F1771BB9DCB500A4466C /* iOS Example */,
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 */,
);
indentWidth = 4;
sourceTree = "<group>";
tabWidth = 4;
usesTabs = 0;
};
29E6F1761BB9DCB500A4466C /* Products */ = {
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;
@ -366,6 +293,8 @@
29E6F1771BB9DCB500A4466C /* iOS Example */ = {
isa = PBXGroup;
children = (
C2BFE0261C11872D00BB258D /* AppDelegate.h */,
C2BFE0271C11872D00BB258D /* AppDelegate.m */,
291BFE071BB9EB3400FFB029 /* Controllers */,
291BFE0A1BB9EB3400FFB029 /* Views */,
29E6F1781BB9DCB500A4466C /* Supporting Files */,
@ -386,8 +315,6 @@
29E6F1941BB9DD7300A4466C /* Classes */ = {
isa = PBXGroup;
children = (
29E6F1A81BB9DD9400A4466C /* AppDelegate.h */,
29E6F1A91BB9DD9400A4466C /* AppDelegate.m */,
29E6F1981BB9DD7300A4466C /* Models */,
29E6F19D1BB9DD7300A4466C /* Networking Extensions */,
);
@ -414,67 +341,10 @@
path = "Networking Extensions";
sourceTree = "<group>";
};
29E6F1AD1BB9DDFA00A4466C /* Vendor */ = {
isa = PBXGroup;
children = (
29E6F1AE1BB9DE1100A4466C /* AFNetworking */,
29E6F1BC1BB9DE1100A4466C /* UIKit+AFNetworking */,
);
name = Vendor;
sourceTree = "<group>";
};
29E6F1AE1BB9DE1100A4466C /* AFNetworking */ = {
isa = PBXGroup;
children = (
29E6F1AF1BB9DE1100A4466C /* AFHTTPSessionManager.h */,
29E6F1B01BB9DE1100A4466C /* AFHTTPSessionManager.m */,
29E6F1B11BB9DE1100A4466C /* AFNetworking.h */,
29E6F1B21BB9DE1100A4466C /* AFNetworkReachabilityManager.h */,
29E6F1B31BB9DE1100A4466C /* AFNetworkReachabilityManager.m */,
29E6F1B41BB9DE1100A4466C /* AFSecurityPolicy.h */,
29E6F1B51BB9DE1100A4466C /* AFSecurityPolicy.m */,
29E6F1B61BB9DE1100A4466C /* AFURLRequestSerialization.h */,
29E6F1B71BB9DE1100A4466C /* AFURLRequestSerialization.m */,
29E6F1B81BB9DE1100A4466C /* AFURLResponseSerialization.h */,
29E6F1B91BB9DE1100A4466C /* AFURLResponseSerialization.m */,
29E6F1BA1BB9DE1100A4466C /* AFURLSessionManager.h */,
29E6F1BB1BB9DE1100A4466C /* AFURLSessionManager.m */,
);
name = AFNetworking;
path = ../AFNetworking;
sourceTree = "<group>";
};
29E6F1BC1BB9DE1100A4466C /* UIKit+AFNetworking */ = {
isa = PBXGroup;
children = (
29E6F1BD1BB9DE1100A4466C /* AFAutoPurgingImageCache.h */,
29E6F1BE1BB9DE1100A4466C /* AFAutoPurgingImageCache.m */,
29E6F1BF1BB9DE1100A4466C /* AFImageDownloader.h */,
29E6F1C01BB9DE1100A4466C /* AFImageDownloader.m */,
29E6F1C11BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.h */,
29E6F1C21BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m */,
29E6F1C31BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.h */,
29E6F1C41BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m */,
29E6F1C71BB9DE1100A4466C /* UIButton+AFNetworking.h */,
29E6F1C81BB9DE1100A4466C /* UIButton+AFNetworking.m */,
29E6F1C91BB9DE1100A4466C /* UIImage+AFNetworking.h */,
29E6F1CA1BB9DE1100A4466C /* UIImageView+AFNetworking.h */,
29E6F1CB1BB9DE1100A4466C /* UIImageView+AFNetworking.m */,
29E6F1CC1BB9DE1100A4466C /* UIKit+AFNetworking.h */,
29E6F1CD1BB9DE1100A4466C /* UIProgressView+AFNetworking.h */,
29E6F1CE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m */,
29E6F1CF1BB9DE1100A4466C /* UIRefreshControl+AFNetworking.h */,
29E6F1D01BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m */,
291BFE381BBAD2FF00FFB029 /* UIWebView+AFNetworking.h */,
291BFE391BBAD2FF00FFB029 /* UIWebView+AFNetworking.m */,
);
name = "UIKit+AFNetworking";
path = "../UIKit+AFNetworking";
sourceTree = "<group>";
};
29E6F1E71BB9E37200A4466C /* Frameworks */ = {
isa = PBXGroup;
children = (
293206F31BD14AB50019EB9E /* AFNetworking.framework */,
291BFE361BB9EDD700FFB029 /* UIKit.framework */,
29E6F1E81BB9E37200A4466C /* NotificationCenter.framework */,
);
@ -552,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 */,
@ -564,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 */ = {
@ -607,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 */,
@ -619,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 */
@ -630,7 +500,7 @@
29E6F16B1BB9DA2E00A4466C /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0930;
TargetAttributes = {
291BFDB81BB9E85400FFB029 = {
CreatedOnToolsVersion = 7.1;
@ -643,6 +513,7 @@
};
291BFE141BB9ECEE00FFB029 = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 0800;
};
29E6F1741BB9DCB500A4466C = {
CreatedOnToolsVersion = 7.1;
@ -657,6 +528,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
@ -666,10 +538,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 */,
);
};
@ -732,14 +604,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
291BFDDE1BB9E86000FFB029 /* AFSecurityPolicy.m in Sources */,
291BFDDD1BB9E86000FFB029 /* AFHTTPSessionManager.m in Sources */,
291BFDDF1BB9E86000FFB029 /* AFURLRequestSerialization.m in Sources */,
291BFDE11BB9E86000FFB029 /* AFURLSessionManager.m in Sources */,
291BFDE01BB9E86000FFB029 /* AFURLResponseSerialization.m in Sources */,
291BFE611BBB396800FFB029 /* AFAutoPurgingImageCache.m in Sources */,
291BFDE21BB9E86400FFB029 /* AFNetworkReachabilityManager.m in Sources */,
291BFE621BBB396B00FFB029 /* AFImageDownloader.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -748,16 +612,10 @@
buildActionMask = 2147483647;
files = (
291BFDFF1BB9E8EC00FFB029 /* AFAppDotNetAPIClient.m in Sources */,
291BFE021BB9EA5800FFB029 /* AFNetworkReachabilityManager.m in Sources */,
291BFDFB1BB9E8DC00FFB029 /* AppDelegate.m in Sources */,
C2BFE0251C11870800BB258D /* AppDelegate.m in Sources */,
291BFDFE1BB9E8E900FFB029 /* User.m in Sources */,
291BFDFD1BB9E8E500FFB029 /* Post.m in Sources */,
291BFE031BB9EA5800FFB029 /* AFSecurityPolicy.m in Sources */,
291BFE041BB9EA5800FFB029 /* AFURLRequestSerialization.m in Sources */,
291BFDEE1BB9E8C700FFB029 /* main.m in Sources */,
291BFE051BB9EA5800FFB029 /* AFURLResponseSerialization.m in Sources */,
291BFE061BB9EA5800FFB029 /* AFURLSessionManager.m in Sources */,
291BFE011BB9EA5800FFB029 /* AFHTTPSessionManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -765,21 +623,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
291BFE321BB9ED4F00FFB029 /* UIProgressView+AFNetworking.m in Sources */,
291BFE251BB9ED4F00FFB029 /* AFHTTPSessionManager.m in Sources */,
291BFE311BB9ED4F00FFB029 /* UIImageView+AFNetworking.m in Sources */,
291BFE2A1BB9ED4F00FFB029 /* AFURLSessionManager.m in Sources */,
291BFE301BB9ED4F00FFB029 /* UIButton+AFNetworking.m in Sources */,
291BFE271BB9ED4F00FFB029 /* AFSecurityPolicy.m in Sources */,
291BFE331BB9ED4F00FFB029 /* UIRefreshControl+AFNetworking.m in Sources */,
291BFE1A1BB9ECEE00FFB029 /* ViewController.swift in Sources */,
291BFE2D1BB9ED4F00FFB029 /* AFNetworkActivityIndicatorManager.m in Sources */,
291BFE281BB9ED4F00FFB029 /* AFURLRequestSerialization.m in Sources */,
291BFE2E1BB9ED4F00FFB029 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
291BFE261BB9ED4F00FFB029 /* AFNetworkReachabilityManager.m in Sources */,
291BFE2B1BB9ED4F00FFB029 /* AFAutoPurgingImageCache.m in Sources */,
291BFE2C1BB9ED4F00FFB029 /* AFImageDownloader.m in Sources */,
291BFE291BB9ED4F00FFB029 /* AFURLResponseSerialization.m in Sources */,
291BFE181BB9ECEE00FFB029 /* AppDelegate.swift in Sources */,
291BFE351BB9ED7F00FFB029 /* Gravatar.swift in Sources */,
);
@ -789,28 +633,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
29E6F1DF1BB9DE1100A4466C /* UIRefreshControl+AFNetworking.m in Sources */,
29E6F1D71BB9DE1100A4466C /* AFAutoPurgingImageCache.m in Sources */,
29E6F1A41BB9DD7300A4466C /* Post.m in Sources */,
29E6F1DE1BB9DE1100A4466C /* UIProgressView+AFNetworking.m in Sources */,
291BFE0D1BB9EB3400FFB029 /* GlobalTimelineViewController.m in Sources */,
29E6F1D21BB9DE1100A4466C /* AFNetworkReachabilityManager.m in Sources */,
29E6F1D61BB9DE1100A4466C /* AFURLSessionManager.m in Sources */,
29E6F1DC1BB9DE1100A4466C /* UIButton+AFNetworking.m in Sources */,
291BFE0E1BB9EB3400FFB029 /* PostTableViewCell.m in Sources */,
29E6F1D41BB9DE1100A4466C /* AFURLRequestSerialization.m in Sources */,
29E6F1DA1BB9DE1100A4466C /* UIActivityIndicatorView+AFNetworking.m in Sources */,
29E6F1A51BB9DD7300A4466C /* User.m in Sources */,
29E6F1D91BB9DE1100A4466C /* AFNetworkActivityIndicatorManager.m in Sources */,
29E6F1D81BB9DE1100A4466C /* AFImageDownloader.m in Sources */,
29E6F1D51BB9DE1100A4466C /* AFURLResponseSerialization.m in Sources */,
291BFE3A1BBAD2FF00FFB029 /* UIWebView+AFNetworking.m in Sources */,
29E6F1D11BB9DE1100A4466C /* AFHTTPSessionManager.m in Sources */,
29E6F1AA1BB9DD9400A4466C /* AppDelegate.m in Sources */,
29E6F17A1BB9DCB500A4466C /* main.m in Sources */,
29E6F1A61BB9DD7300A4466C /* AFAppDotNetAPIClient.m in Sources */,
29E6F1D31BB9DE1100A4466C /* AFSecurityPolicy.m in Sources */,
29E6F1DD1BB9DE1100A4466C /* UIImageView+AFNetworking.m in Sources */,
C2BFE0281C11872D00BB258D /* AppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -818,24 +647,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
29E6F1FE1BB9E59400A4466C /* AFSecurityPolicy.m in Sources */,
29E6F2081BB9E59400A4466C /* UIImageView+AFNetworking.m in Sources */,
29E6F2001BB9E59400A4466C /* AFURLResponseSerialization.m in Sources */,
29E6F1FB1BB9E56800A4466C /* AFAppDotNetAPIClient.m in Sources */,
29E6F2091BB9E59400A4466C /* UIProgressView+AFNetworking.m in Sources */,
293206F61BD14B480019EB9E /* AFAppDotNetAPIClient.m in Sources */,
29E6F1ED1BB9E37200A4466C /* TodayViewController.m in Sources */,
29E6F1FC1BB9E59400A4466C /* AFHTTPSessionManager.m in Sources */,
29E6F2011BB9E59400A4466C /* AFURLSessionManager.m in Sources */,
29E6F2071BB9E59400A4466C /* UIButton+AFNetworking.m in Sources */,
29E6F2051BB9E59400A4466C /* UIActivityIndicatorView+AFNetworking.m in Sources */,
29E6F1F91BB9E56200A4466C /* Post.m in Sources */,
29E6F20A1BB9E59400A4466C /* UIRefreshControl+AFNetworking.m in Sources */,
29E6F1FD1BB9E59400A4466C /* AFNetworkReachabilityManager.m in Sources */,
29E6F1FA1BB9E56500A4466C /* User.m in Sources */,
29E6F2041BB9E59400A4466C /* AFNetworkActivityIndicatorManager.m in Sources */,
29E6F1FF1BB9E59400A4466C /* AFURLRequestSerialization.m in Sources */,
29E6F2021BB9E59400A4466C /* AFAutoPurgingImageCache.m in Sources */,
29E6F2031BB9E59400A4466C /* AFImageDownloader.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -854,7 +669,7 @@
};
29E6F1F31BB9E37200A4466C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 29E6F1E51BB9E37200A4466C /* Today Extension Example */;
target = 29E6F1E51BB9E37200A4466C /* iOS Today Extension Example */;
targetProxy = 29E6F1F21BB9E37200A4466C /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@ -895,6 +710,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;
@ -943,6 +759,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;
@ -986,6 +803,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;
@ -1035,6 +853,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;
@ -1078,6 +897,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;
@ -1107,12 +927,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "OS X Example/Info.plist";
INFOPLIST_FILE = "macOS Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example";
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
@ -1127,6 +947,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;
@ -1150,11 +971,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "OS X Example/Info.plist";
INFOPLIST_FILE = "macOS Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.OS-X-Example";
PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
@ -1170,6 +991,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;
@ -1206,6 +1028,7 @@
SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@ -1221,6 +1044,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;
@ -1249,6 +1073,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/tvOS Example/AFNetworking tvOS Example-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
@ -1258,12 +1083,66 @@
29E6F16F1BB9DA2E00A4466C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
29E6F1701BB9DA2E00A4466C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
name = Release;
};
@ -1276,6 +1155,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;
@ -1324,6 +1204,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;
@ -1365,6 +1246,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;
@ -1413,6 +1295,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;
@ -1468,7 +1351,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 */,
@ -1504,7 +1387,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 */,

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -42,6 +42,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
BuildableName = "AFNetworking iOS Tests.xctest"
BlueprintName = "AFNetworking iOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@ -30,8 +30,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "29E6F1E51BB9E37200A4466C"
BuildableName = "Today Extension Example.appex"
BlueprintName = "Today Extension Example"
BuildableName = "iOS Today Extension Example.appex"
BlueprintName = "iOS Today Extension Example"
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -57,6 +57,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
BuildableName = "AFNetworking iOS Tests.xctest"
BlueprintName = "AFNetworking iOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -15,8 +15,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
BuildableName = "AFNetworking Mac OS X Tests.xctest"
BlueprintName = "AFNetworking Mac OS X Tests"
BuildableName = "AFNetworking macOS Tests.xctest"
BlueprintName = "AFNetworking macOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -29,8 +29,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
BuildableName = "OS X Example.app"
BlueprintName = "OS X Example"
BuildableName = "macOS Example.app"
BlueprintName = "macOS Example"
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -42,13 +42,23 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
BuildableName = "AFNetworking macOS Tests.xctest"
BlueprintName = "AFNetworking macOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
BuildableName = "OS X Example.app"
BlueprintName = "OS X Example"
BuildableName = "macOS Example.app"
BlueprintName = "macOS Example"
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
</BuildableReference>
</MacroExpansion>
@ -70,8 +80,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
BuildableName = "OS X Example.app"
BlueprintName = "OS X Example"
BuildableName = "macOS Example.app"
BlueprintName = "macOS Example"
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
@ -89,8 +99,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "291BFDE61BB9E8C700FFB029"
BuildableName = "OS X Example.app"
BlueprintName = "OS X Example"
BuildableName = "macOS Example.app"
BlueprintName = "macOS Example"
ReferencedContainer = "container:AFNetworking Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C3A1BC2C79500FD3B3E"
BuildableName = "AFNetworking iOS Tests.xctest"
BlueprintName = "AFNetworking iOS Tests"
BlueprintIdentifier = "2987B0AD1BC408A200179A4C"
BuildableName = "AFNetworking tvOS Tests.xctest"
BlueprintName = "AFNetworking tvOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@ -42,6 +42,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2987B0AD1BC408A200179A4C"
BuildableName = "AFNetworking tvOS Tests.xctest"
BlueprintName = "AFNetworking tvOS Tests"
ReferencedContainer = "container:../AFNetworking.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -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;
};

View File

@ -2,79 +2,109 @@
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"scale" : "2x",
"filename" : "Icon-Small@2x.png"
"idiom" : "iphone",
"filename" : "Icon-Small@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x",
"filename" : "Icon-Small@3x.png"
"idiom" : "iphone",
"filename" : "Icon-Small@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x",
"filename" : "Icon-40@2x.png"
"idiom" : "iphone",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x",
"filename" : "Icon-40@3x.png"
"idiom" : "iphone",
"filename" : "Icon-40@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x",
"filename" : "Icon-60@2x.png"
},
{
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"scale" : "3x",
"filename" : "Icon-60@3x.png"
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"size" : "29x29",
"scale" : "1x",
"filename" : "Icon-Small.png"
"idiom" : "ipad",
"filename" : "Icon-Small.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x",
"filename" : "Icon-Small@2x.png"
"idiom" : "ipad",
"filename" : "Icon-Small@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x",
"filename" : "Icon-40.png"
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x",
"filename" : "Icon-40@2x.png"
"idiom" : "ipad",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x",
"filename" : "Icon-76.png"
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x",
"filename" : "Icon-76@2x.png"
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "makeappicon"
"author" : "xcode"
}
}

View File

@ -1,91 +0,0 @@
// AppDelegate.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AppDelegate.h"
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import "GlobalTimelineViewController.h"
#import "AFNetworkActivityIndicatorManager.h"
@implementation AppDelegate
- (BOOL)application:(__unused UIApplication *)application
didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions
{
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
@end
#else
#import "Post.h"
#import "User.h"
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];
[self.window makeKeyAndOrderFront:self];
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
if (error) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = NSLocalizedString(@"Error", nil);
alert.informativeText = error.localizedDescription;
[alert addButtonWithTitle:NSLocalizedString(@"OK", nil)];
[alert runModal];
}
self.postsArrayController.content = posts;
}];
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
[self.tableView reloadData];
}];
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)application
hasVisibleWindows:(BOOL)flag
{
[self.window makeKeyAndOrderFront:self];
return YES;
}
@end
#endif

View File

@ -1,6 +1,6 @@
// Post.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// Post.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -44,7 +44,7 @@
#pragma mark -
+ (NSURLSessionDataTask *)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block {
return [[AFAppDotNetAPIClient sharedClient] GET:@"stream/0/posts/stream/global" parameters:nil success:^(NSURLSessionDataTask * __unused task, id JSON) {
return [[AFAppDotNetAPIClient sharedClient] GET:@"stream/0/posts/stream/global" parameters: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) {

View File

@ -1,6 +1,6 @@
// User.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// User.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// AFAppDotNetAPIClient.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,7 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
@import AFNetworking;
@interface AFAppDotNetAPIClient : AFHTTPSessionManager

View File

@ -1,6 +1,6 @@
// AFAppDotNetAPIClient.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,6 @@
// TodayViewController.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
//
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,7 +1,6 @@
// TodayViewController.m
//
// Copyright (c) 2015 Brian Nickel
//
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -25,7 +24,7 @@
#import "TodayViewController.h"
#import "Post.h"
#import "User.h"
#import "UIImageView+AFNetworking.h"
@import AFNetworking;
@interface TodayViewController () <NCWidgetProviding>
@property (strong, nonatomic) IBOutlet UIImageView *imageView;
@ -51,7 +50,6 @@
- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler {
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
if (!error) {
self.post = posts.firstObject;
[self savePost:self.post];

View File

@ -1,6 +1,6 @@
// AppDelegate.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -20,25 +20,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Availability.h>
#import <UIKit/UIKit.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <UIKit/UIKit.h>
@interface AppDelegate : NSObject <UIApplicationDelegate>
@interface AppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) UINavigationController *navigationController;
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) UINavigationController *navigationController;
@end
#else
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (strong) IBOutlet NSWindow *window;
@property (strong) IBOutlet NSTableView *tableView;
@property (strong) IBOutlet NSArrayController *postsArrayController;
@end
#endif
@end

View File

@ -0,0 +1,49 @@
// AppDelegate.m
//
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AppDelegate.h"
@import AFNetworking;
#import "GlobalTimelineViewController.h"
@implementation AppDelegate
- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions
{
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
@end

View File

@ -1,6 +1,6 @@
// GlobalTimelineViewController.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// GlobalTimelineViewController.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -26,7 +26,7 @@
#import "PostTableViewCell.h"
#import "UIRefreshControl+AFNetworking.h"
@import AFNetworking;
@interface GlobalTimelineViewController ()
@property (readwrite, nonatomic, strong) NSArray *posts;

View File

@ -1,6 +1,6 @@
// TweetTableViewCell.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// TweetTableViewCell.m
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -25,11 +25,11 @@
#import "Post.h"
#import "User.h"
#import "UIImageView+AFNetworking.h"
@import AFNetworking;
@implementation PostTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

View File

@ -0,0 +1,31 @@
// AppDelegate.h
//
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (strong) IBOutlet NSWindow *window;
@property (strong) IBOutlet NSTableView *tableView;
@property (strong) IBOutlet NSArrayController *postsArrayController;
@end

View File

@ -0,0 +1,64 @@
// AppDelegate.m
//
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AppDelegate.h"
@import AFNetworking;
#import "Post.h"
#import "User.h"
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
[NSURLCache setSharedURLCache:URLCache];
[self.window makeKeyAndOrderFront:self];
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
if (error) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = NSLocalizedString(@"Error", nil);
alert.informativeText = error.localizedDescription;
[alert addButtonWithTitle:NSLocalizedString(@"OK", nil)];
[alert runModal];
}
self.postsArrayController.content = posts;
}];
__weak __typeof(self)weakSelf = self;
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.tableView reloadData];
}];
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)application
hasVisibleWindows:(BOOL)flag
{
[self.window makeKeyAndOrderFront:self];
return YES;
}
@end

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9052" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9052"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@ -13,10 +15,10 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="AFNetworking OS X Example" id="56">
<menu key="submenu" title="AFNetworking OS X Example" systemMenu="apple" id="57">
<menuItem title="AFNetworking macOS Example" id="56">
<menu key="submenu" title="AFNetworking macOS Example" systemMenu="apple" id="57">
<items>
<menuItem title="About AFNetworking OS X Example" id="58">
<menuItem title="About AFNetworking macOS Example" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
@ -31,7 +33,7 @@
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide AFNetworking OS X Example" keyEquivalent="h" id="134">
<menuItem title="Hide AFNetworking macOS Example" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
@ -50,7 +52,7 @@
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit AFNetworking OS X Example" keyEquivalent="q" id="136">
<menuItem title="Quit AFNetworking macOS Example" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-3" id="449"/>
</connections>
@ -148,7 +150,7 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="491">
<items>
<menuItem title="AFNetworking OS X Example Help" keyEquivalent="?" id="492">
<menuItem title="AFNetworking macOS Example Help" keyEquivalent="?" id="492">
<connections>
<action selector="showHelp:" target="-1" id="493"/>
</connections>
@ -158,11 +160,11 @@
</menuItem>
</items>
</menu>
<window title="AFNetworking OS X Example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="371">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" unifiedTitleAndToolbar="YES"/>
<window title="AFNetworking macOS Example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="371">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="60" y="295" width="331" height="500"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<value key="minSize" type="size" width="375" height="200"/>
<value key="maxSize" type="size" width="375" height="1280"/>
<view key="contentView" id="372">
@ -176,13 +178,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="85" rowSizeStyle="automatic" viewBased="YES" id="541">
<rect key="frame" x="0.0" y="0.0" width="331" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="331" height="498"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="10" height="10"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="321" minWidth="70" maxWidth="10000" id="542">
<tableColumn identifier="" width="321" minWidth="70" maxWidth="10000" id="542">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@ -261,7 +263,6 @@
</tableColumns>
</tableView>
</subviews>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="540">
<rect key="frame" x="1" y="484" width="373" height="15"/>

View File

@ -1,5 +1,5 @@
// main.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
// main.m
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -3,5 +3,4 @@
//
#import <CommonCrypto/CommonCrypto.h>
#import "AFNetworking.h"
#import "UIKit+AFNetworking.h"
@import AFNetworking;

View File

@ -1,5 +1,5 @@
// AppDelegate.swift
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -27,30 +27,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -12,6 +12,12 @@
"filename" : "App Icon - Small.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "Top Shelf Image Wide.imageset",
"role" : "top-shelf-image-wide"
},
{
"size" : "1920x720",
"idiom" : "tv",
@ -23,4 +29,4 @@
"version" : 1,
"author" : "xcode"
}
}
}

View File

@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -3,6 +3,10 @@
{
"idiom" : "tv",
"scale" : "1x"
},
{
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {

View File

@ -1,5 +1,12 @@
{
"images" : [
{
"orientation" : "landscape",
"idiom" : "tv",
"extent" : "full-screen",
"minimum-system-version" : "11.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "tv",

View File

@ -1,6 +1,6 @@
// Gravatar.swift
//
// Copyright (c) 2015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -25,11 +25,11 @@ import UIKit
private extension String {
var md5_hash: String {
let trimmedString = lowercaseString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())
let utf8String = trimmedString.cStringUsingEncoding(NSUTF8StringEncoding)!
let stringLength = CC_LONG(trimmedString.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))
let trimmedString = lowercased().trimmingCharacters(in: CharacterSet.whitespaces)
let utf8String = trimmedString.cString(using: String.Encoding.utf8)!
let stringLength = CC_LONG(trimmedString.lengthOfBytes(using: String.Encoding.utf8))
let digestLength = Int(CC_MD5_DIGEST_LENGTH)
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLength)
let result = UnsafeMutablePointer<CUnsignedChar>.allocate(capacity: digestLength)
CC_MD5(utf8String, stringLength, result)
@ -39,7 +39,7 @@ private extension String {
hash += String(format: "%02x", result[i])
}
result.dealloc(digestLength)
result.deallocate()
return String(format: hash)
}
@ -48,7 +48,7 @@ private extension String {
// MARK: - QueryItemConvertible
private protocol QueryItemConvertible {
var queryItem: NSURLQueryItem {get}
var queryItem: URLQueryItem {get}
}
// MARK: -
@ -63,8 +63,8 @@ public struct Gravatar {
case Retro = "retro"
case Blank = "blank"
var queryItem: NSURLQueryItem {
return NSURLQueryItem(name: "d", value: rawValue)
var queryItem: URLQueryItem {
return URLQueryItem(name: "d", value: rawValue)
}
}
@ -74,8 +74,8 @@ public struct Gravatar {
case R = "r"
case X = "x"
var queryItem: NSURLQueryItem {
return NSURLQueryItem(name: "r", value: rawValue)
var queryItem: URLQueryItem {
return URLQueryItem(name: "r", value: rawValue)
}
}
@ -84,7 +84,7 @@ public struct Gravatar {
public let defaultImage: DefaultImage
public let rating: Rating
private static let baseURL = NSURL(string: "https://secure.gravatar.com/avatar")!
fileprivate static let baseURL = Foundation.URL(string: "https://secure.gravatar.com/avatar")!
public init(
emailAddress: String,
@ -98,16 +98,16 @@ public struct Gravatar {
self.rating = rating
}
public func URL(size size: CGFloat, scale: CGFloat = UIScreen.mainScreen().scale) -> NSURL {
let URL = Gravatar.baseURL.URLByAppendingPathComponent(email.md5_hash)
let components = NSURLComponents(URL: URL, resolvingAgainstBaseURL: false)!
public func URL(size: CGFloat, scale: CGFloat = UIScreen.main.scale) -> Foundation.URL {
let URL = Gravatar.baseURL.appendingPathComponent(email.md5_hash)
var components = URLComponents(url: URL, resolvingAgainstBaseURL: false)!
var queryItems = [defaultImage.queryItem, rating.queryItem]
queryItems.append(NSURLQueryItem(name: "f", value: forceDefault ? "y" : "n"))
queryItems.append(NSURLQueryItem(name: "s", value: String(format: "%.0f",size * scale)))
queryItems.append(URLQueryItem(name: "f", value: forceDefault ? "y" : "n"))
queryItems.append(URLQueryItem(name: "s", value: String(format: "%.0f",size * scale)))
components.queryItems = queryItems
return components.URL!
return components.url!
}
}

View File

@ -1,5 +1,5 @@
// ViewController.swift
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -31,7 +31,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
for _ in 1...100 {
let gravatar = Gravatar(
emailAddress: NSUUID().UUIDString,
emailAddress: UUID().uuidString,
defaultImage: Gravatar.DefaultImage.Identicon,
forceDefault: true
)
@ -45,21 +45,21 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
// Dispose of any resources that can be recreated.
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return gravatars.count
}
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CollectionViewCell", forIndexPath: indexPath) as! CollectionViewCell
cell.update(forGravatar: gravatars[indexPath.item])
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionViewCell", for: indexPath) as! CollectionViewCell
cell.update(forGravatar: gravatars[(indexPath as NSIndexPath).item])
return cell
}
func collectionView(collectionView: UICollectionView, canFocusItemAtIndexPath indexPath: NSIndexPath) -> Bool {
func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool {
return true
}
@ -73,7 +73,7 @@ class CollectionViewCell : UICollectionViewCell {
}
func update(forGravatar gravatar:Gravatar) {
self.avatarView.setImageWithURL(gravatar.URL(size: self.bounds.size.width))
self.avatarView.setImageWith(gravatar.URL(size: self.bounds.size.width) as URL)
}
}

View File

@ -1,5 +1,5 @@
// ExtensionDelegate.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
// ExtensionDelegate.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
// InterfaceController.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
// InterfaceController.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View File

@ -1,5 +1,5 @@
// AFNetworking.h
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -38,6 +38,7 @@ FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
#import <AFNetworking/AFURLRequestSerialization.h>
#import <AFNetworking/AFURLResponseSerialization.h>
#import <AFNetworking/AFSecurityPolicy.h>
#import <AFNetworking/AFCompatibilityMacros.h>
#if !TARGET_OS_WATCH
#import <AFNetworking/AFNetworkReachabilityManager.h>
@ -63,4 +64,4 @@ FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
#endif
#endif /* _AFNETWORKING_ */
#endif /* _AFNETWORKING_ */

View File

@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0-beta.1</string>
<string>3.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>3.2.1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>

View File

@ -1,4 +1,4 @@
Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

125
README.md
View File

@ -3,8 +3,13 @@
</p>
[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking)
[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking)
[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking)
AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
AFNetworking is a delightful networking library for iOS, macOS, watchOS, and tvOS. It's built on top of the [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac.
@ -15,7 +20,7 @@ Choose AFNetworking for your next project, or migrate over your existing project
- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps
- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki)
- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking
- Read the [AFNetworking 2.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide) for an overview of the architectural changes from 1.0.
- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0.
## Communication
@ -25,27 +30,68 @@ Choose AFNetworking for your next project, or migrate over your existing project
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.
### Installation with CocoaPods
## Installation
AFNetworking supports multiple methods for installing the library in a project.
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking).
## Installation with CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command:
```bash
$ gem install cocoapods
```
> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+.
#### Podfile
To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
platform :ios, '7.0'
pod "AFNetworking", "~> 3.0"
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'TargetName' do
pod 'AFNetworking', '~> 3.0'
end
```
Then, run the following command:
```bash
$ pod install
```
### Installation with Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```
To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "AFNetworking/AFNetworking" ~> 3.0
```
Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project.
## Requirements
| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
| AFNetworking Version | Minimum iOS Target | Minimum macOS Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:|
| 3.x | iOS 7 | OS X 10.9 | 2.0 | 9.0 | Xcode 7 is required. `NSURLConnectionOperation` support has been removed. |
| [2.x](https://github.com/AFNetworking/AFNetworking/tree/2.x) | iOS 7 | OS X 10.8 | 2.0 | n/a | Xcode 5 is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. |
| [1.x](https://github.com/AFNetworking/AFNetworking/tree/1.x) | iOS 5 | Mac OS X 10.7 | n/a | n/a |
| [0.10.x](https://github.com/AFNetworking/AFNetworking/tree/0.10.x) | iOS 4 | Mac OS X 10.6 | n/a | n/a |
| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. |
| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. |
| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. |
| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a |
| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a |
(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
(macOS projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs.
@ -66,7 +112,7 @@ pod "AFNetworking", "~> 3.0"
- `AFHTTPResponseSerializer`
- `AFJSONResponseSerializer`
- `AFXMLParserResponseSerializer`
- `AFXMLDocumentResponseSerializer` _(Mac OS X)_
- `AFXMLDocumentResponseSerializer` _(macOS)_
- `AFPropertyListResponseSerializer`
- `AFImageResponseSerializer`
- `AFCompoundResponseSerializer`
@ -128,15 +174,25 @@ NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFo
} error:nil];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSProgress *progress = nil;
NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
} else {
NSLog(@"%@ %@", response, responseObject);
}
}];
NSURLSessionUploadTask *uploadTask;
uploadTask = [manager
uploadTaskWithStreamedRequest:request
progress:^(NSProgress * _Nonnull uploadProgress) {
// This is not called back on the main queue.
// You are responsible for dispatching to the main queue for UI updates
dispatch_async(dispatch_get_main_queue(), ^{
//Update the progress view
[progressView setProgress:uploadProgress.fractionCompleted];
});
}
completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
if (error) {
NSLog(@"Error: %@", error);
} else {
NSLog(@"%@ %@", response, responseObject);
}
}];
[uploadTask resume];
```
@ -147,7 +203,7 @@ NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:requ
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"];
NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/get"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
@ -182,7 +238,7 @@ NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
#### URL Form Parameter Encoding
```objective-c
[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters];
[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil];
```
POST http://example.com/
@ -193,7 +249,7 @@ NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
#### JSON Parameter Encoding
```objective-c
[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters];
[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil];
```
POST http://example.com/
@ -214,7 +270,7 @@ NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
* Network reachability is a useful tool for determining why a request might have failed.
* After a network request has failed, telling the user they're offline is better than giving them a more technical but accurate error, such as "request timed out."
See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/wwdc/2012/#706).
See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/play/wwdc2012-706/).
#### Shared Network Reachability
@ -237,7 +293,7 @@ Adding pinned SSL certificates to your app helps prevent man-in-the-middle attac
#### Allowing Invalid SSL Certificates
```objective-c
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production
```
@ -245,20 +301,7 @@ manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for pr
## Unit Tests
AFNetworking includes a suite of unit tests within the Tests subdirectory. In order to run the unit tests, you must install the testing dependencies via [CocoaPods](http://cocoapods.org/):
$ cd Tests
$ pod install
Once testing dependencies are installed, you can execute the test suite via the 'iOS Tests' and 'OS X Tests' schemes within Xcode.
### Running Tests from the Command Line
Tests can also be run from the command line or within a continuous integration environment. The [`xcpretty`](https://github.com/mneorr/xcpretty) utility needs to be installed before running the tests from the command line:
$ gem install xcpretty
Once `xcpretty` is installed, you can execute the suite via `rake test`.
AFNetworking includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test.
## Credits
@ -276,4 +319,4 @@ If you believe you have identified a security vulnerability with AFNetworking, y
## License
AFNetworking is released under the MIT license. See LICENSE for details.
AFNetworking is released under the MIT license. See [LICENSE](https://github.com/AFNetworking/AFNetworking/blob/master/LICENSE) for details.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
// AFAutoPurgingImageCacheTests.m
// Copyright (c) 20112015 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 20112016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -170,7 +170,7 @@
NSString *identifier = @"logo";
XCTAssertTrue(self.cache.memoryUsage == 0);
[self.cache addImage:self.testImage withIdentifier:identifier];
XCTAssertTrue(self.cache.memoryUsage == 13600);
XCTAssertTrue(self.cache.memoryUsage == 1020000);
}
- (void)testThatMemoryUsageDecreasesWhenRemovingImage {
@ -183,11 +183,11 @@
#pragma mark - Purging
- (void)testThatImagesArePurgedWhenCapcityIsReached {
UInt64 imageSize = 13600;
NSInteger numberOfImages = 10;
NSInteger numberOfImagesAfterPurge = 6;
UInt64 imageSize = 1020000;
UInt64 numberOfImages = 10;
UInt64 numberOfImagesAfterPurge = 6;
self.cache = [[AFAutoPurgingImageCache alloc] initWithMemoryCapacity:numberOfImages * imageSize preferredMemoryCapacity:numberOfImagesAfterPurge * imageSize];
NSInteger index = 1;
NSUInteger index = 1;
while (YES) {
NSString * identifier = [NSString stringWithFormat:@"image-%ld",(long)index];
[self.cache addImage:self.testImage withIdentifier:identifier];
@ -202,11 +202,11 @@
}
- (void)testThatPrioritizedImagesWithOldestLastAccessDatesAreRemovedDuringPurge {
UInt64 imageSize = 13600;
NSInteger numberOfImages = 10;
NSInteger numberOfImagesAfterPurge = 6;
UInt64 imageSize = 1020000;
UInt64 numberOfImages = 10;
UInt64 numberOfImagesAfterPurge = 6;
self.cache = [[AFAutoPurgingImageCache alloc] initWithMemoryCapacity:numberOfImages * imageSize preferredMemoryCapacity:numberOfImagesAfterPurge * imageSize];
for (NSInteger index = 0; index < numberOfImages; index ++) {
for (NSUInteger index = 0; index < numberOfImages; index ++) {
NSString * identifier = [NSString stringWithFormat:@"image-%ld",(long)index];
[self.cache addImage:self.testImage withIdentifier:identifier];
}
@ -219,7 +219,7 @@
UInt64 postPurgeMemoryUsage = self.cache.memoryUsage;
XCTAssertTrue(postPurgeMemoryUsage < prePurgeMemoryUsage);
for (NSInteger index = 0; index <= numberOfImages ; index++) {
for (NSUInteger index = 0; index <= numberOfImages; index++) {
NSString * identifier = [NSString stringWithFormat:@"image-%ld",(long)index];
UIImage *cachedImage = [self.cache imageWithIdentifier:identifier];
if (index == 0 || index >= 6) {
@ -230,4 +230,12 @@
}
}
#pragma mark - Should Cache Image
- (void)testThatShouldCacheIsYes {
NSURL *url = [NSURL URLWithString:@"http://test.com/image"];
NSString *identifier = @"filter";
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
BOOL result = [self.cache shouldCacheImage:self.testImage forRequest:request withAdditionalIdentifier:identifier];
XCTAssertTrue(result);
}
@end

Some files were not shown because too many files have changed in this diff Show More