Compare commits
501 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
555385d2b8 | ||
|
|
2da270be61 | ||
|
|
0fba527112 | ||
|
|
4743faa83c | ||
|
|
eb9ce0e23d | ||
|
|
5cf601ce0c | ||
|
|
006e896fbc | ||
|
|
9dcc6efd85 | ||
|
|
2c2d2c3062 | ||
|
|
7383ffc61f | ||
|
|
023cec7994 | ||
|
|
685e31a31b | ||
|
|
b3c4a78aca | ||
|
|
ee950948f2 | ||
|
|
9cc782931a | ||
|
|
3517a1d23c | ||
|
|
5890adc404 | ||
|
|
ba4238910e | ||
|
|
d6db8307d9 | ||
|
|
27608c91d0 | ||
|
|
1bd73c7fca | ||
|
|
59e92b18c6 | ||
|
|
fdbec013c4 | ||
|
|
99cda82d33 | ||
|
|
e46e64c274 | ||
|
|
390e8fa6d4 | ||
|
|
dea4316db0 | ||
|
|
23a6f442c8 | ||
|
|
9bb8ea7452 | ||
|
|
af23240a4b | ||
|
|
0579f71d5a | ||
|
|
864c8d6aed | ||
|
|
7b48feb383 | ||
|
|
3c54e1f8a5 | ||
|
|
a8758d26d5 | ||
|
|
64795368ae | ||
|
|
86c8cc2263 | ||
|
|
b892e566f9 | ||
|
|
12088d6d37 | ||
|
|
a24b4896bb | ||
|
|
a101152743 | ||
|
|
5b92ed3368 | ||
|
|
17edb8138a | ||
|
|
7ff008b872 | ||
|
|
619a65b57e | ||
|
|
91cc666887 | ||
|
|
926d4dbb8b | ||
|
|
5544ef03f4 | ||
|
|
ffbcabeb58 | ||
|
|
7642bcf659 | ||
|
|
9c2742c868 | ||
|
|
5fe5ea3355 | ||
|
|
d135b740da | ||
|
|
342653f27e | ||
|
|
06079adbe4 | ||
|
|
1c52c76537 | ||
|
|
1d1c0241a9 | ||
|
|
ca380fdcfc | ||
|
|
54f11357d7 | ||
|
|
6622b05771 | ||
|
|
63410f3567 | ||
|
|
d0448a80f4 | ||
|
|
c4caddc5e9 | ||
|
|
aed00d3099 | ||
|
|
fba4f366d2 | ||
|
|
ad7b31f4f9 | ||
|
|
009e3bb667 | ||
|
|
d768f1c7c5 | ||
|
|
684dfe05d8 | ||
|
|
41782ab4d6 | ||
|
|
850974c941 | ||
|
|
61e15f412b | ||
|
|
b15888735a | ||
|
|
48b63fa252 | ||
|
|
447d7f3c58 | ||
|
|
207a707fa3 | ||
|
|
357466d102 | ||
|
|
746f6c3a1e | ||
|
|
6897b06049 | ||
|
|
29021d2eeb | ||
|
|
eb0635cb1b | ||
|
|
e08306e789 | ||
|
|
899109bec8 | ||
|
|
e6c674ed84 | ||
|
|
fd98ef0d65 | ||
|
|
f0fe188b7e | ||
|
|
2927f79908 | ||
|
|
accf62f65a | ||
|
|
20bc43628e | ||
|
|
1f70ba85bb | ||
|
|
a2401da932 | ||
|
|
09f49eb90a | ||
|
|
4f4e4a96a9 | ||
|
|
33f69a6f23 | ||
|
|
49d3fe112e | ||
|
|
bc323baaa5 | ||
|
|
9e005d9714 | ||
|
|
68214ee292 | ||
|
|
abd34500ab | ||
|
|
b3f5f644a4 | ||
|
|
10afc7c4ac | ||
|
|
adc8004b2b | ||
|
|
2315d76280 | ||
|
|
03423c877f | ||
|
|
5d4b628906 | ||
|
|
7bc866d47a | ||
|
|
09394030e1 | ||
|
|
15f09aeb65 | ||
|
|
b013b458c5 | ||
|
|
1a5b4814ea | ||
|
|
6184295398 | ||
|
|
29e0573128 | ||
|
|
1dc9e87729 | ||
|
|
871dcf0da4 | ||
|
|
3a344e3d6f | ||
|
|
0de996f84b | ||
|
|
7ea8c74739 | ||
|
|
8232b54262 | ||
|
|
e976d63ed2 | ||
|
|
b32766772d | ||
|
|
00ae01d063 | ||
|
|
5521f5e0c5 | ||
|
|
78ce859962 | ||
|
|
2d19dc8540 | ||
|
|
f0b1149731 | ||
|
|
0b35a643c6 | ||
|
|
bcede21e8a | ||
|
|
944c3768a5 | ||
|
|
67dd69e632 | ||
|
|
5aaaa501fc | ||
|
|
bf9b920187 | ||
|
|
f07fe50814 | ||
|
|
3972e95c80 | ||
|
|
eae14bd8ce | ||
|
|
a5933f3f83 | ||
|
|
15116f93b1 | ||
|
|
b0d24a08db | ||
|
|
f7ecca5420 | ||
|
|
5e19a4df0b | ||
|
|
ded6a76946 | ||
|
|
4de115625a | ||
|
|
8ad70504fb | ||
|
|
9fbf003dd6 | ||
|
|
84e409d6ae | ||
|
|
fc941b3336 | ||
|
|
f6439cfa09 | ||
|
|
0c193a2c37 | ||
|
|
4b64a60d4b | ||
|
|
f45a3abf08 | ||
|
|
20ff51cb8e | ||
|
|
00addee8a1 | ||
|
|
1f2ffbb41b | ||
|
|
9d5a894cb0 | ||
|
|
3297dfe5f0 | ||
|
|
c976cf3db8 | ||
|
|
d8f45e79e5 | ||
|
|
1e03fb1a72 | ||
|
|
75763005cb | ||
|
|
849dff7dee | ||
|
|
9b33c1699f | ||
|
|
6554afe3c9 | ||
|
|
c69c109da8 | ||
|
|
a241b4fcdd | ||
|
|
6babb5f039 | ||
|
|
51a80847ed | ||
|
|
f6f64c83b3 | ||
|
|
8db67cdfa9 | ||
|
|
41897b19c6 | ||
|
|
dd59ffa188 | ||
|
|
27c819537a | ||
|
|
c18c09a75c | ||
|
|
e6d975619e | ||
|
|
158dc56d30 | ||
|
|
0840d05555 | ||
|
|
0ffb17d619 | ||
|
|
ec5c955059 | ||
|
|
f8159fee72 | ||
|
|
4f3c694920 | ||
|
|
33a403cb9c | ||
|
|
5b6def1f4e | ||
|
|
fb5022c073 | ||
|
|
025c82fa7b | ||
|
|
83c33fb9a7 | ||
|
|
111931b32c | ||
|
|
550d8c3dd2 | ||
|
|
9627d0fc20 | ||
|
|
5d6867c3b6 | ||
|
|
0e947a7ae6 | ||
|
|
9fea2240a8 | ||
|
|
719a3bf60b | ||
|
|
4429921ac1 | ||
|
|
b36f0ed444 | ||
|
|
84d18cac75 | ||
|
|
7118eb6bbf | ||
|
|
f39ec68b44 | ||
|
|
e8fde524d7 | ||
|
|
0fc675e960 | ||
|
|
f28654cb5c | ||
|
|
95fa90666d | ||
|
|
290ec35a4a | ||
|
|
748a410ba7 | ||
|
|
2d1fb6ba7a | ||
|
|
a26a500c1d | ||
|
|
2201d2cd55 | ||
|
|
df5b5121a4 | ||
|
|
0be9763246 | ||
|
|
e337471d80 | ||
|
|
51561a9236 | ||
|
|
a81d445a00 | ||
|
|
89b79c53a0 | ||
|
|
a8c148f9df | ||
|
|
dd674a3268 | ||
|
|
2163a8b750 | ||
|
|
d869571b82 | ||
|
|
4fb051898c | ||
|
|
cd5cd6e787 | ||
|
|
6aa6a3b7ed | ||
|
|
bcba777cfa | ||
|
|
f235558c69 | ||
|
|
51b17804ee | ||
|
|
137676251b | ||
|
|
712ac61a4f | ||
|
|
f51f0b8533 | ||
|
|
fdb2d14f0f | ||
|
|
ff228fad3a | ||
|
|
18a7973839 | ||
|
|
1e27113c8b | ||
|
|
9aa03d0f96 | ||
|
|
7dc973b89c | ||
|
|
023f3505c8 | ||
|
|
2a53b2c3f4 | ||
|
|
363a1fcc20 | ||
|
|
ac2af11551 | ||
|
|
f26bfb46c3 | ||
|
|
0e46d1ea89 | ||
|
|
fa8b02da94 | ||
|
|
27652fe03e | ||
|
|
59d5111895 | ||
|
|
e1e2d62ad8 | ||
|
|
3eec2c1f0f | ||
|
|
11c049a083 | ||
|
|
c0131a92a1 | ||
|
|
0cac3e4bfc | ||
|
|
711aeec616 | ||
|
|
b7073e4990 | ||
|
|
df039898bb | ||
|
|
60ad370c8f | ||
|
|
885e0a4b4e | ||
|
|
19e4aef45c | ||
|
|
4a7148db79 | ||
|
|
c52ff8510f | ||
|
|
16c09fae46 | ||
|
|
ba3bb8e5d7 | ||
|
|
88f13053b1 | ||
|
|
f169be43e1 | ||
|
|
6b53aaac2b | ||
|
|
280baf585f | ||
|
|
8a99f2d172 | ||
|
|
74720869a7 | ||
|
|
62ab0f9a2c | ||
|
|
439e67f560 | ||
|
|
3bd26dceca | ||
|
|
c297688068 | ||
|
|
ca22ad539d | ||
|
|
f3a7adf147 | ||
|
|
dfbe3edab4 | ||
|
|
2e790eb917 | ||
|
|
e0052338d6 | ||
|
|
723cf3237a | ||
|
|
77f6fe1c31 | ||
|
|
32cf30a245 | ||
|
|
5d1dc7c2ee | ||
|
|
9a70ba90a4 | ||
|
|
305c974b8b | ||
|
|
b737d74fe9 | ||
|
|
3e8addb653 | ||
|
|
aba212c842 | ||
|
|
502fe0f4a5 | ||
|
|
ac6ba4580e | ||
|
|
fa2c806a39 | ||
|
|
326ccb170d | ||
|
|
9e8ac96863 | ||
|
|
37a23f07bc | ||
|
|
c27b46c87d | ||
|
|
d86c4ce00b | ||
|
|
d0b1db20d8 | ||
|
|
333169d430 | ||
|
|
2ffdc3db85 | ||
|
|
5623891554 | ||
|
|
f674d572db | ||
|
|
62bef6835b | ||
|
|
5883c54943 | ||
|
|
aee9462179 | ||
|
|
fac9d87340 | ||
|
|
49e77f198b | ||
|
|
e457fc980d | ||
|
|
0ad81c37b8 | ||
|
|
a7127aca6a | ||
|
|
32547b02c9 | ||
|
|
cc7a00d6a8 | ||
|
|
f2597f7e60 | ||
|
|
124811e31e | ||
|
|
ed39be2a09 | ||
|
|
bfc67c9d6c | ||
|
|
3cde647ed7 | ||
|
|
c8e5ce2341 | ||
|
|
44977793c3 | ||
|
|
1b5d9bae38 | ||
|
|
913f2f9e8f | ||
|
|
7dc8ca21c5 | ||
|
|
c7f8d01cf5 | ||
|
|
0574a40df8 | ||
|
|
c0fb105bd2 | ||
|
|
8627ada34a | ||
|
|
b0d0e58c4c | ||
|
|
5bd9ad85ea | ||
|
|
3641532d85 | ||
|
|
aa9b5f59aa | ||
|
|
a745be4fcd | ||
|
|
056a1b69d6 | ||
|
|
3e0c986224 | ||
|
|
31560ea86e | ||
|
|
71fb444f44 | ||
|
|
412d903e62 | ||
|
|
d0e5aa0b0c | ||
|
|
5b5e0107d8 | ||
|
|
5d73b00640 | ||
|
|
c0e8cc0a82 | ||
|
|
9c7a3ab7e2 | ||
|
|
00e7a8bcd8 | ||
|
|
1d37329184 | ||
|
|
d0ff538023 | ||
|
|
a3dcf0f25f | ||
|
|
2cb45e92ae | ||
|
|
c5d3fb69f0 | ||
|
|
510509a155 | ||
|
|
ea9304e201 | ||
|
|
942c0c5b9f | ||
|
|
21bee52970 | ||
|
|
2e5be900e0 | ||
|
|
7b22a26a6c | ||
|
|
4f6d461e6c | ||
|
|
86ecc12050 | ||
|
|
6031cb663b | ||
|
|
73df7b9d84 | ||
|
|
75d83fd4e3 | ||
|
|
a56a22790e | ||
|
|
b7f6ec1ceb | ||
|
|
9be1743c53 | ||
|
|
d03552aca4 | ||
|
|
151da2238d | ||
|
|
c87a86ddce | ||
|
|
301f1e3ecb | ||
|
|
ae28b51504 | ||
|
|
572e273beb | ||
|
|
749bad1441 | ||
|
|
c5dc6d0f42 | ||
|
|
4ead780eee | ||
|
|
68e36deeae | ||
|
|
91858893ea | ||
|
|
1fec9249e8 | ||
|
|
79bd901510 | ||
|
|
a7a184f969 | ||
|
|
43d4847e39 | ||
|
|
97aa010602 | ||
|
|
f31b043cf2 | ||
|
|
cff0bf83d1 | ||
|
|
a1b2ba71be | ||
|
|
7cd23c284a | ||
|
|
64048bfee8 | ||
|
|
99501e36de | ||
|
|
19464132e9 | ||
|
|
626d43b9b9 | ||
|
|
b16cf7f8ce | ||
|
|
8a2d8bb008 | ||
|
|
1f9c0f9301 | ||
|
|
23088401f1 | ||
|
|
9dc4c0d57d | ||
|
|
c920f3ce81 | ||
|
|
c893bd08b6 | ||
|
|
3106e9d06f | ||
|
|
423d83ed5e | ||
|
|
2adeda5d44 | ||
|
|
86ade4e13f | ||
|
|
210c260422 | ||
|
|
957f18ba37 | ||
|
|
c626be395a | ||
|
|
b32221e187 | ||
|
|
29e35f0520 | ||
|
|
7f6722c42d | ||
|
|
6831f21300 | ||
|
|
65bb7ec9ab | ||
|
|
dc25d2253f | ||
|
|
e9bed697f9 | ||
|
|
f5388f0a57 | ||
|
|
9e38c8e7f5 | ||
|
|
2de951b5e1 | ||
|
|
b14e740c49 | ||
|
|
88080eb0ca | ||
|
|
2ce441eaba | ||
|
|
97eb2781f4 | ||
|
|
86a1196864 | ||
|
|
7b4d617fcf | ||
|
|
4d9c1b505d | ||
|
|
f4f258000e | ||
|
|
91a8654746 | ||
|
|
9e610eb6ec | ||
|
|
627277d502 | ||
|
|
76b048018a | ||
|
|
5579be7f83 | ||
|
|
19097d695d | ||
|
|
7d03e633ed | ||
|
|
b083b5dcf1 | ||
|
|
315be03700 | ||
|
|
6a1e6bb733 | ||
|
|
161e631a76 | ||
|
|
95757d5a57 | ||
|
|
d96f126a0c | ||
|
|
1272e3e32d | ||
|
|
0ea8101abb | ||
|
|
70e319d520 | ||
|
|
422847539f | ||
|
|
c94242d62f | ||
|
|
352f851549 | ||
|
|
94023386c3 | ||
|
|
daf0a509aa | ||
|
|
99b48aeb83 | ||
|
|
468c2baa03 | ||
|
|
1855f3c434 | ||
|
|
1d649bb6e9 | ||
|
|
60f93d79c2 | ||
|
|
5f4ef6add6 | ||
|
|
2a6cf844ae | ||
|
|
815f7d9019 | ||
|
|
3695d2ada3 | ||
|
|
083ab12581 | ||
|
|
e3af1fde9c | ||
|
|
cbeca5da39 | ||
|
|
829c07cfc0 | ||
|
|
c3c5538e45 | ||
|
|
bc53fbe1c6 | ||
|
|
3d17369f92 | ||
|
|
ae48b26965 | ||
|
|
5fe7ecbb6d | ||
|
|
52bd49b057 | ||
|
|
8c6038c895 | ||
|
|
cfed41d1cf | ||
|
|
07cb3fd9a2 | ||
|
|
39296373cc | ||
|
|
848a1905f5 | ||
|
|
16972a42a2 | ||
|
|
695e6d5bca | ||
|
|
1ea9b708ec | ||
|
|
7d8fba1dbb | ||
|
|
e501c8e37b | ||
|
|
ad83475738 | ||
|
|
95f09f0cab | ||
|
|
ad6c7c3653 | ||
|
|
8c57f945ed | ||
|
|
ce7cd80271 | ||
|
|
39abf77fe6 | ||
|
|
c093cd990a | ||
|
|
ef7d55b955 | ||
|
|
238814eeec | ||
|
|
6a3104eeaf | ||
|
|
de7cfbdf84 | ||
|
|
caaa997aec | ||
|
|
cbf46f2ce4 | ||
|
|
2107169cb8 | ||
|
|
c2392cb80f | ||
|
|
c8193f71d9 | ||
|
|
b4227d5ee7 | ||
|
|
2438f91eb0 | ||
|
|
a53d719607 | ||
|
|
25b5c20c79 | ||
|
|
f8abf69a89 | ||
|
|
be56e159ff | ||
|
|
1a42db67b9 | ||
|
|
22a9338413 | ||
|
|
3fd613d947 | ||
|
|
fe192915b7 | ||
|
|
8c285e2b01 | ||
|
|
f299b1d556 | ||
|
|
b2c449c833 | ||
|
|
0a84afe6ce | ||
|
|
c23c37ab4a | ||
|
|
92006270b1 | ||
|
|
974ca8ffea | ||
|
|
75fbdf4728 | ||
|
|
6e89efe5aa | ||
|
|
f573fdb823 | ||
|
|
51b019210d | ||
|
|
315b18991d | ||
|
|
e2eb31a490 | ||
|
|
30641fbf89 | ||
|
|
1d7f58b6da | ||
|
|
a0b08ecfc7 | ||
|
|
44861fdc5f | ||
|
|
7117b5d594 | ||
|
|
7e54e56ae8 | ||
|
|
778a1aa9c7 |
2
.codecov.yml
Normal file
2
.codecov.yml
Normal file
@ -0,0 +1,2 @@
|
||||
ignore:
|
||||
- "Tests"
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@ -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
|
||||
|
||||
66
.travis.yml
66
.travis.yml
@ -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
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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 */,
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0700"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
43
AFNetworking/AFCompatibilityMacros.h
Normal file
43
AFNetworking/AFCompatibilityMacros.h
Normal file
@ -0,0 +1,43 @@
|
||||
// AFCompatibilityMacros.h
|
||||
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#ifndef AFCompatibilityMacros_h
|
||||
#define AFCompatibilityMacros_h
|
||||
|
||||
#ifdef API_UNAVAILABLE
|
||||
#define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
|
||||
#else
|
||||
#define AF_API_UNAVAILABLE(x)
|
||||
#endif // API_UNAVAILABLE
|
||||
|
||||
#if __has_warning("-Wunguarded-availability-new")
|
||||
#define AF_CAN_USE_AT_AVAILABLE 1
|
||||
#else
|
||||
#define AF_CAN_USE_AT_AVAILABLE 0
|
||||
#endif
|
||||
|
||||
#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
|
||||
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
|
||||
#else
|
||||
#define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
|
||||
#endif
|
||||
|
||||
#endif /* AFCompatibilityMacros_h */
|
||||
@ -1,5 +1,5 @@
|
||||
// AFHTTPSessionManager.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFHTTPSessionManager.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFNetworkReachabilityManager.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
|
||||
///--------------------------------------------------
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFNetworkReachabilityManager.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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 -
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFSecurityPolicy.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFSecurityPolicy.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFURLRequestSerialization.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFURLRequestSerialization.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFURLResponseSerialization.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
151
AFNetworking/AFURLResponseSerialization.m
Normal file → Executable file
@ -1,5 +1,5 @@
|
||||
// AFURLResponseSerialization.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFURLSessionManager.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFURLSessionManager.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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,14 +352,14 @@ 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 NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume";
|
||||
@ -328,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];
|
||||
@ -347,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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,12 +479,15 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
@property (readwrite, nonatomic, strong) NSLock *lock;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidBecomeInvalidBlock sessionDidBecomeInvalid;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge;
|
||||
@property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession;
|
||||
@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,6 +554,19 @@ 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];
|
||||
}
|
||||
@ -524,64 +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;
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
uploadTask.taskDescription = self.taskDescriptionForSessionTasks;
|
||||
|
||||
[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;
|
||||
|
||||
@ -591,29 +664,22 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @"com.alamofi
|
||||
};
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
*progress = delegate.progress;
|
||||
}
|
||||
|
||||
downloadTask.taskDescription = self.taskDescriptionForSessionTasks;
|
||||
|
||||
[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 {
|
||||
@ -657,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 -
|
||||
@ -674,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;
|
||||
}
|
||||
@ -693,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;
|
||||
}
|
||||
@ -744,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 -
|
||||
@ -796,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 -
|
||||
|
||||
@ -822,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 {
|
||||
@ -867,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];
|
||||
}
|
||||
@ -883,7 +985,6 @@ didBecomeInvalidWithError:(NSError *)error
|
||||
self.sessionDidBecomeInvalid(session, error);
|
||||
}
|
||||
|
||||
[self removeAllDelegates];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session];
|
||||
}
|
||||
|
||||
@ -990,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);
|
||||
@ -1021,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
|
||||
@ -1062,7 +1182,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
didReceiveData:(NSData *)data
|
||||
{
|
||||
|
||||
|
||||
AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask];
|
||||
[delegate URLSession:session dataTask:dataTask didReceiveData:data];
|
||||
|
||||
@ -1087,6 +1206,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_OS_OSX
|
||||
- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session {
|
||||
if (self.didFinishEventsForBackgroundURLSession) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@ -1094,6 +1214,7 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - NSURLSessionDownloadDelegate
|
||||
|
||||
@ -1107,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];
|
||||
}
|
||||
|
||||
@ -1127,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);
|
||||
@ -1140,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);
|
||||
@ -1154,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];
|
||||
@ -1171,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];
|
||||
}
|
||||
|
||||
|
||||
394
CHANGELOG.md
394
CHANGELOG.md
@ -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)
|
||||
|
||||
|
||||
@ -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
97
CONTRIBUTING_CH.md
Normal 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) 社区.
|
||||
我们表彰和感激他们为促进项目合作所做的付出。*
|
||||
@ -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 */,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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>
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
@ -1,6 +1,6 @@
|
||||
// Post.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Post.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
@ -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) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// User.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// User.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// AFAppDotNetAPIClient.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
@ -21,7 +21,7 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "AFHTTPSessionManager.h"
|
||||
@import AFNetworking;
|
||||
|
||||
@interface AFAppDotNetAPIClient : AFHTTPSessionManager
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// AFAppDotNetAPIClient.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// TodayViewController.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
// TodayViewController.m
|
||||
//
|
||||
// Copyright (c) 2015 Brian Nickel
|
||||
//
|
||||
// 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
|
||||
@ -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];
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// AppDelegate.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
@ -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
|
||||
49
Example/iOS Example/AppDelegate.m
Normal file
49
Example/iOS Example/AppDelegate.m
Normal file
@ -0,0 +1,49 @@
|
||||
// AppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "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
|
||||
@ -1,6 +1,6 @@
|
||||
// GlobalTimelineViewController.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// GlobalTimelineViewController.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
#import "PostTableViewCell.h"
|
||||
|
||||
#import "UIRefreshControl+AFNetworking.h"
|
||||
@import AFNetworking;
|
||||
|
||||
@interface GlobalTimelineViewController ()
|
||||
@property (readwrite, nonatomic, strong) NSArray *posts;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// TweetTableViewCell.h
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// TweetTableViewCell.m
|
||||
//
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
@ -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];
|
||||
|
||||
31
Example/macOS Example/AppDelegate.h
Normal file
31
Example/macOS Example/AppDelegate.h
Normal file
@ -0,0 +1,31 @@
|
||||
// AppDelegate.h
|
||||
//
|
||||
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSWindow *window;
|
||||
@property (strong) IBOutlet NSTableView *tableView;
|
||||
@property (strong) IBOutlet NSArrayController *postsArrayController;
|
||||
|
||||
@end
|
||||
64
Example/macOS Example/AppDelegate.m
Normal file
64
Example/macOS Example/AppDelegate.m
Normal file
@ -0,0 +1,64 @@
|
||||
// AppDelegate.m
|
||||
//
|
||||
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#import "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
|
||||
@ -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"/>
|
||||
@ -1,5 +1,5 @@
|
||||
// main.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -1,5 +1,5 @@
|
||||
// main.m
|
||||
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
|
||||
// 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
|
||||
|
||||
@ -3,5 +3,4 @@
|
||||
//
|
||||
|
||||
#import <CommonCrypto/CommonCrypto.h>
|
||||
#import "AFNetworking.h"
|
||||
#import "UIKit+AFNetworking.h"
|
||||
@import AFNetworking;
|
||||
@ -1,5 +1,5 @@
|
||||
// AppDelegate.swift
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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:.
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,10 @@
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "tv",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "tv",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "11.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "landscape",
|
||||
"idiom" : "tv",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Gravatar.swift
|
||||
//
|
||||
// Copyright (c) 2015 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
|
||||
@ -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!
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// ViewController.swift
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// ExtensionDelegate.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// ExtensionDelegate.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// InterfaceController.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// InterfaceController.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// AFNetworking.h
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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_ */
|
||||
|
||||
@ -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>
|
||||
|
||||
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2011–2015 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
125
README.md
@ -3,8 +3,13 @@
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.org/AFNetworking/AFNetworking)
|
||||
[](https://codecov.io/github/AFNetworking/AFNetworking?branch=master)
|
||||
[](https://img.shields.io/cocoapods/v/AFNetworking.svg)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoadocs.org/docsets/AFNetworking)
|
||||
[](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.
BIN
Tests/Resources/Google.com/GeoTrust_Global_CA-cross.cer
Normal file
BIN
Tests/Resources/Google.com/GeoTrust_Global_CA-cross.cer
Normal file
Binary file not shown.
BIN
Tests/Resources/Google.com/GeoTrust_Global_CA_Root.cer
Normal file
BIN
Tests/Resources/Google.com/GeoTrust_Global_CA_Root.cer
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tests/Resources/Google.com/GoogleInternetAuthorityG2.cer
Normal file
BIN
Tests/Resources/Google.com/GoogleInternetAuthorityG2.cer
Normal file
Binary file not shown.
BIN
Tests/Resources/Google.com/google.com.cer
Normal file
BIN
Tests/Resources/Google.com/google.com.cer
Normal file
Binary file not shown.
Binary file not shown.
BIN
Tests/Resources/HTTPBin.org/Amazon Root CA 1.cer
Normal file
BIN
Tests/Resources/HTTPBin.org/Amazon Root CA 1.cer
Normal file
Binary file not shown.
BIN
Tests/Resources/HTTPBin.org/Amazon.cer
Normal file
BIN
Tests/Resources/HTTPBin.org/Amazon.cer
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tests/Resources/HTTPBin.org/httpbinorg_03172020.cer
Normal file
BIN
Tests/Resources/HTTPBin.org/httpbinorg_03172020.cer
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
// AFAutoPurgingImageCacheTests.m
|
||||
// Copyright (c) 2011–2015 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
|
||||
@ -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
Loading…
Reference in New Issue
Block a user