diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..65d807e --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,5 @@ +statement_position: + statement_mode: uncuddled_else + +disabled_rules: + - line_length diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 5befc84..0000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/AlamofireImage" ~> 2.0 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 206be22..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" "3.2.0" -github "Alamofire/AlamofireImage" "2.3.1" diff --git a/Carthage/Checkouts/Alamofire/.gitignore b/Carthage/Checkouts/Alamofire/.gitignore deleted file mode 100644 index 222e8ec..0000000 --- a/Carthage/Checkouts/Alamofire/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Mac OS X -.DS_Store - -# Xcode - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -.build/ - -# Carthage -Carthage/Build diff --git a/Carthage/Checkouts/Alamofire/.travis.yml b/Carthage/Checkouts/Alamofire/.travis.yml deleted file mode 100644 index 637cda6..0000000 --- a/Carthage/Checkouts/Alamofire/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -language: objective-c -osx_image: xcode7.2 -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - WORKSPACE=Alamofire.xcworkspace - - IOS_FRAMEWORK_SCHEME="Alamofire iOS" - - OSX_FRAMEWORK_SCHEME="Alamofire OSX" - - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS" - - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS" - - IOS_SDK=iphonesimulator9.2 - - OSX_SDK=macosx10.11 - - TVOS_SDK=appletvsimulator9.1 - - WATCHOS_SDK=watchsimulator2.1 - - EXAMPLE_SCHEME="iOS Example" - matrix: - - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" - - DESTINATION="OS=8.2,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.4,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.2,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" SDK="$OSX_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=9.1,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=2.1,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" -script: - - set -o pipefail - - xcodebuild -version - - xcodebuild -showsdks - - # Build Framework in Debug and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Framework in ReleaseTest and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Debug if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Release if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Run `pod lib lint` if specified - - if [ $POD_LINT == "YES" ]; then - pod lib lint; - fi diff --git a/Carthage/Checkouts/Alamofire/Alamofire.podspec b/Carthage/Checkouts/Alamofire/Alamofire.podspec deleted file mode 100644 index 9690c3e..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.podspec +++ /dev/null @@ -1,17 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'Alamofire' - s.version = '3.2.0' - s.license = 'MIT' - s.summary = 'Elegant HTTP Networking in Swift' - s.homepage = 'https://github.com/Alamofire/Alamofire' - s.social_media_url = 'http://twitter.com/AlamofireSF' - s.authors = { 'Alamofire Software Foundation' => 'info@alamofire.org' } - s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version } - - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '2.0' - - s.source_files = 'Source/*.swift' -end diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj deleted file mode 100644 index ccf8e9e..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1852 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4C0B62511BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0B62521BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0B62531BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4C256A541B096C770065714F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4C3238E71B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4C3238E81B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4C33A1391B5207DB00873DFF /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4C33A13A1B5207DB00873DFF /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4C33A13B1B5207DB00873DFF /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4C33A13C1B5207DB00873DFF /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743CF81C22772D00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D041C22772D00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D091C22772D00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D0A1C22772D00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D0B1C22772D00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743D121C22772E00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D1F1C22772E00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D201C22772E00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D211C22772E00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C743D221C22772F00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743D231C22772F00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743D241C22772F00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743D281C22772F00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D301C22772F00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D351C22772F00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D361C22772F00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D371C22772F00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4CEC605C1B745C9B00E684F4 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4CF626F91BA7CB3E0011A099 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */; }; - 4CF627061BA7CBE30011A099 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - 4CF627171BA7CC240011A099 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4CF6271F1BA7CC240011A099 /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4CF627351BA7CC300011A099 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - 8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; }; - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - E4202FD11B667AA100C997FB /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - E4202FD31B667AA100C997FB /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - E4202FD71B667AA100C997FB /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - E4202FD81B667AA100C997FB /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; }; - F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; - F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4CF626FA1BA7CB3E0011A099 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4CF626EE1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - F8111E6519A967880040E7D1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4DD67C0A1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerializationTests.swift; sourceTree = ""; }; - 4C0B62501BB1001C009302D3 /* Response.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = ""; }; - 4C0E02681BF99A18004E7F18 /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-tvOS.plist"; path = "Source/Info-tvOS.plist"; sourceTree = SOURCE_ROOT; }; - 4C0E5BF71B673D3400816CCC /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; - 4C1DC8531B68908E00476DE3 /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; - 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormData.swift; sourceTree = ""; }; - 4C256A501B096C2C0065714F /* BaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTestCase.swift; sourceTree = ""; }; - 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormDataTests.swift; sourceTree = ""; }; - 4C33A1231B5207DB00873DFF /* rainbow.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbow.jpg; sourceTree = ""; }; - 4C33A1241B5207DB00873DFF /* unicorn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unicorn.png; sourceTree = ""; }; - 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicyTests.swift; sourceTree = ""; }; - 4C341BB91B1A865A00C1B34D /* CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheTests.swift; sourceTree = ""; }; - 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManager.swift; sourceTree = ""; }; - 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManagerTests.swift; sourceTree = ""; }; - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+AlamofireTests.swift"; sourceTree = ""; }; - 4C574E691C67D207000B3128 /* Timeline.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Timeline.swift; sourceTree = ""; }; - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSURLSessionConfiguration+AlamofireTests.swift"; sourceTree = ""; }; - 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicy.swift; sourceTree = ""; }; - 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-root-ca.cer"; path = "alamofire.org/alamofire-root-ca.cer"; sourceTree = ""; }; - 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-signing-ca1.cer"; path = "alamofire.org/alamofire-signing-ca1.cer"; sourceTree = ""; }; - 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-signing-ca2.cer"; path = "alamofire.org/alamofire-signing-ca2.cer"; sourceTree = ""; }; - 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = wildcard.alamofire.org.cer; path = alamofire.org/wildcard.alamofire.org.cer; sourceTree = ""; }; - 4C812C441B535F400017E0BF /* multiple-dns-names.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "multiple-dns-names.cer"; path = "alamofire.org/multiple-dns-names.cer"; sourceTree = ""; }; - 4C812C451B535F400017E0BF /* signed-by-ca1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "signed-by-ca1.cer"; path = "alamofire.org/signed-by-ca1.cer"; sourceTree = ""; }; - 4C812C461B535F400017E0BF /* test.alamofire.org.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = test.alamofire.org.cer; path = alamofire.org/test.alamofire.org.cer; sourceTree = ""; }; - 4C812C4F1B535F540017E0BF /* expired.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = expired.cer; path = alamofire.org/expired.cer; sourceTree = ""; }; - 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "missing-dns-name-and-uri.cer"; path = "alamofire.org/missing-dns-name-and-uri.cer"; sourceTree = ""; }; - 4C812C511B535F540017E0BF /* signed-by-ca2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "signed-by-ca2.cer"; path = "alamofire.org/signed-by-ca2.cer"; sourceTree = ""; }; - 4C812C521B535F540017E0BF /* valid-dns-name.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-dns-name.cer"; path = "alamofire.org/valid-dns-name.cer"; sourceTree = ""; }; - 4C812C531B535F540017E0BF /* valid-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-uri.cer"; path = "alamofire.org/valid-uri.cer"; sourceTree = ""; }; - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "intermediate-ca-disig.cer"; path = "disig.sk/intermediate-ca-disig.cer"; sourceTree = ""; }; - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "root-ca-disig.cer"; path = "disig.sk/root-ca-disig.cer"; sourceTree = ""; }; - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "testssl-expire.disig.sk.cer"; path = "disig.sk/testssl-expire.disig.sk.cer"; sourceTree = ""; }; - 4C83F41A1B749E0E00203445 /* Stream.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stream.swift; sourceTree = ""; }; - 4CA028C41B7466C500C84163 /* ResultTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; - 4CB928281C66BFBC00CE5F08 /* Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = ""; }; - 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLProtocolTests.swift; sourceTree = ""; }; - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = ""; }; - 4CDE2C391AF899EC00BABAE5 /* Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Download.swift; sourceTree = ""; }; - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Upload.swift; sourceTree = ""; }; - 4CDE2C421AF89F0900BABAE5 /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; - 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerialization.swift; sourceTree = ""; }; - 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncoding.swift; sourceTree = ""; }; - 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 72998D721BF26173006D3F69 /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; - B39E2F831C1A72F8002DA1A9 /* certDER.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.cer; path = selfSignedAndMalformedCerts/certDER.cer; sourceTree = ""; }; - B39E2F841C1A72F8002DA1A9 /* certDER.crt */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.crt; path = selfSignedAndMalformedCerts/certDER.crt; sourceTree = ""; }; - B39E2F851C1A72F8002DA1A9 /* certDER.der */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.der; path = selfSignedAndMalformedCerts/certDER.der; sourceTree = ""; }; - B39E2F861C1A72F8002DA1A9 /* certPEM.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = certPEM.cer; path = selfSignedAndMalformedCerts/certPEM.cer; sourceTree = ""; }; - B39E2F871C1A72F8002DA1A9 /* certPEM.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = certPEM.crt; path = selfSignedAndMalformedCerts/certPEM.crt; sourceTree = ""; }; - B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */ = {isa = PBXFileReference; lastKnownFileType = file; name = randomGibberish.crt; path = selfSignedAndMalformedCerts/randomGibberish.crt; sourceTree = ""; }; - B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */ = {isa = PBXFileReference; lastKnownFileType = file; name = keyDER.der; path = selfSignedAndMalformedCerts/keyDER.der; sourceTree = ""; }; - E4202FE01B667AA100C997FB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E3319A95C8B0040E7D1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E3719A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F8111E3819A95C8B0040E7D1 /* Alamofire.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Alamofire.h; sourceTree = ""; }; - F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E4119A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadTests.swift; sourceTree = ""; }; - F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncodingTests.swift; sourceTree = ""; }; - F8111E5D19A9674D0040E7D1 /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; - F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseTests.swift; sourceTree = ""; }; - F8111E5F19A9674D0040E7D1 /* UploadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSEvaluationTests.swift; sourceTree = ""; }; - F897FF4019AA800700AB5182 /* Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alamofire.swift; sourceTree = ""; }; - F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = ""; }; - F8D1C6F419D52968002E74FE /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = ""; }; - F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationTests.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 4CF626EB1BA7CB3E0011A099 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F51BA7CB3E0011A099 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF626F91BA7CB3E0011A099 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C071A5C55C900ED2280 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FD91B667AA100C997FB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E2F19A95C8B0040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3B19A95C8B0040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6AF1A7A94F100A2CD59 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4C256A4E1B09656A0065714F /* Core */ = { - isa = PBXGroup; - children = ( - F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */, - F8D1C6F419D52968002E74FE /* ManagerTests.swift */, - F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */, - F8111E5D19A9674D0040E7D1 /* RequestTests.swift */, - F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */, - 4CA028C41B7466C500C84163 /* ResultTests.swift */, - ); - name = Core; - sourceTree = ""; - }; - 4C256A4F1B09656E0065714F /* Features */ = { - isa = PBXGroup; - children = ( - 4C341BB91B1A865A00C1B34D /* CacheTests.swift */, - F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */, - 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */, - 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */, - 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */, - 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */, - F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */, - F8111E5F19A9674D0040E7D1 /* UploadTests.swift */, - 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */, - F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */, - ); - name = Features; - sourceTree = ""; - }; - 4C3238E91B3617A600FE04AE /* Resources */ = { - isa = PBXGroup; - children = ( - 4C33A1171B5207DB00873DFF /* Certificates */, - 4C33A1221B5207DB00873DFF /* Images */, - ); - name = Resources; - sourceTree = ""; - }; - 4C33A1171B5207DB00873DFF /* Certificates */ = { - isa = PBXGroup; - children = ( - B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */, - 4C812C391B535F060017E0BF /* alamofire.org */, - 4C812C381B535F000017E0BF /* disig.sk */, - ); - name = Certificates; - path = Resources/Certificates; - sourceTree = ""; - }; - 4C33A1221B5207DB00873DFF /* Images */ = { - isa = PBXGroup; - children = ( - 4C33A1231B5207DB00873DFF /* rainbow.jpg */, - 4C33A1241B5207DB00873DFF /* unicorn.png */, - ); - name = Images; - path = Resources/Images; - sourceTree = ""; - }; - 4C33A13D1B52080800873DFF /* Root */ = { - isa = PBXGroup; - children = ( - 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */, - ); - name = Root; - sourceTree = ""; - }; - 4C33A13E1B52081100873DFF /* Intermediate */ = { - isa = PBXGroup; - children = ( - 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */, - 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */, - ); - name = Intermediate; - sourceTree = ""; - }; - 4C33A13F1B52081A00873DFF /* Leaf */ = { - isa = PBXGroup; - children = ( - 4C33A1401B52084400873DFF /* Signed by CA1 */, - 4C33A1411B52084E00873DFF /* Signed by CA2 */, - ); - name = Leaf; - sourceTree = ""; - }; - 4C33A1401B52084400873DFF /* Signed by CA1 */ = { - isa = PBXGroup; - children = ( - 4C812C441B535F400017E0BF /* multiple-dns-names.cer */, - 4C812C451B535F400017E0BF /* signed-by-ca1.cer */, - 4C812C461B535F400017E0BF /* test.alamofire.org.cer */, - 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */, - ); - name = "Signed by CA1"; - sourceTree = ""; - }; - 4C33A1411B52084E00873DFF /* Signed by CA2 */ = { - isa = PBXGroup; - children = ( - 4C812C4F1B535F540017E0BF /* expired.cer */, - 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */, - 4C812C511B535F540017E0BF /* signed-by-ca2.cer */, - 4C812C521B535F540017E0BF /* valid-dns-name.cer */, - 4C812C531B535F540017E0BF /* valid-uri.cer */, - ); - name = "Signed by CA2"; - sourceTree = ""; - }; - 4C7C8D201B9D0D7300948136 /* Extensions */ = { - isa = PBXGroup; - children = ( - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */, - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */, - ); - name = Extensions; - sourceTree = ""; - }; - 4C812C381B535F000017E0BF /* disig.sk */ = { - isa = PBXGroup; - children = ( - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */, - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */, - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */, - ); - name = disig.sk; - sourceTree = ""; - }; - 4C812C391B535F060017E0BF /* alamofire.org */ = { - isa = PBXGroup; - children = ( - 4C33A13D1B52080800873DFF /* Root */, - 4C33A13E1B52081100873DFF /* Intermediate */, - 4C33A13F1B52081A00873DFF /* Leaf */, - ); - name = alamofire.org; - sourceTree = ""; - }; - 4CDE2C481AF8A14A00BABAE5 /* Core */ = { - isa = PBXGroup; - children = ( - 4C1DC8531B68908E00476DE3 /* Error.swift */, - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */, - 4CB928281C66BFBC00CE5F08 /* Notifications.swift */, - 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */, - 4CDE2C391AF899EC00BABAE5 /* Request.swift */, - 4C0B62501BB1001C009302D3 /* Response.swift */, - 4C0E5BF71B673D3400816CCC /* Result.swift */, - ); - name = Core; - sourceTree = ""; - }; - 4CDE2C491AF8A14E00BABAE5 /* Features */ = { - isa = PBXGroup; - children = ( - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */, - 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */, - 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */, - 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */, - 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */, - 4C83F41A1B749E0E00203445 /* Stream.swift */, - 4C574E691C67D207000B3128 /* Timeline.swift */, - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */, - 4CDE2C421AF89F0900BABAE5 /* Validation.swift */, - ); - name = Features; - sourceTree = ""; - }; - B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */ = { - isa = PBXGroup; - children = ( - B39E2F831C1A72F8002DA1A9 /* certDER.cer */, - B39E2F841C1A72F8002DA1A9 /* certDER.crt */, - B39E2F851C1A72F8002DA1A9 /* certDER.der */, - B39E2F861C1A72F8002DA1A9 /* certPEM.cer */, - B39E2F871C1A72F8002DA1A9 /* certPEM.crt */, - B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */, - B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */, - ); - name = "Varying Encoding Types and Extensions"; - sourceTree = ""; - }; - F8111E2919A95C8B0040E7D1 = { - isa = PBXGroup; - children = ( - F8111E3519A95C8B0040E7D1 /* Source */, - F8111E3F19A95C8B0040E7D1 /* Tests */, - F8111E3419A95C8B0040E7D1 /* Products */, - ); - sourceTree = ""; - }; - F8111E3419A95C8B0040E7D1 /* Products */ = { - isa = PBXGroup; - children = ( - F8111E3319A95C8B0040E7D1 /* Alamofire.framework */, - F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */, - 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */, - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */, - E4202FE01B667AA100C997FB /* Alamofire.framework */, - 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */, - 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - F8111E3519A95C8B0040E7D1 /* Source */ = { - isa = PBXGroup; - children = ( - F897FF4019AA800700AB5182 /* Alamofire.swift */, - 4CDE2C481AF8A14A00BABAE5 /* Core */, - 4CDE2C491AF8A14E00BABAE5 /* Features */, - F8111E3619A95C8B0040E7D1 /* Supporting Files */, - ); - path = Source; - sourceTree = ""; - }; - F8111E3619A95C8B0040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - F8111E3819A95C8B0040E7D1 /* Alamofire.h */, - F8111E3719A95C8B0040E7D1 /* Info.plist */, - 72998D721BF26173006D3F69 /* Info-tvOS.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - F8111E3F19A95C8B0040E7D1 /* Tests */ = { - isa = PBXGroup; - children = ( - 4C256A501B096C2C0065714F /* BaseTestCase.swift */, - 4C256A4E1B09656A0065714F /* Core */, - 4C7C8D201B9D0D7300948136 /* Extensions */, - 4C256A4F1B09656E0065714F /* Features */, - 4C3238E91B3617A600FE04AE /* Resources */, - F8111E4019A95C8B0040E7D1 /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - F8111E4019A95C8B0040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - F8111E4119A95C8B0040E7D1 /* Info.plist */, - 4C0E02681BF99A18004E7F18 /* Info-tvOS.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 4CF626EC1BA7CB3E0011A099 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF627061BA7CBE30011A099 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C081A5C55C900ED2280 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FDA1B667AA100C997FB /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CEC605C1B745C9B00E684F4 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3019A95C8B0040E7D1 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CF627041BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS" */; - buildPhases = ( - 4CF626EA1BA7CB3E0011A099 /* Sources */, - 4CF626EB1BA7CB3E0011A099 /* Frameworks */, - 4CF626EC1BA7CB3E0011A099 /* Headers */, - 4CF626ED1BA7CB3E0011A099 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire tvOS"; - productName = "Alamofire tvOS"; - productReference = 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - 4CF626F71BA7CB3E0011A099 /* Alamofire tvOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CF627051BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS Tests" */; - buildPhases = ( - 4CF626F41BA7CB3E0011A099 /* Sources */, - 4CF626F51BA7CB3E0011A099 /* Frameworks */, - 4CF626F61BA7CB3E0011A099 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CF626FB1BA7CB3E0011A099 /* PBXTargetDependency */, - ); - name = "Alamofire tvOS Tests"; - productName = "Alamofire tvOSTests"; - productReference = 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */; - buildPhases = ( - 4DD67C061A5C55C900ED2280 /* Sources */, - 4DD67C071A5C55C900ED2280 /* Frameworks */, - 4DD67C081A5C55C900ED2280 /* Headers */, - 4DD67C091A5C55C900ED2280 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire OSX"; - productName = AlamofireOSX; - productReference = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - E4202FCD1B667AA100C997FB /* Alamofire watchOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = E4202FDD1B667AA100C997FB /* Build configuration list for PBXNativeTarget "Alamofire watchOS" */; - buildPhases = ( - E4202FCE1B667AA100C997FB /* Sources */, - E4202FD91B667AA100C997FB /* Frameworks */, - E4202FDA1B667AA100C997FB /* Headers */, - E4202FDC1B667AA100C997FB /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire watchOS"; - productName = Alamofire; - productReference = E4202FE01B667AA100C997FB /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - F8111E3219A95C8B0040E7D1 /* Alamofire iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */; - buildPhases = ( - F8111E2E19A95C8B0040E7D1 /* Sources */, - F8111E2F19A95C8B0040E7D1 /* Frameworks */, - F8111E3019A95C8B0040E7D1 /* Headers */, - F8111E3119A95C8B0040E7D1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire iOS"; - productName = Alamofire; - productReference = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */; - buildPhases = ( - F8111E3A19A95C8B0040E7D1 /* Sources */, - F8111E3B19A95C8B0040E7D1 /* Frameworks */, - F8111E3C19A95C8B0040E7D1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F8111E6619A967880040E7D1 /* PBXTargetDependency */, - ); - name = "Alamofire iOS Tests"; - productName = AlamofireTests; - productReference = F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */; - buildPhases = ( - F829C6AE1A7A94F100A2CD59 /* Sources */, - F829C6AF1A7A94F100A2CD59 /* Frameworks */, - F829C6B01A7A94F100A2CD59 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */, - ); - name = "Alamofire OSX Tests"; - productName = "Alamofire OSX Tests"; - productReference = F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F8111E2A19A95C8B0040E7D1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - 4CF626EE1BA7CB3E0011A099 = { - CreatedOnToolsVersion = 7.1; - }; - 4CF626F71BA7CB3E0011A099 = { - CreatedOnToolsVersion = 7.1; - }; - 4DD67C0A1A5C55C900ED2280 = { - CreatedOnToolsVersion = 6.1.1; - }; - F8111E3219A95C8B0040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - F8111E3D19A95C8B0040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - F829C6B11A7A94F100A2CD59 = { - CreatedOnToolsVersion = 6.1.1; - }; - }; - }; - buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = F8111E2919A95C8B0040E7D1; - productRefGroup = F8111E3419A95C8B0040E7D1 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F8111E3219A95C8B0040E7D1 /* Alamofire iOS */, - F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */, - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */, - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */, - 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */, - 4CF626F71BA7CB3E0011A099 /* Alamofire tvOS Tests */, - E4202FCD1B667AA100C997FB /* Alamofire watchOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 4CF626ED1BA7CB3E0011A099 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F61BA7CB3E0011A099 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */, - 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */, - 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */, - 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */, - 4C743CF81C22772D00BCB23E /* certDER.der in Resources */, - 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */, - 4C743D0B1C22772D00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */, - 4C743D0A1C22772D00BCB23E /* root-ca-disig.cer in Resources */, - 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */, - 4CF627351BA7CC300011A099 /* unicorn.png in Resources */, - 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */, - 4C743D091C22772D00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */, - 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D041C22772D00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C091A5C55C900ED2280 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FDC1B667AA100C997FB /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3119A95C8B0040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3C19A95C8B0040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */, - 4C33A13B1B5207DB00873DFF /* unicorn.png in Resources */, - 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */, - 4C743D281C22772F00BCB23E /* keyDER.der in Resources */, - 4C743D241C22772F00BCB23E /* certDER.der in Resources */, - 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */, - 4C743D371C22772F00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743D221C22772F00BCB23E /* certDER.cer in Resources */, - 4C743D361C22772F00BCB23E /* root-ca-disig.cer in Resources */, - 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */, - 4C33A1391B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */, - 4C743D351C22772F00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743D231C22772F00BCB23E /* certDER.crt in Resources */, - 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D301C22772F00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6B01A7A94F100A2CD59 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */, - 4C33A13C1B5207DB00873DFF /* unicorn.png in Resources */, - 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */, - 4C743D121C22772E00BCB23E /* keyDER.der in Resources */, - 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */, - 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */, - 4C743D211C22772E00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */, - 4C743D201C22772E00BCB23E /* root-ca-disig.cer in Resources */, - 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */, - 4C33A13A1B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */, - 4C743D1F1C22772E00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */, - 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 4CF626EA1BA7CB3E0011A099 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */, - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */, - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */, - 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */, - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */, - 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */, - 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */, - 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */, - 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */, - 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */, - 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */, - 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */, - 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */, - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */, - 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F41BA7CB3E0011A099 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */, - 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */, - 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */, - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */, - 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */, - 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */, - 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */, - 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */, - 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */, - 4CF627171BA7CC240011A099 /* ParameterEncodingTests.swift in Sources */, - 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */, - 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */, - 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */, - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */, - 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */, - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - 4CF6271F1BA7CC240011A099 /* ResponseSerializationTests.swift in Sources */, - 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C061A5C55C900ED2280 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */, - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */, - 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, - 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */, - 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */, - 4C0B62521BB1001C009302D3 /* Response.swift in Sources */, - 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */, - 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */, - 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */, - 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */, - 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FCE1B667AA100C997FB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */, - 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */, - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */, - E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */, - E4202FD11B667AA100C997FB /* Request.swift in Sources */, - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */, - E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */, - E4202FD31B667AA100C997FB /* Manager.swift in Sources */, - 4C0B62531BB1001C009302D3 /* Response.swift in Sources */, - 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */, - E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */, - E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */, - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */, - E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */, - E4202FD71B667AA100C997FB /* Download.swift in Sources */, - E4202FD81B667AA100C997FB /* Validation.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E2E19A95C8B0040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */, - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */, - 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, - 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */, - 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */, - 4C0B62511BB1001C009302D3 /* Response.swift in Sources */, - F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */, - 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */, - 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */, - 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */, - 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3A19A95C8B0040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C3238E71B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, - 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, - 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */, - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, - 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */, - 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, - F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */, - 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, - F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */, - 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */, - F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */, - F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */, - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */, - F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */, - F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */, - F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */, - 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */, - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6AE1A7A94F100A2CD59 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C3238E81B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, - 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, - 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */, - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, - 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */, - 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, - F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */, - 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, - F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */, - 4C256A541B096C770065714F /* BaseTestCase.swift in Sources */, - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */, - F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */, - F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */, - F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */, - F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */, - F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */, - 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */, - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4CF626FB1BA7CB3E0011A099 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */; - targetProxy = 4CF626FA1BA7CB3E0011A099 /* PBXContainerItemProxy */; - }; - F8111E6619A967880040E7D1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F8111E3219A95C8B0040E7D1 /* Alamofire iOS */; - targetProxy = F8111E6519A967880040E7D1 /* PBXContainerItemProxy */; - }; - F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */; - targetProxy = F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 4C0FFAF81C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = ReleaseTest; - }; - 4C0FFAF91C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - }; - name = ReleaseTest; - }; - 4C0FFAFA1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = ReleaseTest; - }; - 4C0FFAFB1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = ReleaseTest; - }; - 4C0FFAFC1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = ReleaseTest; - }; - 4C0FFAFD1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4C0FFAFE1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4C0FFAFF1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = ReleaseTest; - }; - 4CF627001BA7CB3E0011A099 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4CF627011BA7CB3E0011A099 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4CF627021BA7CB3E0011A099 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4CF627031BA7CB3E0011A099 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4DD67C1F1A5C55C900ED2280 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4DD67C201A5C55C900ED2280 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Release; - }; - E4202FDE1B667AA100C997FB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Debug; - }; - E4202FDF1B667AA100C997FB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Release; - }; - F8111E4419A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Debug; - }; - F8111E4519A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Release; - }; - F8111E4719A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - F8111E4819A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - }; - name = Release; - }; - F8111E4A19A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - F8111E4B19A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - F829C6BC1A7A94F100A2CD59 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Debug; - }; - F829C6BD1A7A94F100A2CD59 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4CF627041BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CF627001BA7CB3E0011A099 /* Debug */, - 4CF627011BA7CB3E0011A099 /* Release */, - 4C0FFAFD1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4CF627051BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CF627021BA7CB3E0011A099 /* Debug */, - 4CF627031BA7CB3E0011A099 /* Release */, - 4C0FFAFE1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4DD67C1F1A5C55C900ED2280 /* Debug */, - 4DD67C201A5C55C900ED2280 /* Release */, - 4C0FFAFB1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E4202FDD1B667AA100C997FB /* Build configuration list for PBXNativeTarget "Alamofire watchOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E4202FDE1B667AA100C997FB /* Debug */, - E4202FDF1B667AA100C997FB /* Release */, - 4C0FFAFF1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4419A95C8B0040E7D1 /* Debug */, - F8111E4519A95C8B0040E7D1 /* Release */, - 4C0FFAF81C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4719A95C8B0040E7D1 /* Debug */, - F8111E4819A95C8B0040E7D1 /* Release */, - 4C0FFAF91C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4A19A95C8B0040E7D1 /* Debug */, - F8111E4B19A95C8B0040E7D1 /* Release */, - 4C0FFAFA1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F829C6BC1A7A94F100A2CD59 /* Debug */, - F829C6BD1A7A94F100A2CD59 /* Release */, - 4C0FFAFC1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F8111E2A19A95C8B0040E7D1 /* Project object */; -} diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7d39b0e..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme deleted file mode 100644 index 2052c92..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme deleted file mode 100644 index b5f528e..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme deleted file mode 100644 index bdf82c7..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme b/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme deleted file mode 100644 index 9f7c434..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 748f4a0..0000000 --- a/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/CHANGELOG.md b/Carthage/Checkouts/Alamofire/CHANGELOG.md deleted file mode 100644 index 4c77692..0000000 --- a/Carthage/Checkouts/Alamofire/CHANGELOG.md +++ /dev/null @@ -1,1193 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -`Alamofire` adheres to [Semantic Versioning](http://semver.org/). - -#### 3.x Releases -- `3.2.x` Releases - [3.2.0](#320) -- `3.1.x` Releases - [3.1.0](#310) | [3.1.1](#311) | [3.1.2](#312) | [3.1.3](#313) | [3.1.4](#314) | [3.1.5](#315) -- `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301) -- `3.0.0` Betas - [3.0.0-beta.1](#300-beta1) | [3.0.0-beta.2](#300-beta2) | [3.0.0-beta.3](#300-beta3) - -#### 2.x Releases -- `2.0.x` Releases - [2.0.0](#200) | [2.0.1](#201) | [2.0.2](#202) -- `2.0.0` Betas - [2.0.0-beta.1](#200-beta1) | [2.0.0-beta.2](#200-beta2) | [2.0.0-beta.3](#200-beta3) | [2.0.0-beta.4](#200-beta4) - -#### 1.x Releases -- `1.3.x` Releases - [1.3.0](#130) | [1.3.1](#131) -- `1.2.x` Releases - [1.2.0](#120) | [1.2.1](#121) | [1.2.2](#122) | [1.2.3](#123) -- `1.1.x` Releases - [1.1.0](#110) | [1.1.1](#111) | [1.1.2](#112) | [1.1.3](#113) | [1.1.4](#114) | [1.1.5](#115) -- `1.0.x` Releases - [1.0.0](#100) | [1.0.1](#101) - ---- - -## [3.2.0](https://github.com/Alamofire/Alamofire/releases/tag/3.2.0) -Released on 2016-02-07. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.2.0). - -#### Added -- Notifications that post when an `NSURLSessionTask` changes state to allow support for the - network activity indicator. - - Added by [Christian Noon](https://github.com/cnoon). -- `Timeline` struct to capture timings throughout the lifecycle of a `Request`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1054](https://github.com/Alamofire/Alamofire/issues/1054). -- A new `Timeline` section to the README. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1054](https://github.com/Alamofire/Alamofire/issues/1054). -- `NetworkReachabilityManager` to listen for reachability status changes. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). -- Unit tests for all the testable network reachability manager APIs. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). -- A new `Network Reachability` section to the README. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). - -#### Updated -- The `NSURLSessionStream` APIs to support `tvOS`. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `ParameterEncoding` encode method to allow empty parameters to still be encoded. - - Updated by [Christian Noon](https://github.com/cnoon) in Regards to Issues - [#1032](https://github.com/Alamofire/Alamofire/issues/1032) and - [#1049](https://github.com/Alamofire/Alamofire/issues/1049). - -#### Fixed -- Broken CocoaDocs generation by moving iOS Example project into Examples folder. - - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request - [#1027](https://github.com/Alamofire/Alamofire/issues/1027) in Regards to Issue - [#1025](https://github.com/Alamofire/Alamofire/issues/1025). - ---- - -## [3.1.5](https://github.com/Alamofire/Alamofire/releases/tag/3.1.5) -Released on 2016-01-17. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.5). - -#### Added -- `Package.swift` to the project to support Swift Package Manager (SPM). - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#979](https://github.com/Alamofire/Alamofire/pull/979). -- Safeguards to the `Request` class's `debugDescription` property. - - Added by [tokorom](https://github.com/tokorom) in Pull Request - [#983](https://github.com/Alamofire/Alamofire/pull/983). - -#### Updated -- `Accept-Language` header generation to use functional style. - - Updated by [Dapeng Gao](https://github.com/dapenggao) in Pull Request - [#982](https://github.com/Alamofire/Alamofire/pull/982). -- `Accept-Encoding` and `Accept-Language` header values to have separator spaces between values. - - Updated by [Christian Noon](https://github.com/cnoon). -- Copyright headers to include 2016! 🎉🎉🎉 - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.1.4](https://github.com/Alamofire/Alamofire/releases/tag/3.1.4) -Released on 2015-12-16. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.4). - -#### Added -- `NSTemporaryExceptionMinimumTLSVersion` documentation to the ATS section in the README. - - Added by [Marandon Antoine](https://github.com/ntnmrndn) in Pull Request - [#952](https://github.com/Alamofire/Alamofire/pull/952). -- Added `ReleaseTest` configuration to allow running tests against optimized build. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Carthage instructions in the README to clearly callout the `carthage update` command. - - Updated by [vlad](https://github.com/vlastachu) in Pull Request - [#955](https://github.com/Alamofire/Alamofire/pull/955). -- `ParameterEncoding` to early out when passed an empty parameters dictionary. - - Updated by [Anthony Miller](https://github.com/AnthonyMDev) in Pull Request - [#954](https://github.com/Alamofire/Alamofire/pull/954). -- The `certificatesInBundle` to support `cer`, `crt` and `der` extensions. - - Updated by [Jacob Jennings](https://github.com/jacobjennings) in Pull Request - [#956](https://github.com/Alamofire/Alamofire/pull/956). -- The `ENABLE_TESTABILITY` flag to `NO` for Release configuration and disabled tests for - non-test builds to better support Carthage. - - Updated by [Jed Lewison](https://github.com/jedlewison) in Pull Request - [#953](https://github.com/Alamofire/Alamofire/pull/953). -- The server certificates for the TLS tests and added all certificates to all test targets. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Travis-CI configuration to Xcode 7.2, iOS 9.2, tvOS 9.1 and watchOS 2.1. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- `SecCertificate` array Swift workaround in `ServerTrustPolicy` for Xcode 7.2. - - Removed by [Christian Noon](https://github.com/cnoon). - -## [3.1.3](https://github.com/Alamofire/Alamofire/releases/tag/3.1.3) -Released on 2015-11-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.3). - -#### Added -- Custom `Info.plist` for tvOS setting the `UIRequiredDeviceCapabilities` to `arm64`. - - Added by [Simon Støvring](https://github.com/simonbs) in Pull Request - [#913](https://github.com/Alamofire/Alamofire/pull/913). - -#### Updated -- All code samples in the README to use `https` instead of `http`. - - Updated by [Tomonobu Sato](https://github.com/tmnb) in Pull Request - [#912](https://github.com/Alamofire/Alamofire/pull/912). - -## [3.1.2](https://github.com/Alamofire/Alamofire/releases/tag/3.1.2) -Released on 2015-11-06. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.2). - -#### Updated -- Code signing on iOS simulator builds to not sign simulator builds. - - Updated by [John Heaton](https://github.com/JRHeaton) in Pull Request - [#903](https://github.com/Alamofire/Alamofire/pull/903). -- Code signing on watchOS and tvOS simulators builds to not sign simulator builds. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.1.1](https://github.com/Alamofire/Alamofire/releases/tag/3.1.1) -Released on 2015-10-31. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.1). - -#### Added -- Support for 204 response status codes in the response serializers. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#889](https://github.com/Alamofire/Alamofire/pull/889). -- ATS section to the README explaining how to configure the settings. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#876](https://github.com/Alamofire/Alamofire/issues/876). - -#### Updated -- Several unnecessary uses of `NSString` with `String`. - - Updated by [Nicholas Maccharoli](https://github.com/Nirma) in Pull Request - [#885](https://github.com/Alamofire/Alamofire/pull/885). -- Content type validation to always succeeds when server data is `nil` or zero length. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#890](https://github.com/Alamofire/Alamofire/pull/890). - -#### Removed -- The mention of rdar://22307360 from the README since Xcode 7.1 has been released. - - Removed by [Elvis Nuñez](https://github.com/3lvis) in Pull Request - [#891](https://github.com/Alamofire/Alamofire/pull/891). -- An unnecessary availability check now that Xcode 7.1 is out of beta. - - Removed by [Christian Noon](https://github.com/cnoon). -- The playground from the project due to instability reasons. - - Removed by [Christian Noon](https://github.com/cnoon). -- The data length checks in the `responseData` and `responseString` serializers. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#889](https://github.com/Alamofire/Alamofire/pull/889). - -## [3.1.0](https://github.com/Alamofire/Alamofire/releases/tag/3.1.0) -Released on 2015-10-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.0). - -#### Added -- New tvOS framework and test targets to the project. - - Added by [Bob Scarano](https://github.com/bscarano) in Pull Request - [#767](https://github.com/Alamofire/Alamofire/pull/767). -- The tvOS deployment target to the podspec. - - Added by [Christian Noon](https://github.com/cnoon). -- The `BITCODE_GENERATION_MODE` user defined setting to tvOS framework target. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The README to include tvOS and bumped the required version of Xcode. - - Updated by [Christian Noon](https://github.com/cnoon). -- The default tvOS and watchOS deployment targets in the Xcode project. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `APPLICATION_EXTENSION_API_ONLY` enabled flag to `YES` in the tvOS framework target. - - Updated by [James Barrow](https://github.com/Baza207) in Pull Request - [#771](https://github.com/Alamofire/Alamofire/pull/771). -- The Travis-CI yaml file to run watchOS and tvOS builds and tests on xcode7.1 osx_image. - - Updated by [Christian Noon](https://github.com/cnoon). - ---- - -## [3.0.1](https://github.com/Alamofire/Alamofire/releases/tag/3.0.1) -Released on 2015-10-19. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.1). - -#### Added -- Tests around content type validation with accept parameters. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Content type validation issue where parameter parsing on `;` was incorrect. - - Fixed by [Christian Noon](https://github.com/cnoon). - -## [3.0.0](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0) -Released on 2015-10-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0). - -#### Updated -- `Downloading a File` code sample in the README to compile against Swift 2.0. - - Updated by [Screon](https://github.com/Screon) in Pull Request - [#827](https://github.com/Alamofire/Alamofire/pull/827). -- Download code samples in the README to use `response` serializer. - - Updated by [Christian Noon](https://github.com/cnoon). -- CocoaPods and Carthage installation instructions for 3.0. - - Updated by [Christian Noon](https://github.com/cnoon). -- Carthage description and installation instructions in the README. - - Updated by [Ashton Williams](https://github.com/Ashton-W) in Pull Request - [#843](https://github.com/Alamofire/Alamofire/pull/843). -- URL encoding internals to leverage the dictionary keys lazy evaluation. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Small typo in the Alamofire 3.0 Migration Guide `Response` section. - - Fixed by [neugartf](https://github.com/neugartf) in Pull Request - [#826](https://github.com/Alamofire/Alamofire/pull/826). -- User defined `BITCODE_GENERATION_MODE` setting for Carthage builds. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#835](https://github.com/Alamofire/Alamofire/issues/835). - ---- - -## [3.0.0-beta.3](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.3) -Released on 2015-09-27. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.3). - -#### Updated -- The `Response` initializer to have a `public` ACL instead of `internal`. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.0.0-beta.2](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.2) -Released on 2015-09-26. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.2). - -#### Added -- Tests around the header behavior for redirected requests. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#798](https://github.com/Alamofire/Alamofire/issues/798). -- A migration guide for Alamofire 3.0 documenting all API changes. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- `Response` initializer to have `internal` ACL. - - Updated by [Christian Noon](https://github.com/cnoon). -- All sample code in the README to conform to the Alamofire 3.0 APIs. - - Updated by [Christian Noon](https://github.com/cnoon). -- URL percent escaping to only batch on OS's where required improving -overall performance. - - Updated by [Christian Noon](https://github.com/cnoon). -- Basic auth example in the README to compile on Swift 2.0. - - Updated by [David F. Muir V](https://github.com/dfmuir) in Pull Request - [#810](https://github.com/Alamofire/Alamofire/issues/810). - -#### Fixed -- Compiler errors in the playground due to the new response serializer APIs. - - Fixed by [Christian Noon](https://github.com/cnoon). - -## [3.0.0-beta.1](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.1) -Released on 2015-09-21. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.1). - -#### Added -- A new `Response` struct to simplify response serialization. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#792](https://github.com/Alamofire/Alamofire/pull/792). -- A new initializer to the `Manager` allowing dependency injection of the -underlying `NSURLSession`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#795](https://github.com/Alamofire/Alamofire/pull/795). -- Tests around the new `Manager` initialization methods. - -#### Updated -- Result type to take two generic parameters (`Value` and `Error`) where `Error` -conforms to `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All response serializers to now return the original server data as `NSData?`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- The `TaskDelegate` to store an error as an `NSError` instead of `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- The `ValidationResult` failure case to require an `NSError` instead of `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All tests around response serialization and `Result` type usage. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All response serializers to use the new `Response` type. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - - [#792](https://github.com/Alamofire/Alamofire/pull/792). -- The designated initializer for a `Manager` to accept a `SessionDelegate` parameter -allowing dependency injection for better background session support. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#795](https://github.com/Alamofire/Alamofire/pull/795). - ---- - -## [2.0.2](https://github.com/Alamofire/Alamofire/releases/tag/2.0.2) -Released on 2015-09-20. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.2). - -#### Updated -- The Embedded Framework documentation to include `git init` info. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#782](https://github.com/Alamofire/Alamofire/issues/782). - -#### Fixed -- Alamofire iOS framework target by adding Alamofire iOS Tests as Target Dependency. - - Fixed by [Nicky Gerritsen](https://github.com/nickygerritsen) in Pull Request - [#780](https://github.com/Alamofire/Alamofire/pull/780). -- Percent encoding issue for long Chinese strings using URL parameter encoding. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#206](https://github.com/Alamofire/Alamofire/issues/206). - -## [2.0.1](https://github.com/Alamofire/Alamofire/releases/tag/2.0.1) -Released on 2015-09-16. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.1). - -#### Updated -- The CocoaPods installation instructions in the README. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Carthage installation instructions in the README. - - Updated by [Gustavo Barbosa](https://github.com/barbosa) in Pull Request - [#759](https://github.com/Alamofire/Alamofire/pull/759). - -#### Fixed -- The link to the 2.0 migration guide in the README. - - Fixed by [Dwight Watson](https://github.com/dwightwatson) in Pull Request - [#750](https://github.com/Alamofire/Alamofire/pull/750). -- Issue where NTLM authentication credentials were not used for authentication challenges. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#721](https://github.com/Alamofire/Alamofire/pull/721). - -## [2.0.0](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0) -Released on 2015-09-09. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0). - -#### Added -- A new `URLEncodedInURL` case to the `ParameterEncoding` for encoding in the URL. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#742](https://github.com/Alamofire/Alamofire/pull/742). - ---- - -## [2.0.0-beta.4](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.4) -Released on 2015-09-06. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.4). - -#### Added -- The `parameters` and `encoding` parameters to download APIs. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#719](https://github.com/Alamofire/Alamofire/issues/719). -- Section to the README about wildcard domain matching with server trust policies. - - Added by [Sai](https://github.com/sai-prasanna) in Pull Request - [#718](https://github.com/Alamofire/Alamofire/pull/718). -- A UTF-8 charset to Content-Type header for a URL encoded body. - - Added by [Cheolhee Han](https://github.com/cheolhee) in Pull Request - [#731](https://github.com/Alamofire/Alamofire/pull/731). -- Tests around posting unicode parameters with URL encoding. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Pull Request - [#731](https://github.com/Alamofire/Alamofire/pull/731). -- Tests for uploading base 64 encoded image data inside JSON. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#738](https://github.com/Alamofire/Alamofire/issues/738). -- An Alamofire 2.0 migration guide document to the new Documentation folder. - - Added by [Christian Noon](https://github.com/cnoon). -- A Migration Guides section to the README with link to 2.0 guide. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Response serialization to prevent unnecessary call to response serializer. - - Updated by [Julien Ducret](https://github.com/brocoo) in Pull Request - [#716](https://github.com/Alamofire/Alamofire/pull/716). -- Travis-CI yaml file to support iOS 9, OSX 10.11 and Xcode 7. - - Updated by [Christian Noon](https://github.com/cnoon). -- Result types to store an `ErrorType` instead of `NSError`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#732](https://github.com/Alamofire/Alamofire/issues/732). -- Docstrings on the download method to be more accurate. - - Updated by [Christian Noon](https://github.com/cnoon). -- The README to require Xcode 7 beta 6. - - Updated by [Christian Noon](https://github.com/cnoon). -- The background session section of the README to use non-deprecated API. - - Updated by [David F. Muir V](https://github.com/dfmuir) in Pull Request - [#724](https://github.com/Alamofire/Alamofire/pull/724). -- The playground to use the `Result` type. - - Updated by [Jonas Schmid](https://github.com/jschmid) in Pull Request - [#726](https://github.com/Alamofire/Alamofire/pull/726). -- Updated progress code samples in the README to show how to call onto the main queue. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- The AFNetworking sections from the FAQ in the README. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Issue on Windows where the wildcarded cert name in the test suite included asterisk. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#723](https://github.com/Alamofire/Alamofire/issues/723). -- Crash when multipart form data was uploaded from in-memory data on background session. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#740](https://github.com/Alamofire/Alamofire/issues/740). -- Issue where the background session completion handler was not called on the main queue. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#728](https://github.com/Alamofire/Alamofire/issues/728). - -## [2.0.0-beta.3](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.3) -Released on 2015-08-25. - -#### Removed -- The override for `NSMutableURLRequest` for the `URLRequestConvertible` protocol -conformance that could cause unwanted URL request referencing. - - Removed by [Christian Noon](https://github.com/cnoon). - -## [2.0.0-beta.2](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.2) -Released on 2015-08-24. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.2). - -#### Added -- Host and certificate chain validation section to the README. - - Added by [Christian Noon](https://github.com/cnoon). -- Tests verifying configuration headers are sent with all configuration types. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#692](https://github.com/Alamofire/Alamofire/issues/692). -- New rdar to the list in the README about the #available check issue. - - Added by [Christian Noon](https://github.com/cnoon). -- Override for `NSMutableURLRequest` for the `URLRequestConvertible` protocol. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The README to note that CocoaPods 0.38.2 is required. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#682](https://github.com/Alamofire/Alamofire/issues/682). -- The README to include note about keeping a reference to the `Manager`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#681](https://github.com/Alamofire/Alamofire/issues/681). -- Server trust host validation over to use SSL policy evaluation. - - Updated by [Christian Noon](https://github.com/cnoon). -- The documentation for the `URLRequestConvertible` section in the README. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `ServerTrustPolicyManager` to be more flexible by using `public` ACL. - - Updated by [Jan Riehn](https://github.com/jriehn) in Pull Request - [#696](https://github.com/Alamofire/Alamofire/pull/696). -- The `ServerTrustPolicyManager` policies property to use `public` ACL and -added docstrings. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Ono response serializer example for Swift 2.0 in the README. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#700](https://github.com/Alamofire/Alamofire/issues/700). -- `Result` failure case to store an `ErrorType` instead of `NSError`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#703](https://github.com/Alamofire/Alamofire/issues/703). -- All source code to compile with Xcode 7 beta 6. - - Updated by [Michael Gray](https://github.com/mishagray) in Pull Request - [#707](https://github.com/Alamofire/Alamofire/pull/707). - -#### Removed -- The `required` declaration on the `Manager` init method. - - Removed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#672](https://github.com/Alamofire/Alamofire/issues/672). - -#### Fixed -- Issue where the `TaskDelegate` operation queue would leak if the task was -never started. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Compiler issue on OS X target when creating background configurations -in the test suite. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#693](https://github.com/Alamofire/Alamofire/issues/693). - -## [2.0.0-beta.1](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.1) -Released on 2015-08-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.1). - -#### Added -- A `watchOS` deployment target to the podspec. - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#574](https://github.com/Alamofire/Alamofire/pull/574). -- Full screen support in the iOS Example App. - - Added by [Corinne Krych](https://github.com/corinnekrych) in Pull Request - [#612](https://github.com/Alamofire/Alamofire/pull/612). -- Temporary workaround for `SecCertificate` array compiler crash. - - Added by [Robert Rasmussen](https://github.com/robrasmussen) in Issue - [#610](https://github.com/Alamofire/Alamofire/issues/610). -- `Result` and `Error` types to refactor response validation and serialization. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#627](https://github.com/Alamofire/Alamofire/pull/627). -- Tests around response data, string and json serialization result behavior. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#627](https://github.com/Alamofire/Alamofire/pull/627). -- `CustomStringConvertible` and `CustomDebugStringConvertible` conformance -to the `Result` enumeration. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- A Resume Data section to the README inside the Downloads section. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- A `watchOS` framework target to the project. - - Added by [Tobias Ottenweller](https://github.com/tomco) in Pull Request - [#616](https://github.com/Alamofire/Alamofire/pull/616). -- `Result` tests pushing code coverage for `Result` enum to 100%. - - Added by [Christian Noon](https://github.com/cnoon). -- Tests around all response serializer usage. - - Added by [Christian Noon](https://github.com/cnoon). -- Public docstrings for all public `SessionDelegate` methods. - - Added by [Christian Noon](https://github.com/cnoon). -- A section to the README that calls out all open rdars affecting Alamofire. - - Added by [Christian Noon](https://github.com/cnoon). -- Test for wildcard validation that contains response with nil MIME type. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#662](https://github.com/Alamofire/Alamofire/pull/662). -- Support for stream tasks in iOS 9+ and OSX 10.11+. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#659](https://github.com/Alamofire/Alamofire/pull/659). - -#### Updated -- All logic to compile against Swift 2.0. - - Updated by [Christian Noon](https://github.com/cnoon). -- All logic to use the latest Swift 2.0 conventions. - - Updated by [Christian Noon](https://github.com/cnoon). -- All public docstrings to the latest Swift 2.0 syntax. - - Updated by [Christian Noon](https://github.com/cnoon). -- `URLRequestConvertible` to return an `NSMutableURLRequest`. - - Updated by [Christian Noon](https://github.com/cnoon). -- All HTTP requests to HTTPS to better align with ATS. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `escape` method in `ParameterEncoding` to use non-deprecated methods. - - Updated by [Christian Noon](https://github.com/cnoon). -- All source code and docstrings to fit roughly within 120 characters. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `MultipartFormData` encoding to leverage Swift 2.0 error handling. - - Updated by [Christian Noon](https://github.com/cnoon). -- All README code samples to match the latest Swift 2.0 API changes. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- All frameworks to enable code coverage generation. - - Updated by [Christian Noon](https://github.com/cnoon). -- All frameworks to set the enable testability flag to YES for release builds. - - Updated by [Christian Noon](https://github.com/cnoon) in regard to Issue - [#652](https://github.com/Alamofire/Alamofire/issues/652). -- `ParameterEncoding` to leverage guard for parameters to increase safety. - - Updated by [Christian Noon](https://github.com/cnoon). -- iOS Example App to use optional bind around response to safely extract headers. - - Updated by [John Pope](https://github.com/johndpope) in Pull Request - [#665](https://github.com/Alamofire/Alamofire/pull/665). -- The `queryComponents` and `escape` methods in `ParameterEncoding` to `public` to -better support `.Custom` encoding. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#660](https://github.com/Alamofire/Alamofire/pull/660). -- The static error convenience functions to a public ACL. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#668](https://github.com/Alamofire/Alamofire/issues/668). - -#### Removed -- Explicit string values in `ParameterEncoding` since they are now implied. - - Removed by [Christian Noon](https://github.com/cnoon). -- An OSX cookie check in the `CustomDebugStringConvertible` conformance of a `Request`. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Issue in automatic validation tests where mutable URL request was not used. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Potential crash cases in Validation MIME type logic exposed by chaining. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Compiler issue in the iOS Example App around `Result` type usage. - - Fixed by [Jan Kase](https://github.com/jankase) in Pull Request - [#639](https://github.com/Alamofire/Alamofire/pull/639). -- The error code in the custom response serializers section of the README. - - Fixed by [Christian Noon](https://github.com/cnoon). - ---- - -## [1.3.1](https://github.com/Alamofire/Alamofire/releases/tag/1.3.1) -Released on 2015-08-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.3.1). - -#### Fixed -- Issue where a completed task was not released by the `SessionDelegate` if the -task override closure was set. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#622](https://github.com/Alamofire/Alamofire/issues/622). - -## [1.3.0](https://github.com/Alamofire/Alamofire/releases/tag/1.3.0) -Released on 2015-07-24. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.3.0). - -#### Added -- Test case around `NSURLProtocol` checking header passthrough behaviors. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#473](https://github.com/Alamofire/Alamofire/issues/473). -- Stream method on `Request` to receive data incrementally from data responses. - - Added by [Peter Sobot](https://github.com/psobot) in Pull Request - [#512](https://github.com/Alamofire/Alamofire/pull/512). -- Example to the README demonstrating how to use the `responseCollection` serializer. - - Added by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#532](https://github.com/Alamofire/Alamofire/pull/532). -- Link to the README to the CocoaDocs documentation for Alamofire. - - Added by [Robert](https://github.com/rojotek) in Pull Request - [#541](https://github.com/Alamofire/Alamofire/pull/541). -- Support for uploading `MultipartFormData` in-memory and streaming from disk. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#539](https://github.com/Alamofire/Alamofire/pull/539). -- Tests for uploading `MultipartFormData` with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#539](https://github.com/Alamofire/Alamofire/pull/539). -- The iOS 8.4 simulator to the Travis CI builds by switching to the Xcode 6.4 build. - - Added by [Syo Ikeda](https://github.com/ikesyo) in Pull Request - [#568](https://github.com/Alamofire/Alamofire/pull/568). -- Tests for the custom header support with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- Section to the README about new HTTP header support in the global functions. - - Added by [Christian Noon](https://github.com/cnoon). -- Basic auth `Authorization` header example to the README. - - Added by [Christian Noon](https://github.com/cnoon). -- TLS certificate and public key pinning support through the `ServerTrustPolicy`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- Tests for TLS certificate and public key pinning with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- Security section to the README detailing various server trust policies. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- The `resumeData` property to `Request` to expose outside data response serializer. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#595](https://github.com/Alamofire/Alamofire/pull/595). -- Download request sample to iOS example app. - - Added by [Kengo Yokoyama](https://github.com/kentya6) in Pull Request - [#579](https://github.com/Alamofire/Alamofire/pull/579). - -#### Updated -- The INFOPLIST_FILE Xcode project setting to be a relative path. - - Updated by [Christian Noon](https://github.com/cnoon). -- Exposed persistence parameter for basic auth credentials. - - Updated by [Christian Noon](https://github.com/cnoon) in regard to Issue - [#537](https://github.com/Alamofire/Alamofire/issues/537). -- The Travis CI builds to run a full `pod lib lint` pass on the source. - - Updated by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#542](https://github.com/Alamofire/Alamofire/pull/542). -- All cases of force unwrapping with optional binding and where clause when applicable. - - Updated by [Syo Ikeda](https://github.com/ikesyo) in Pull Request - [#557](https://github.com/Alamofire/Alamofire/pull/557). -- The `ParameterEncoding` encode return tuple to return a mutable URL request. - - Updated by [Petr Korolev](https://github.com/skywinder) in Pull Request - [#478](https://github.com/Alamofire/Alamofire/pull/478). -- The `URLRequest` convenience method to return a mutable `NSURLRequest`. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `request` / `download` / `upload` methods to support custom headers. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- The global `request` / `download` / `upload` method external parameters convention. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- Response serialization to use generics and a `ResponseSerializer` protocol. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#593](https://github.com/Alamofire/Alamofire/pull/593). -- Download task delegate to store resume data for a failed download if available. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#595](https://github.com/Alamofire/Alamofire/pull/595). -- The `TaskDelegate.queue` to public to allow custom request extension operations. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#590](https://github.com/Alamofire/Alamofire/pull/590). -- The README code samples for Advanced Response Serialization. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- An unnecessary `NSURLSessionConfiguration` type declaration that can be inferred. - - Removed by [Avismara](https://github.com/avismarahl) in Pull Request - [#576](https://github.com/Alamofire/Alamofire/pull/576). -- Unnecessary `respondsToSelector` overrides for `SessionDelegate` methods. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#590](https://github.com/Alamofire/Alamofire/pull/590). -- Unnecessary calls to `self` throughout source, test and example logic. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Random test suite basic auth failures by clearing credentials in `setUp` method. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Error where wildcard was failing due to missing response MIME type. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#598](https://github.com/Alamofire/Alamofire/pull/598). -- Typo in the basic auth headers example code in the README. - - Fixed by [蒲公英の生活](https://github.com/fewspider) in Pull Request - [#605](https://github.com/Alamofire/Alamofire/pull/605). -- Issue where the example app was printing elapsed time in optional form. - - Fixed by [Christian Noon](https://github.com/cnoon). - -#### Upgrade Notes -There are a couple changes in the 1.3.0 release that are not fully backwards -compatible and need to be called out. - -* The global `request` / `download` / `upload` external parameter naming conventions -were not consistent nor did they match the `Manager` equivalents. By making them -consistent across the board, this introduced the possibility that you "may" need to -make slight modifications to your global function calls. -* In order to support generic response serializers, the lowest level -`Request.response` method had to be converted to a generic method leveraging the new -`ResponseSerializer` protocol. This has many advantages, the most obvious being that -the `response` convenience method now returns an `NSData?` optional instead of an -`AnyObject?` optional. Nice! - - > Please note that every effort is taken to maintain proper semantic versioning. In -these two rare cases, it was deemed to be in the best interest of the community to -slightly break semantic versioning to unify naming conventions as well as expose a -much more powerful form of response serialization. - - > If you have any issues, please don't hesitate to reach out through -[GitHub](https://github.com/Alamofire/Alamofire/issues) or -[Twitter](https://twitter.com/AlamofireSF). - ---- - -## [1.2.3](https://github.com/Alamofire/Alamofire/releases/tag/1.2.3) -Released on 2015-06-12. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.2.3). - -#### Added -- Tests for data task progress closure and NSProgress updates. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#494](https://github.com/Alamofire/Alamofire/pull/494). -- More robust tests around download and upload progress. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#494](https://github.com/Alamofire/Alamofire/pull/494). -- More robust redirect tests around default behavior and task override closures. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#507](https://github.com/Alamofire/Alamofire/pull/507). -- The "[" and "]" to the legal escape characters and added more documentation. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#504](https://github.com/Alamofire/Alamofire/pull/504). -- Percent escaping tests around reserved / unreserved / illegal characters. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#504](https://github.com/Alamofire/Alamofire/pull/504). -- Tests for various Cache-Control headers with different request cache policies. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#505](https://github.com/Alamofire/Alamofire/pull/505). -- Link to Carthage in the README. - - Added by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#520](https://github.com/Alamofire/Alamofire/pull/520). - -#### Updated -- iOS 7 instructions to cover multiple Swift files in the README. - - Updated by [Sébastien Michoy](https://github.com/SebastienMichoy) in regards - to Issue [#479](https://github.com/Alamofire/Alamofire/pull/479). -- All tests to follow the Given / When / Then structure. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- All tests to be crash safe. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- The OS X tests so that they are all passing again. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- Re-enabled Travis-CI tests for both iOS and Mac OS X. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run all tests in both debug and release. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run all tests on iOS 8.1, 8.2 and 8.3 as well as Mac OS X 10.10. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run `pod lib lint` against the latest version of CocoaPods. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). - -#### Fixed -- Random deinitialization test failure by handling task state race condition. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Typo in the API Parameter Abstraction in the README. - - Fixed by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#500](https://github.com/Alamofire/Alamofire/pull/500). -- Cookies are now only applied in the DebugPrintable API when appropriate. - - Fixed by [Alex Plescan](https://github.com/alexpls) in Pull Request - [#516](https://github.com/Alamofire/Alamofire/pull/516). - -## [1.2.2](https://github.com/Alamofire/Alamofire/releases/tag/1.2.2) -Released on 2015-05-13. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.2.2). - -#### Added -- Contributing Guidelines document to the project. - - Added by [Mattt Thompson](https://github.com/mattt). -- Documentation to the `URLStringConvertible` protocol around RFC specs. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#464](https://github.com/Alamofire/Alamofire/pull/464). -- The `Carthage/Build` ignore flag to the `.gitignore` file. - - Added by [Tomáš Slíž](https://github.com/tomassliz) in Pull Request - [#451](https://github.com/Alamofire/Alamofire/pull/451). -- The `.DS_Store` ignore flag to the `.gitignore` file. - - Added by [Christian Noon](https://github.com/cnoon). -- Response status code asserts for redirect tests. - - Added by [Christian Noon](https://github.com/cnoon). -- A CHANGELOG to the project documenting each official release. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- `SessionDelegate` override closure properties to match the method signatures. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#456](https://github.com/Alamofire/Alamofire/pull/456). -- Documentation for the `Printable` protocol on `Request` to reference output stream -rather than the specific `OutputStreamType`. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Deployment targets to iOS 8.0 and OS X 10.9 for the respective frameworks. - - Updated by [Christian Noon](https://github.com/cnoon). -- `SessionDelegate` willPerformHTTPRedirection method to accept optional return type -from override closure. - - Updated by [Chungsub Kim](https://github.com/subicura) in Pull Request - [#469](https://github.com/Alamofire/Alamofire/pull/469). -- Embedded Framework and Source File documentation in the README. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#427](https://github.com/Alamofire/Alamofire/pull/427). -- Alamofire source to be split into multiple core files and feature files. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#471](https://github.com/Alamofire/Alamofire/pull/471). -- `TaskDelegate` override closure signatures and delegate method implementations. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- Travis-CI build status from the README until Xcode 6.3 is supported. - - Removed by [Mattt Thompson](https://github.com/mattt). -- Unnecessary parentheses from closure parameters and typealiases. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- `SessionDelegate` override closure documentation. - - Fixed by [Siemen Sikkema](https://github.com/siemensikkema) in Pull Request - [#448](https://github.com/Alamofire/Alamofire/pull/448). -- Some inaccurate documentation on several of the public `SessionDelegate` closures. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#456](https://github.com/Alamofire/Alamofire/pull/456). -- A deinit race condition where the task delegate queue could fail to `dispatch_release`. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#379](https://github.com/Alamofire/Alamofire/pull/379). -- `TaskDelegate` to only set `qualityOfService` for `NSOperationQueue` on iOS 8+. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#472](https://github.com/Alamofire/Alamofire/pull/472). -- Expectation order issue in the redirect tests. - - Fixed by [Christian Noon](https://github.com/cnoon). -- `DataTaskDelegate` behavior ensuring `NSProgress` values and `progress` override -closures are always updated and executed. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#407](https://github.com/Alamofire/Alamofire/pull/407). - -## [1.2.1](https://github.com/Alamofire/Alamofire/releases/tag/1.2.1) -Released on 2015-04-21. - -#### Added -- Redirect tests for the `SessionDelegate`. - - Added by [Jonathan Hersh](https://github.com/jhersh) in Pull Request - [#424](https://github.com/Alamofire/Alamofire/pull/424). -- TLS evaluation test case. - - Added by [Mattt Thompson](https://github.com/mattt). -- Additional guards to ensure unique task identifiers for upload and download tasks. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#393](https://github.com/Alamofire/Alamofire/pull/393). - -#### Updated -- Required Xcode version to Xcode to 6.3 in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- SSL validation to use default system validation by default. - - Updated by [Michael Thole](https://github.com/mthole) in Pull Request - [#394](https://github.com/Alamofire/Alamofire/pull/394). - -## [1.2.0](https://github.com/Alamofire/Alamofire/releases/tag/1.2.0) -Released on 2015-04-09. - -#### Added -- New `testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter` -test. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#370](https://github.com/Alamofire/Alamofire/pull/370). -- New `backgroundCompletionHandler` property to the `Manager` called when the -session background tasks finish. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). - -#### Updated -- `Request` computed property `progress` to no longer be an optional type. - - Updated by [Pitiphong Phongpattranont](https://github.com/pitiphong-p) in - Pull Request - [#404](https://github.com/Alamofire/Alamofire/pull/404). -- All logic to Swift 1.2. - - Updated by [Aron Cedercrantz](https://github.com/rastersize) and - [Mattt Thompson](https://github.com/mattt). -- The `responseString` serializer to respect server provided character encoding with -overrideable configuration, default string response serialization to ISO-8859-1, as -per the HTTP/1.1 specification. - - Updated by [Kyle Fuller](https://github.com/kylef) and - [Mattt Thompson](https://github.com/mattt) in Pull Request - [#359](https://github.com/Alamofire/Alamofire/pull/359) which also resolved Issue - [#358](https://github.com/Alamofire/Alamofire/pull/358). -- `SessionDelegate` methods to first call the override closures if set. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- `SessionDelegate` and all override closures to a public ACL allowing for customization. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- `SessionDelegate` class to `final`. - - Updated by [Mattt Thompson](https://github.com/mattt). -- `SessionDelegate` header documentation for method override properties. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Xcode project to set `APPLICATION_EXTENSION_API_ONLY` to `YES` for OS X target. - - Updated by [Mattt Thompson](https://github.com/mattt). - -#### Removed -- Ambiguous response serializer methods that collided with default parameters. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#408](https://github.com/Alamofire/Alamofire/pull/408). -- `SessionDelegate` initializer and replaced with default property value. - - Removed by [Mattt Thompson](https://github.com/mattt). - -#### Fixed -- Async tests where asserts were potentially not being run by by moving -`expectation.fullfill()` to end of closures. - - Fixed by [Nate Cook](https://github.com/natecook1000) in Pull Request - [#420](https://github.com/Alamofire/Alamofire/pull/420). -- Small grammatical error in the ParameterEncoding section of the README. - - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request - [#416](https://github.com/Alamofire/Alamofire/pull/416). -- Typo in a download test comment. - - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request - [#413](https://github.com/Alamofire/Alamofire/pull/413). -- Signature mismatch in the `dataTaskDidBecomeDownloadTask` override closure. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- Issue in the `SessionDelegate` where the `DataTaskDelegate` was not being called. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). - ---- - -## [1.1.5](https://github.com/Alamofire/Alamofire/releases/tag/1.1.5) -Released on 2015-03-26. - -#### Added -- Convenience upload functions to the `Manager`. - - Added by [Olivier Bohrer](https://github.com/obohrer) in Pull Request - [#334](https://github.com/Alamofire/Alamofire/pull/334). -- Info to the README about Swift 1.2 support. - - Added by [Mattt Thompson](https://github.com/mattt). - -#### Updated -- All request / upload / download methods on `Manager` to match the top-level functions. - - Updated by [Mattt Thompson](https://github.com/mattt). -- The `testDownloadRequest` to no longer remove the downloaded file. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Ono XML response serializer example in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI settings to only build the master branch. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Code signing identities for the frameworks and targets to better support Carthage. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#400](https://github.com/Alamofire/Alamofire/pull/400). -- iOS deployment target to iOS 8.0 for iOS target and tests. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#401](https://github.com/Alamofire/Alamofire/pull/401). -- Legal characters to be escaped according to RFC 3986 Section 3.4. - - Updated by [Stephane Lizeray](https://github.com/slizeray) in Pull Request - [#370](https://github.com/Alamofire/Alamofire/pull/370). - -#### Fixed -- Travis-CI scheme issue, added podspec linting and added ENV variables. - - Fixed by [Jonathan Hersh](https://github.com/jhersh) in Pull Request - [#351](https://github.com/Alamofire/Alamofire/pull/351). -- Code sample in the README in the Manual Parameter Encoding section. - - Fixed by [Petr Korolev](https://github.com/skywinder) in Pull Request - [#381](https://github.com/Alamofire/Alamofire/pull/381). - -## [1.1.4](https://github.com/Alamofire/Alamofire/releases/tag/1.1.4) -Released on 2015-01-30. - -#### Added -- Podspec argument `requires_arc` to the podspec file. - - Added by [Mattt Thompson](https://github.com/mattt). -- Support for Travis-CI for automated testing purposes. - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#279](https://github.com/Alamofire/Alamofire/pull/279). - -#### Updated -- Installation instructions in the README to include CocoaPods, Carthage and -Embedded Frameworks. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI to use Xcode 6.1.1. - - Updated by [Mattt Thompson](https://github.com/mattt). -- The `download` method on `Manager` to use `Request.DownloadFileDestination` typealias. - - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request - [#318](https://github.com/Alamofire/Alamofire/pull/318). -- `RequestTests` to no longer delete all cookies in default session configuration. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI yaml file to only build the active architecture. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Deployment targets to iOS 7.0 and Mac OS X 10.9. - - Updated by [Mattt Thompson](https://github.com/mattt). - -#### Removed -- The `tearDown` method in the `AlamofireDownloadResponseTestCase`. - - Removed by [Mattt Thompson](https://github.com/mattt). - -#### Fixed -- Small formatting issue in the CocoaPods Podfile example in the README. - - Fixed by [rborkow](https://github.com/rborkow) in Pull Request - [#313](https://github.com/Alamofire/Alamofire/pull/313). -- Several issues with the iOS and OSX targets in the Xcode project. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- The `testDownloadRequest` in `DownloadTests` by adding `.json` file extension. - - Fixed by [Martin Kavalar](https://github.com/mk) in Pull Request - [#302](https://github.com/Alamofire/Alamofire/pull/302). -- The `AlamofireRequestDebugDescriptionTestCase` on OSX. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Spec validation error with CocoaPods 0.36.0.beta-1 by disabling -b flags in `cURL` -debug on OSX. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Travis-CI build issue by adding suppport for an `iOS Example` scheme. - - Fixed by [Yasuharu Ozaki](https://github.com/yasuoza) in Pull Request - [#322](https://github.com/Alamofire/Alamofire/pull/322). - -## [1.1.3](https://github.com/Alamofire/Alamofire/releases/tag/1.1.3) -Released on 2015-01-09. - -#### Added -- Podspec file to support CocoaPods deployment. - - Added by [Marius Rackwitz](https://github.com/mrackwitz) in Pull Request - [#218](https://github.com/Alamofire/Alamofire/pull/218). -- Shared scheme to support Carthage deployments. - - Added by [Yosuke Ishikawa](https://github.com/ishkawa) in Pull Request - [#228](https://github.com/Alamofire/Alamofire/pull/228). -- New target for Alamofire OSX framework. - - Added by [Martin Kavalar](https://github.com/mk) in Pull Request - [#293](https://github.com/Alamofire/Alamofire/pull/293). - -#### Updated -- Upload and Download progress state to be updated before calling progress closure. - - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request - [#278](https://github.com/Alamofire/Alamofire/pull/278). - -#### Fixed -- Some casting code logic in the Generic Response Object Serialization example in -the README. - - Fixed by [Philip Heinser](https://github.com/philipheinser) in Pull Request - [#258](https://github.com/Alamofire/Alamofire/pull/258). -- Indentation formatting of the `responseString` parameter documentation. - - Fixed by [Ah.Miao](https://github.com/mrahmiao) in Pull Request - [#291](https://github.com/Alamofire/Alamofire/pull/291). - -## [1.1.2](https://github.com/Alamofire/Alamofire/releases/tag/1.1.2) -Released on 2014-12-21. - -#### Added -- POST request JSON response test. - - Added by [Mattt Thompson](https://github.com/mattt). - -#### Updated -- The response object example to use a failable initializer in the README. - - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#230](https://github.com/Alamofire/Alamofire/pull/230). -- Router example in the README by removing extraneous force unwrap. - - Updated by [Arnaud Mesureur](https://github.com/nsarno) in Pull Request - [#247](https://github.com/Alamofire/Alamofire/pull/247). -- Xcode project `APPLICATION_EXTENSION_API_ONLY` flag to `YES`. - - Updated by [Michael Latta](https://github.com/technomage) in Pull Request - [#273](https://github.com/Alamofire/Alamofire/pull/273). -- Default HTTP header creation by moving it into a public class method. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#261](https://github.com/Alamofire/Alamofire/pull/261). - -#### Fixed -- Upload stream method to set `HTTPBodyStream` for streamed request. - - Fixed by [Florent Vilmart](https://github.com/flovilmart) and - [Mattt Thompson](https://github.com/mattt) in Pull Request - [#241](https://github.com/Alamofire/Alamofire/pull/241). -- ParameterEncoding to compose percent-encoded query strings from -percent-encoded components. - - Fixed by [Oleh Sannikov](https://github.com/sunnycows) in Pull Request - [#249](https://github.com/Alamofire/Alamofire/pull/249). -- Serialization handling of NSData with 0 bytes. - - Fixed by [Mike Owens](https://github.com/mowens) in Pull Request - [#254](https://github.com/Alamofire/Alamofire/pull/254). -- Issue where `suggestedDownloadDestination` parameters were being ignored. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#257](https://github.com/Alamofire/Alamofire/pull/257). -- Crash caused by `Manager` deinitialization and added documentation. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#269](https://github.com/Alamofire/Alamofire/pull/269). - -## [1.1.1](https://github.com/Alamofire/Alamofire/releases/tag/1.1.1) -Released on 2014-11-20. - -#### Updated -- Dispatch-based synchronized access to subdelegates. - - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request - [#175](https://github.com/Alamofire/Alamofire/pull/175). -- iOS 7 instructions in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- CRUD example in the README to work on Xcode 6.1. - - Updated by [John Beynon](https://github.com/johnbeynon) in Pull Request - [#187](https://github.com/Alamofire/Alamofire/pull/187). -- The `cURL` example annotation in the README to pick up `bash` syntax highlighting. - - Updated by [Samuel E. Giddins](https://github.com/segiddins) in Pull Request - [#208](https://github.com/Alamofire/Alamofire/pull/208). - -#### Fixed -- Out-of-memory exception by replacing `stringByAddingPercentEncodingWithAllowedCharacters` -with `CFURLCreateStringByAddingPercentEscapes`. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#206](https://github.com/Alamofire/Alamofire/pull/206). -- Several issues in the README examples where an NSURL initializer needs to be unwrapped. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request - [#213](https://github.com/Alamofire/Alamofire/pull/213). -- Possible exception when force unwrapping optional header properties. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Optional cookie entry in `cURL` output. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#226](https://github.com/Alamofire/Alamofire/pull/226). -- Optional `textLabel` property on cells in the example app. - - Fixed by [Mattt Thompson](https://github.com/mattt). - -## [1.1.0](https://github.com/Alamofire/Alamofire/releases/tag/1.1.0) -Released on 2014-10-20. - -#### Updated -- Project to support Swift 1.1 and Xcode 6.1. - - Updated by [Aral Balkan](https://github.com/aral), - [Ross Kimes](https://github.com/rosskimes), - [Orta Therox](https://github.com/orta), - [Nico du Plessis](https://github.com/nduplessis) - and [Mattt Thompson](https://github.com/mattt). - ---- - -## [1.0.1](https://github.com/Alamofire/Alamofire/releases/tag/1.0.1) -Released on 2014-10-20. - -#### Added -- Tests for upload and download with progress. - - Added by [Mattt Thompson](https://github.com/mattt). -- Test for question marks in url encoded query. - - Added by [Mattt Thompson](https://github.com/mattt). -- The `NSURLSessionConfiguration` headers to `cURL` representation. - - Added by [Matthias Ryne Cheow](https://github.com/rynecheow) in Pull Request - [#140](https://github.com/Alamofire/Alamofire/pull/140). -- Parameter encoding tests for key/value pairs containing spaces. - - Added by [Mattt Thompson](https://github.com/mattt). -- Percent character encoding for the `+` character. - - Added by [Niels van Hoorn](https://github.com/nvh) in Pull Request - [#167](https://github.com/Alamofire/Alamofire/pull/167). -- Escaping for quotes to support JSON in `cURL` commands. - - Added by [John Gibb](https://github.com/johngibb) in Pull Request - [#178](https://github.com/Alamofire/Alamofire/pull/178). -- The `request` method to the `Manager` bringing it more inline with the top-level methods. - - Added by Brian Smith. - -#### Fixed -- Parameter encoding of ampersands and escaping of characters. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issues - [#146](https://github.com/Alamofire/Alamofire/pull/146) and - [#162](https://github.com/Alamofire/Alamofire/pull/162). -- Parameter encoding of `HTTPBody` from occurring twice. - - Fixed by Yuri in Pull Request - [#153](https://github.com/Alamofire/Alamofire/pull/153). -- Extraneous dispatch to background by using weak reference for delegate in response. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Response handler threading issue by adding a `subdelegateQueue` to the `SessionDelegate`. - - Fixed by [Essan Parto](https://github.com/parto) in Pull Request - [#171](https://github.com/Alamofire/Alamofire/pull/171). -- Challenge issue where basic auth credentials were not being unwrapped. - - Fixed by [Mattt Thompson](https://github.com/mattt). - -## [1.0.0](https://github.com/Alamofire/Alamofire/releases/tag/1.0.0) -Released on 2014-09-25. - -#### Added -- Initial release of Alamofire. - - Added by [Mattt Thompson](https://github.com/mattt). diff --git a/Carthage/Checkouts/Alamofire/CONTRIBUTING.md b/Carthage/Checkouts/Alamofire/CONTRIBUTING.md deleted file mode 100644 index 5de3be7..0000000 --- a/Carthage/Checkouts/Alamofire/CONTRIBUTING.md +++ /dev/null @@ -1,91 +0,0 @@ -# Contributing Guidelines - -This document contains information and guidelines about contributing to this project. -Please read it before you start participating. - -**Topics** - -* [Asking Questions](#asking-questions) -* [Reporting Security Issues](#reporting-security-issues) -* [Reporting Issues](#reporting-other-issues) -* [Developers Certificate of Origin](#developers-certificate-of-origin) -* [Code of Conduct](#code-of-conduct) - -## Asking Questions - -We don't use GitHub as a support forum. -For any usage questions that are not specific to the project itself, -please ask on [Stack Overflow](https://stackoverflow.com) instead. -By doing so, you'll be more likely to quickly solve your problem, -and you'll allow anyone else with the same question to find the answer. -This also allows maintainers to focus on improving the project for others. - -## Reporting Security Issues - -The Alamofire Software Foundation takes security seriously. -If you discover a security issue, please bring it to our attention right away! - -Please **DO NOT** file a public issue, -instead send your report privately to . -This will help ensure that any vulnerabilities that _are_ found -can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure) -to any affected parties. - -## Reporting Other Issues - -A great way to contribute to the project -is to send a detailed issue when you encounter an problem. -We always appreciate a well-written, thorough bug report. - -Check that the project issues database -doesn't already include that problem or suggestion before submitting an issue. -If you find a match, add a quick "+1" or "I have this problem too." -Doing this helps prioritize the most common problems and requests. - -When reporting issues, please include the following: - -* The version of Xcode you're using -* The version of iOS or OS X you're targeting -* The full output of any stack trace or compiler error -* A code snippet that reproduces the described behavior, if applicable -* Any other details that would be useful in understanding the problem - -This information will help us review and fix your issue faster. - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -- (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. - -## Code of Conduct - -The Code of Conduct governs how we behave in public or in private -whenever the project will be judged by our actions. -We expect it to be honored by everyone who contributes to this project. - -See [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md) for details. - ---- - -*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](http://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.* diff --git a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md b/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md deleted file mode 100644 index 5716906..0000000 --- a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md +++ /dev/null @@ -1,202 +0,0 @@ -# Alamofire 2.0 Migration Guide - -Alamofire 2.0 is the latest major release of Alamofire, an HTTP networking library for iOS, Mac OS X and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 2.0 introduces several API-breaking changes that one should be aware of. - -This guide is provided in order to ease the transition of existing applications using Alamofire 1.x to the latest APIs, as well as explain the design and structure of new and changed functionality. - -## New Requirements - -Alamofire 2.0 officially supports iOS 8+, Mac OS X 10.9+, Xcode 7 and Swift 2.0. If you'd like to use Alamofire in a project targeting iOS 7 and Swift 1.x, use the latest tagged 1.x release. - ---- - -## Breaking API Changes - -### Swift 2.0 - -The biggest change between Alamofire 1.x and Alamofire 2.0 is Swift 2.0. Swift 2 brought many new features to take advantage of such as error handling, protocol extensions and availability checking. Other new features such as `guard` and `defer` do not affect the public APIs, but allowed us to create much cleaner implementations of the same logic. All of the source files, test logic and example code has been updated to reflect the latest Swift 2.0 paradigms. - -> It is not possible to use Alamofire 2.0 without Swift 2.0. - -### Response Serializers - -The most significant logic change made to Alamofire 2.0 is its new response serialization system leveraging `Result` types. Previously in Alamofire 1.x, each response serializer used the same completion handler signature: - -```swift -public func response(completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { - return response(serializer: Request.responseDataSerializer(), completionHandler: completionHandler) -} -``` - -Alamofire 2.0 has redesigned the entire response serialization process to make it much easier to access the original server data without serialization, or serialize the response into a non-optional `Result` type defining whether the `Request` was successful. - -#### No Response Serialization - -The first `response` serializer is non-generic and does not process the server data in any way. It merely forwards on the accumulated information from the `NSURLSessionDelegate` callbacks. - -```swift -public func response( - queue queue: dispatch_queue_t? = nil, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, ErrorType?) -> Void) - -> Self -{ - delegate.queue.addOperationWithBlock { - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, self.delegate.data, self.delegate.error) - } - } - - return self -} -``` - -Another important note of this change is the return type of `data` is now an `NSData` type. You no longer need to cast the `data` parameter from an `AnyObject?` to an `NSData?`. - -#### Generic Response Serializers - -The second, more powerful response serializer leverages generics along with a `Result` type to eliminate the case of the dreaded double optional. - -```swift -public func response( - queue queue: dispatch_queue_t? = nil, - responseSerializer: T, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, Result) -> Void) - -> Self -{ - delegate.queue.addOperationWithBlock { - let result: Result = { - if let error = self.delegate.error { - return .Failure(self.delegate.data, error) - } else { - return responseSerializer.serializeResponse(self.request, self.response, self.delegate.data) - } - }() - - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, result) - } - } - - return self -} -``` - -##### Response Data - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseData { _, _, result in - print("Success: \(result.isSuccess)") - print("Response: \(result)") - } -``` - -##### Response String - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseString { _, _, result in - print("Success: \(result.isSuccess)") - print("Response String: \(result.value)") - } -``` - -##### Response JSON - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseJSON { _, _, result in - print(result) - debugPrint(result) - } -``` - -#### Result Types - -The `Result` enumeration was added to handle the case of the double optional return type. Previously, the return value and error were both optionals. Checking if one was `nil` did not ensure the other was also not `nil`. This case has been blogged about many times and can be solved by a `Result` type. Alamofire 2.0 brings a `Result` type to the response serializers to make it much easier to handle success and failure cases. - -```swift -public enum Result { - case Success(Value) - case Failure(NSData?, ErrorType) -} -``` - -There are also many other convenience computed properties to make accessing the data inside easy. The `Result` type also conforms to the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to make it easier to debug. - -#### Error Types - -While Alamofire still only generates `NSError` objects, all `Result` types have been converted to store `ErrorType` objects to allow custom response serializer implementations to use any `ErrorType` they wish. This also includes the `ValidationResult` and `MultipartFormDataEncodingResult` types as well. - -### URLRequestConvertible - -In order to make it easier to deal with non-common scenarios, the `URLRequestConvertible` protocol now returns an `NSMutableURLRequest`. Alamofire 2.0 makes it much easier to customize the URL request after is has been encoded. This should only affect a small amount of users. - -```swift -public protocol URLRequestConvertible { - var URLRequest: NSMutableURLRequest { get } -} -``` - -### Multipart Form Data - -Encoding `MultipartFormData` previous returned an `EncodingResult` to encapsulate any possible errors that occurred during encoding. Alamofire 2.0 uses the new Swift 2.0 error handling instead making it easier to use. This change is mostly encapsulated internally and should only affect a very small subset of users. - ---- - -## Updated ACLs and New Features - -### Parameter Encoding - -#### ACL Updates - -The `ParameterEncoding` enumeration implementation was previously hidden behind `internal` and `private` ACLs. Alamofire 2.0 opens up the `queryComponents` and `escape` methods to make it much easier to implement `.Custom` cases. - -#### Encoding in the URL - -In the previous versions of Alamofire, `.URL` encoding would automatically append the query string to either the URL or HTTP body depending on which HTTP method was set in the `NSURLRequest`. While this satisfies the majority of common use cases, it made it quite difficult to append query string parameter to a URL for HTTP methods such as `PUT` and `POST`. In Alamofire 2.0, we've added a second URL encoding case, `.URLEncodedInURL`, that always appends the query string to the URL regardless of HTTP method. - -### Server Trust Policies - -In Alamofire 1.x, the `ServerTrustPolicyManager` methods were internal making it impossible to implement any custom domain matching behavior. Alamofire 2.0 opens up the internals with a `public` ACL allowing more flexible server trust policy matching behavior (i.e. wildcarded domains) through subclassing. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -### Download Requests - -The global and `Manager` download APIs now support `parameters` and `encoding` parameters to better support dynamic payloads used in background sessions. Constructing a `download` request is now the same as constructing a `data` request with the addition of a `destination` parameter. - -```swift -public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request -{ - return Manager.sharedInstance.download( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers, - destination: destination - ) -} -``` - -### Stream Tasks - -Alamofire 2.0 adds support for creating `NSURLSessionStreamTask` tasks for iOS 9 and OS X 10.11. It also extends the `SessionDelegate` to support all the new `NSURLSessionStreamDelegate` APIs. diff --git a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md b/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md deleted file mode 100644 index 38736fc..0000000 --- a/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md +++ /dev/null @@ -1,186 +0,0 @@ -# Alamofire 3.0 Migration Guide - -Alamofire 3.0 is the latest major release of Alamofire, an HTTP networking library for iOS, Mac OS X and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 3.0 introduces several API-breaking changes that one should be aware of. - -This guide is provided in order to ease the transition of existing applications using Alamofire 2.x to the latest APIs, as well as explain the design and structure of new and changed functionality. - -## Requirements - -Alamofire 3.0 officially supports iOS 8+, Mac OS X 10.9+, watchOS 2.0, Xcode 7 and Swift 2.0. If you'd like to use Alamofire in a project targeting iOS 7 and Swift 1.x, use the latest tagged 1.x release. - -## Reasons for Bumping to 3.0 - -The [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) (ASF) tries to do everything possible to avoid MAJOR version bumps. We realize the challenges involved with migrating large projects from one MAJOR version to another. With that said, we also want to make sure we're always producing the highest quality APIs and features possible. - -After releasing Alamofire 2.0, it became clear that the response serialization system still had some room for improvement. After much debate, we decided to strictly follow semver and move forward with all the core logic changes becoming Alamofire 3.0. We've also made some fairly significant changes that should give us more flexibility moving forward to help avoid the need for MAJOR version bumps to maintain backwards compatibility. - -## Benefits of Upgrading - -The benefits of upgrading can be summarized as follows: - -* No more casting a response serializer `error` from an `ErrorType` to an `NSError`. -* Original server data is now ALWAYS returned in all response serializers regardless of whether the result was a `.Success` or `.Failure`. -* Custom response serializers are now ALWAYS called regardless of whether an `error` occurred. -* Custom response serializers are now passed in the `error` allowing you to switch between different parsing schemes if necessary. -* Custom response serializers can now wrap up any Alamofire `NSError` into a `CustomError` type of your choosing. -* `Manager` initialization can now accept custom `NSURLSession` or `SessionDelegate` objects using dependency injection. - ---- - -## Breaking API Changes - -Alamofire 3.0 contains some breaking API changes to the foundational classes supporting the response serialization system. It is important to understand how these changes affect the common usage patterns. - -### Result Type - -The `Result` type was introduced in Alamofire 2.0 as a single generic parameter with the following signature: - -```swift -public enum Result { - case Success(Value) - case Failure(NSData?, ErrorType) -} -``` - -While this was a significant improvement on the behavior of Alamofire 1.0, there was still room for improvement. By defining the `.Failure` case to take an `ErrorType`, all consumers needed to cast the `ErrorType` to some concrete object such as an `NSError` before being able to interact with it. This was certainly not ideal. Additionally, by only allowing the `NSData?` from the server to be appended in a `.Failure` case, it was not possible to access the original server data in a `.Success` case. - -In Alamofire 3.0, the `Result` type has been redesigned to be a double generic type that does not store the `NSData?` in the `.Failure` case. - -```swift -public enum Result { - case Success(Value) - case Failure(Error) -} -``` - -These changes allow Alamofire to return the original server data in both cases. It also removes the requirement of having to cast the `ErrorType` when working with the `.Failure` case error object. - -### Response - -In order to avoid constantly having to change the response serializer completion closure signatures, Alamofire 3.0 introduces a `Response` struct. All response serializers (with the exception of `response`) return a generic `Response` struct. - -```swift -public struct Response { - /// The URL request sent to the server. - public let request: NSURLRequest? - - /// The server's response to the URL request. - public let response: NSHTTPURLResponse? - - /// The data returned by the server. - public let data: NSData? - - /// The result of response serialization. - public let result: Result -} -``` - -This unifies the signature of all response serializer completion closures by only needing to specify a single parameter rather than three or four. If another major release of Alamofire needs to modify the signature, thankfully the number of parameters in all response serializers will NOT need to change. Given the fact that the Swift compiler can present some fairly misleading compiler errors when the arguments are not correct, this should help alleviate some painful updates between MAJOR version bumps of Alamofire. - -### Response Serializers - -The biggest change in Alamofire 3.0 are the response serializers. They are now powered by the new `Response` struct and updated `Result` type. These two generic classes make it VERY easy to interact with the response serializers in a consistent, type-safe manner. - -```swift -Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) - .responseJSON { response in - debugPrint(response) // prints detailed description of all response properties - - print(response.request) // original URL request - print(response.response) // URL response - print(response.data) // server data - print(response.result) // result of response serialization - - if let JSON = response.result.value { - print("JSON: \(JSON)") - } - } -``` - -Besides the single response parameter in the completion closure, the other major callouts are that the original server data is always available whether the `Result` was a `.Success` or `.Failure`. Additionally, both the `value` and `error` of the `Result` type are strongly typed objects thanks to the power of generics. All default response serializer errors will be an `NSError` type. Custom response serializers can specify any custom `ErrorType`. - -#### Response Serializer Type - -For those wishing to create custom response serializer types, you'll need to familiarize yourself with the new `ResponseSerializerType` protocol and generic `ResponseSerializer` struct. - -```swift -public protocol ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializerType`. - typealias SerializedObject - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - typealias ErrorObject: ErrorType - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get } -} -``` - -All the possible information about the `Request` is now passed into the `serializeResponse` closure. In Alamofire 3.0, the `serializeResponse` closure is ALWAYS called whether an error occurred or not. This is for several reasons. - -1. Passing the error into the response serializer allows the implementation to switch parsing schemes based on what error occurred. For example, some APIs will return different payload schemas when certain errors occur. The new design allows you to switch on the error type and use different parsing logic. -2. Any error produced by Alamofire will always be an `NSError`. If your custom response serializer returns `CustomError` types, then the `NSError` returned by Alamofire must be converted into a `CustomError` type. This makes it MUCH easier to wrap Alamofire errors in your own `CustomError` type objects. - > This is also required for all the generics logic to work properly. - -### Validation Result - -The `ValidationResult` enumeration in Alamofire 3.0 has been updated to take an `NSError` in the `.Failure` case. The reasoning for this change is that all Alamofire errors generated need to be `NSError` types. If not, it introduces the need to cast all error objects coming from Alamofire at the response serializer level. - -```swift -public enum ValidationResult { - case Success - case Failure(NSError) -} -``` - -> If you are extending the `Request` type in any way that can produce an error, that error always needs to be of type `NSError`. If you'd like to wrap the error into a `CustomError` type, it should be wrapped in a custom response serializer implementation. - ---- - -## New Features - -### Dependency Injection - -Alamofire 3.0 leverages [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) to allow some powerful new customizations to take place for the URL session and delegate. - -#### Session Delegate - -In previous versions of Alamofire, the `SessionDelegate` was automatically created by the `Manager` instance. While this is convenient, it can be problematic for background sessions. One may need to hook up the task override closures before instantiating the URL session. Otherwise the URL session delegate could be called before the task override closures are able to be set. - -In Alamofire 3.0, the `Manager` initializer adds the ability to provide a custom `SessionDelegate` object with the task override closures already set using dependency injection. This greatly increases the flexibility of Alamofire in regards to background sessions. - -```swift -public init( - configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) -{ - self.delegate = delegate - self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) -} -``` - -#### URL Session - -Alamofire 3.0 also adds the ability to use dependency injection to provide a custom `NSURLSession` to the `Manager` instance. This provides complete control over the URL session initialization if you need it allowing `NSURLSession` subclasses for various kinds of testing and DVR implementations. - -```swift -public init?( - session: NSURLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) -{ - self.delegate = delegate - self.session = session - - guard delegate === session.delegate else { return nil } - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) -} -``` - -> We're very excited to see what the community comes up with given these new possibilities with Alamofire 3.0. diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard b/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard deleted file mode 100644 index 6f3cd58..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json b/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 6f870a4..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json b/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json deleted file mode 100644 index bd086a5..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "Logo.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "Logo@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png b/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png deleted file mode 100644 index 4060979..0000000 Binary files a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png b/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png deleted file mode 100644 index adbb083..0000000 Binary files a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist b/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist deleted file mode 100644 index 9f0225e..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Alamofire - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIMainStoryboardFile - Main - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift b/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift deleted file mode 100644 index 4690d4b..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift +++ /dev/null @@ -1,61 +0,0 @@ -// AppDelegate.swift -// -// Copyright (c) 2014–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 UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { - - var window: UIWindow? - - // MARK: - UIApplicationDelegate - - func application( - application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) - -> Bool - { - let splitViewController = window!.rootViewController as! UISplitViewController - let navigationController = splitViewController.viewControllers.last as! UINavigationController - navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() - splitViewController.delegate = self - - return true - } - - // MARK: - UISplitViewControllerDelegate - - func splitViewController( - splitViewController: UISplitViewController, - collapseSecondaryViewController secondaryViewController: UIViewController, - ontoPrimaryViewController primaryViewController: UIViewController) - -> Bool - { - if let secondaryAsNavController = secondaryViewController as? UINavigationController { - if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { - return topAsDetailController.request == nil - } - } - - return false - } -} diff --git a/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift b/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift deleted file mode 100644 index 47bf0b3..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift +++ /dev/null @@ -1,204 +0,0 @@ -// DetailViewController.swift -// -// Copyright (c) 2014–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 Alamofire -import UIKit - -class DetailViewController: UITableViewController { - enum Sections: Int { - case Headers, Body - } - - var request: Alamofire.Request? { - didSet { - oldValue?.cancel() - - title = request?.description - refreshControl?.endRefreshing() - headers.removeAll() - body = nil - elapsedTime = nil - } - } - - var headers: [String: String] = [:] - var body: String? - var elapsedTime: NSTimeInterval? - var segueIdentifier: String? - - static let numberFormatter: NSNumberFormatter = { - let formatter = NSNumberFormatter() - formatter.numberStyle = .DecimalStyle - return formatter - }() - - // MARK: View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - refreshControl?.addTarget(self, action: "refresh", forControlEvents: .ValueChanged) - - } - - override func viewDidAppear(animated: Bool) { - super.viewDidAppear(animated) - - refresh() - } - - // MARK: IBActions - - @IBAction func refresh() { - guard let request = request else { - return - } - - refreshControl?.beginRefreshing() - - let start = CACurrentMediaTime() - request.responseString { response in - let end = CACurrentMediaTime() - self.elapsedTime = end - start - - if let response = response.response { - for (field, value) in response.allHeaderFields { - self.headers["\(field)"] = "\(value)" - } - } - - if let segueIdentifier = self.segueIdentifier { - switch segueIdentifier { - case "GET", "POST", "PUT", "DELETE": - self.body = response.result.value - case "DOWNLOAD": - self.body = self.downloadedBodyString() - default: - break - } - } - - self.tableView.reloadData() - self.refreshControl?.endRefreshing() - } - } - - private func downloadedBodyString() -> String { - let fileManager = NSFileManager.defaultManager() - let cachesDirectory = fileManager.URLsForDirectory(.CachesDirectory, inDomains: .UserDomainMask)[0] - - do { - let contents = try fileManager.contentsOfDirectoryAtURL( - cachesDirectory, - includingPropertiesForKeys: nil, - options: .SkipsHiddenFiles - ) - - if let - fileURL = contents.first, - data = NSData(contentsOfURL: fileURL) - { - let json = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions()) - let prettyData = try NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted) - - if let prettyString = NSString(data: prettyData, encoding: NSUTF8StringEncoding) as? String { - try fileManager.removeItemAtURL(fileURL) - return prettyString - } - } - } catch { - // No-op - } - - return "" - } -} - -// MARK: - UITableViewDataSource - -extension DetailViewController { - override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - switch Sections(rawValue: section)! { - case .Headers: - return headers.count - case .Body: - return body == nil ? 0 : 1 - } - } - - override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { - switch Sections(rawValue: indexPath.section)! { - case .Headers: - let cell = tableView.dequeueReusableCellWithIdentifier("Header")! - let field = headers.keys.sort(<)[indexPath.row] - let value = headers[field] - - cell.textLabel?.text = field - cell.detailTextLabel?.text = value - - return cell - case .Body: - let cell = tableView.dequeueReusableCellWithIdentifier("Body")! - cell.textLabel?.text = body - - return cell - } - } -} - -// MARK: - UITableViewDelegate - -extension DetailViewController { - override func numberOfSectionsInTableView(tableView: UITableView) -> Int { - return 2 - } - - override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if self.tableView(tableView, numberOfRowsInSection: section) == 0 { - return "" - } - - switch Sections(rawValue: section)! { - case .Headers: - return "Headers" - case .Body: - return "Body" - } - } - - override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { - switch Sections(rawValue: indexPath.section)! { - case .Body: - return 300 - default: - return tableView.rowHeight - } - } - - override func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? { - if Sections(rawValue: section) == .Body, let elapsedTime = elapsedTime { - let elapsedTimeText = DetailViewController.numberFormatter.stringFromNumber(elapsedTime) ?? "???" - return "Elapsed Time: \(elapsedTimeText) sec" - } - - return "" - } -} diff --git a/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift b/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift deleted file mode 100644 index 5a69799..0000000 --- a/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift +++ /dev/null @@ -1,95 +0,0 @@ -// MasterViewController.swift -// -// Copyright (c) 2014–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 Alamofire -import UIKit - -class MasterViewController: UITableViewController { - - @IBOutlet weak var titleImageView: UIImageView! - - var detailViewController: DetailViewController? = nil - var objects = NSMutableArray() - - // MARK: - View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - - navigationItem.titleView = titleImageView - } - - override func viewDidLoad() { - super.viewDidLoad() - - if let split = splitViewController { - let controllers = split.viewControllers - - if let - navigationController = controllers.last as? UINavigationController, - topViewController = navigationController.topViewController as? DetailViewController - { - detailViewController = topViewController - } - } - } - - // MARK: - UIStoryboardSegue - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - if let - navigationController = segue.destinationViewController as? UINavigationController, - detailViewController = navigationController.topViewController as? DetailViewController - { - func requestForSegue(segue: UIStoryboardSegue) -> Request? { - switch segue.identifier! { - case "GET": - detailViewController.segueIdentifier = "GET" - return Alamofire.request(.GET, "https://httpbin.org/get") - case "POST": - detailViewController.segueIdentifier = "POST" - return Alamofire.request(.POST, "https://httpbin.org/post") - case "PUT": - detailViewController.segueIdentifier = "PUT" - return Alamofire.request(.PUT, "https://httpbin.org/put") - case "DELETE": - detailViewController.segueIdentifier = "DELETE" - return Alamofire.request(.DELETE, "https://httpbin.org/delete") - case "DOWNLOAD": - detailViewController.segueIdentifier = "DOWNLOAD" - let destination = Alamofire.Request.suggestedDownloadDestination( - directory: .CachesDirectory, - domain: .UserDomainMask - ) - return Alamofire.download(.GET, "https://httpbin.org/stream/1", destination: destination) - default: - return nil - } - } - - if let request = requestForSegue(segue) { - detailViewController.request = request - } - } - } -} - diff --git a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj deleted file mode 100644 index 083ae51..0000000 --- a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj +++ /dev/null @@ -1,468 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 31E476821C55DE6D00968569 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31E4766A1C55DD5900968569 /* Alamofire.framework */; }; - 31E476831C55DE6D00968569 /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 31E4766A1C55DD5900968569 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4C6D2C801C67EFE100846168 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */; }; - 4C6D2C811C67EFE100846168 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */; }; - 4C6D2C821C67EFE100846168 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */; }; - 4C6D2C8F1C67EFEC00846168 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */; }; - 4C6D2C981C67F03B00846168 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D2C961C67F03B00846168 /* Main.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 31E476691C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 31E4766B1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = "Alamofire iOS Tests"; - }; - 31E4766D1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 31E4766F1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 31E476711C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - 31E476731C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - 31E476751C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 31E476841C55DE6D00968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - F818D0E519CA8D15006034B1 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 31E476831C55DE6D00968569 /* Alamofire.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = ../Alamofire.xcodeproj; sourceTree = ""; }; - 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Source/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DetailViewController.swift; path = Source/DetailViewController.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MasterViewController.swift; path = Source/MasterViewController.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Resources/Images.xcassets; sourceTree = SOURCE_ROOT; }; - 4C6D2C8D1C67EFEC00846168 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = SOURCE_ROOT; }; - 4C6D2C971C67F03B00846168 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = ""; }; - F8111E0519A951050040E7D1 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F8111E0219A951050040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 31E476821C55DE6D00968569 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 31E476601C55DD5900968569 /* Products */ = { - isa = PBXGroup; - children = ( - 31E4766A1C55DD5900968569 /* Alamofire.framework */, - 31E4766C1C55DD5900968569 /* Alamofire iOS Tests.xctest */, - 31E4766E1C55DD5900968569 /* Alamofire.framework */, - 31E476701C55DD5900968569 /* Alamofire OSX Tests.xctest */, - 31E476721C55DD5900968569 /* Alamofire.framework */, - 31E476741C55DD5900968569 /* Alamofire tvOS Tests.xctest */, - 31E476761C55DD5900968569 /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; - 4C6D2C951C67F03B00846168 /* Base.lproj */ = { - isa = PBXGroup; - children = ( - 4C6D2C961C67F03B00846168 /* Main.storyboard */, - ); - name = Base.lproj; - path = Resources/Base.lproj; - sourceTree = SOURCE_ROOT; - }; - F8111DFC19A951050040E7D1 = { - isa = PBXGroup; - children = ( - F8111E0719A951050040E7D1 /* Source */, - F8111E0619A951050040E7D1 /* Products */, - 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */, - ); - sourceTree = ""; - }; - F8111E0619A951050040E7D1 /* Products */ = { - isa = PBXGroup; - children = ( - F8111E0519A951050040E7D1 /* iOS Example.app */, - ); - name = Products; - sourceTree = ""; - }; - F8111E0719A951050040E7D1 /* Source */ = { - isa = PBXGroup; - children = ( - 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */, - 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */, - 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */, - F8111E0819A951050040E7D1 /* Supporting Files */, - ); - name = Source; - path = Example; - sourceTree = ""; - }; - F8111E0819A951050040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 4C6D2C8D1C67EFEC00846168 /* Info.plist */, - 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */, - 4C6D2C951C67F03B00846168 /* Base.lproj */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - F8111E0419A951050040E7D1 /* iOS Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */; - buildPhases = ( - F8111E0119A951050040E7D1 /* Sources */, - F8111E0219A951050040E7D1 /* Frameworks */, - F8111E0319A951050040E7D1 /* Resources */, - F818D0E519CA8D15006034B1 /* Copy Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 31E476851C55DE6D00968569 /* PBXTargetDependency */, - ); - name = "iOS Example"; - productName = Alamofire; - productReference = F8111E0519A951050040E7D1 /* iOS Example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F8111DFD19A951050040E7D1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - F8111E0419A951050040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - }; - }; - buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = F8111DFC19A951050040E7D1; - productRefGroup = F8111E0619A951050040E7D1 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 31E476601C55DD5900968569 /* Products */; - ProjectRef = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - F8111E0419A951050040E7D1 /* iOS Example */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 31E4766A1C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476691C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E4766C1C55DD5900968569 /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = 31E4766B1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E4766E1C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E4766D1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476701C55DD5900968569 /* Alamofire OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire OSX Tests.xctest"; - remoteRef = 31E4766F1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476721C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476711C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476741C55DD5900968569 /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = 31E476731C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476761C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476751C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - F8111E0319A951050040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C6D2C8F1C67EFEC00846168 /* Images.xcassets in Resources */, - 4C6D2C981C67F03B00846168 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F8111E0119A951050040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C6D2C801C67EFE100846168 /* AppDelegate.swift in Sources */, - 4C6D2C821C67EFE100846168 /* MasterViewController.swift in Sources */, - 4C6D2C811C67EFE100846168 /* DetailViewController.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 31E476851C55DE6D00968569 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire iOS"; - targetProxy = 31E476841C55DE6D00968569 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 4C6D2C961C67F03B00846168 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 4C6D2C971C67F03B00846168 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - F8111E2119A951050040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - F8111E2219A951050040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F8111E2419A951050040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = Resources/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "iOS Example"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - F8111E2519A951050040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = Resources/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "iOS Example"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E2119A951050040E7D1 /* Debug */, - F8111E2219A951050040E7D1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E2419A951050040E7D1 /* Debug */, - F8111E2519A951050040E7D1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F8111DFD19A951050040E7D1 /* Project object */; -} diff --git a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bfe77a2..0000000 --- a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme deleted file mode 100644 index ea36dc5..0000000 --- a/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/Alamofire/LICENSE b/Carthage/Checkouts/Alamofire/LICENSE deleted file mode 100644 index bf300e4..0000000 --- a/Carthage/Checkouts/Alamofire/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014–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. diff --git a/Carthage/Checkouts/Alamofire/Package.swift b/Carthage/Checkouts/Alamofire/Package.swift deleted file mode 100644 index c6088ba..0000000 --- a/Carthage/Checkouts/Alamofire/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Package.swift -// -// Copyright (c) 2014–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 PackageDescription - -let package = Package( - name: "Alamofire" -) diff --git a/Carthage/Checkouts/Alamofire/README.md b/Carthage/Checkouts/Alamofire/README.md deleted file mode 100644 index 0905d05..0000000 --- a/Carthage/Checkouts/Alamofire/README.md +++ /dev/null @@ -1,1195 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg)](https://travis-ci.org/Alamofire/Alamofire) -[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) - -Alamofire is an HTTP networking library written in Swift. - -## Features - -- [x] Chainable Request / Response methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download using Request or Resume data -- [x] Authentication with NSURLCredential -- [x] HTTP Response Validation -- [x] TLS Certificate and Public Key Pinning -- [x] Progress Closure & NSProgress -- [x] cURL Debug Output -- [x] Comprehensive Unit Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Requirements - -- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 7.2+ - -## Migration Guides - -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).** -> -> Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Alamofire ecosystem. - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -use_frameworks! - -pod 'Alamofire', '~> 3.0' -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### 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 Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 3.0 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Manually - -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - -```bash -$ git init -``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - -```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`. - -- And that's it! - -> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -### Response Handling - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .responseJSON { response in - print(response.request) // original URL request - print(response.response) // URL response - print(response.data) // server data - print(response.result) // result of response serialization - - if let JSON = response.result.value { - print("JSON: \(JSON)") - } - } -``` - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler. - -### Response Serialization - -**Built-in Response Methods** - -- `response()` -- `responseData()` -- `responseString(encoding: NSStringEncoding)` -- `responseJSON(options: NSJSONReadingOptions)` -- `responsePropertyList(options: NSPropertyListReadOptions)` - -#### Response Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .response { request, response, data, error in - print(request) - print(response) - print(data) - print(error) - } -``` - -> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .responseData { response in - print(response.request) - print(response.response) - print(response.result) - } -``` - -#### Response String Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") - } -``` - -#### Response JSON Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseJSON { response in - debugPrint(response) - } -``` - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -### HTTP Methods - -`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} -``` - -These values can be passed as the first argument of the `Alamofire.request` method: - -```swift -Alamofire.request(.POST, "https://httpbin.org/post") - -Alamofire.request(.PUT, "https://httpbin.org/put") - -Alamofire.request(.DELETE, "https://httpbin.org/delete") -``` - -### Parameters - -#### GET Request With URL-Encoded Parameters - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) -// https://httpbin.org/get?foo=bar -``` - -#### POST Request With URL-Encoded Parameters - -```swift -let parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters) -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -### Parameter Encoding - -Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum: - -```swift -enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(format: NSPropertyListFormat, options: NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - func encode(request: NSURLRequest, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?) - { ... } -} -``` - -- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._ -- `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same implementation as the `.URL` case, but always applies the encoded result to the URL. -- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. -- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters. - -#### Manual Parameter Encoding of an NSURLRequest - -```swift -let URL = NSURL(string: "https://httpbin.org/get")! -var request = NSMutableURLRequest(URL: URL) - -let parameters = ["foo": "bar"] -let encoding = Alamofire.ParameterEncoding.URL -(request, _) = encoding.encode(request, parameters: parameters) -``` - -#### POST Request with JSON-encoded Parameters - -```swift -let parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON) -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -> For HTTP headers that do not change, it is recommended to set them on the `NSURLSessionConfiguration` so they are automatically applied to any `NSURLSessionTask` created by the underlying `NSURLSession`. - -```swift -let headers = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Content-Type": "application/x-www-form-urlencoded" -] - -Alamofire.request(.GET, "https://httpbin.org/get", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -### Caching - -Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache). - -### Uploading - -**Supported Upload Types** - -- File -- Data -- Stream -- MultipartFormData - -#### Uploading a File - -```swift -let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png") -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) -``` - -#### Uploading with Progress - -```swift -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) - .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in - print(totalBytesWritten) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes written on main queue: \(totalBytesWritten)") - } - } - .responseJSON { response in - debugPrint(response) - } -``` - -#### Uploading MultipartFormData - -```swift -Alamofire.upload( - .POST, - "https://httpbin.org/post", - multipartFormData: { multipartFormData in - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - }, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .Failure(let encodingError): - print(encodingError) - } - } -) -``` - -### Downloading - -**Supported Download Types** - -- Request -- Resume Data - -#### Downloading a File - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100") { temporaryURL, response in - let fileManager = NSFileManager.defaultManager() - let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] - let pathComponent = response.suggestedFilename - - return directoryURL.URLByAppendingPathComponent(pathComponent!) -} -``` - -#### Using the Default Download Destination - -```swift -let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask) -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -``` - -#### Downloading a File w/Progress - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - print(totalBytesRead) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes read on main queue: \(totalBytesRead)") - } - } - .response { _, _, _, error in - if let error = error { - print("Failed with error: \(error)") - } else { - print("Downloaded file successfully") - } - } -``` - -#### Accessing Resume Data for Failed Downloads - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .response { _, _, data, _ in - if let - data = data, - resumeDataString = NSString(data: data, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } - } -``` - -> The `data` parameter is automatically populated with the `resumeData` if available. - -```swift -let download = Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -download.response { _, _, _, _ in - if let - resumeData = download.resumeData, - resumeDataString = NSString(data: resumeData, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } -} -``` - -### Authentication - -Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide an `NSURLCredential` to an `NSURLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)! -let base64Credentials = credentialData.base64EncodedStringWithOptions([]) - -let headers = ["Authorization": "Basic \(base64Credentials)"] - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with NSURLCredential - -```swift -let user = "user" -let password = "password" - -let credential = NSURLCredential(user: user, password: password, persistence: .ForSession) - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -### Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .response { response in - print(response) - } -``` - -#### Automatic Validation - -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - switch response.result { - case .Success: - print("Validation Successful") - case .Failure(let error): - print(error) - } - } -``` - -### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - print(response.timeline) - } -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -### Printable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -### DebugPrintable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - -debugPrint(request) -``` - -#### Output (cURL) - -```bash -$ curl -i \ - -H "User-Agent: Alamofire" \ - -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of -this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession) -- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache) -- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html) - -### Manager - -Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -```swift -let manager = Alamofire.Manager.sharedInstance -manager.request(NSURLRequest(URL: NSURL(string: "https://httpbin.org/get")!)) -``` - -Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Manager with Default Configuration - -```swift -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Background Configuration - -```swift -let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.example.app.background") -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Ephemeral Configuration - -```swift -let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Modifying Session Configuration - -```swift -var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:] -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -configuration.HTTPAdditionalHeaders = defaultHeaders - -let manager = Alamofire.Manager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Request - -The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly. - -Methods like `authenticate`, `validate` and `responseData` return the caller in order to facilitate chaining. - -Requests can be suspended, resumed, and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Response Serialization - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension Request { - public static func XMLResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - guard let validData = data else { - let failureReason = "Data could not be serialized. Input data was nil." - let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let XML = try ONOXMLDocument(data: validData) - return .Success(XML) - } catch { - return .Failure(error as NSError) - } - } - } - - public func responseXMLDocument(completionHandler: Response -> Void) -> Self { - return response(responseSerializer: Request.XMLResponseSerializer(), completionHandler: completionHandler) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -public protocol ResponseObjectSerializable { - init?(response: NSHTTPURLResponse, representation: AnyObject) -} - -extension Request { - public func responseObject(completionHandler: Response -> Void) -> Self { - let responseSerializer = ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONResponseSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let - response = response, - responseObject = T(response: response, representation: value) - { - return .Success(responseObject) - } else { - let failureReason = "JSON could not be serialized into response object: \(value)" - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - case .Failure(let error): - return .Failure(error) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } -} -``` - -```swift -Alamofire.request(.GET, "https://example.com/users/mattt") - .responseObject { (response: Response) in - debugPrint(response) - } -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -public protocol ResponseCollectionSerializable { - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] -} - -extension Alamofire.Request { - public func responseCollection(completionHandler: Response<[T], NSError> -> Void) -> Self { - let responseSerializer = ResponseSerializer<[T], NSError> { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let response = response { - return .Success(T.collection(response: response, representation: value)) - } else { - let failureReason = "Response collection could not be serialized due to nil response" - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - case .Failure(let error): - return .Failure(error) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable, ResponseCollectionSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } - - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [User] { - var users: [User] = [] - - if let representation = representation as? [[String: AnyObject]] { - for userRepresentation in representation { - if let user = User(response: response, representation: userRepresentation) { - users.append(user) - } - } - } - - return users - } -} -``` - -```swift -Alamofire.request(.GET, "http://example.com/users") - .responseCollection { (response: Response<[User], NSError>) in - debugPrint(response) - } -``` - -### URLStringConvertible - -Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods: - -```swift -let string = NSString(string: "https://httpbin.org/post") -Alamofire.request(.POST, string) - -let URL = NSURL(string: string)! -Alamofire.request(.POST, URL) - -let URLRequest = NSURLRequest(URL: URL) -Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest` - -let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true) -Alamofire.request(.POST, URLComponents) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources. - -#### Type-Safe Routing - -```swift -extension User: URLStringConvertible { - static let baseURLString = "http://example.com" - - var URLString: String { - return User.baseURLString + "/users/\(username)/" - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(.GET, user) // http://example.com/users/mattt -``` - -### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let URL = NSURL(string: "https://httpbin.org/post")! -let mutableURLRequest = NSMutableURLRequest(URL: URL) -mutableURLRequest.HTTPMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - mutableURLRequest.HTTPBody = try NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions()) -} catch { - // No-op -} - -mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(mutableURLRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -#### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static let perPage = 50 - - case Search(query: String, page: Int) - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let result: (path: String, parameters: [String: AnyObject]) = { - switch self { - case .Search(let query, let page) where page > 1: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case .Search(let query, _): - return ("/search", ["q": query]) - } - }() - - let URL = NSURL(string: Router.baseURLString)! - let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(result.path)) - let encoding = Alamofire.ParameterEncoding.URL - - return encoding.encode(URLRequest, parameters: result.parameters).0 - } -} -``` - -```swift -Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo%20bar&offset=50 -``` - -#### CRUD & Authorization - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static var OAuthToken: String? - - case CreateUser([String: AnyObject]) - case ReadUser(String) - case UpdateUser(String, [String: AnyObject]) - case DestroyUser(String) - - var method: Alamofire.Method { - switch self { - case .CreateUser: - return .POST - case .ReadUser: - return .GET - case .UpdateUser: - return .PUT - case .DestroyUser: - return .DELETE - } - } - - var path: String { - switch self { - case .CreateUser: - return "/users" - case .ReadUser(let username): - return "/users/\(username)" - case .UpdateUser(let username, _): - return "/users/\(username)" - case .DestroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let URL = NSURL(string: Router.baseURLString)! - let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path)) - mutableURLRequest.HTTPMethod = method.rawValue - - if let token = Router.OAuthToken { - mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") - } - - switch self { - case .CreateUser(let parameters): - return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0 - case .UpdateUser(_, let parameters): - return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 - default: - return mutableURLRequest - } - } -} -``` - -```swift -Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt -``` - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `PerformDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `PinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `PinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `DisableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `CustomEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .DisableEvaluation -] - -let manager = Manager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `Manager` instance, otherwise your requests will all get cancelled when your `manager` is deallocated. - -These server trust policies will result in the following behavior: - -* `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - * Certificate chain MUST be valid. - * Certificate chain MUST include one of the pinned certificates. - * Challenge host MUST match the host in the certificate chain's leaf certificate. -* `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -* All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.PerformDefaultEvaluation`, `.PinCertificates` and `.PinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certficates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. - -There are some important things to remember when using network reachability to determine what to do next. - -* **Do NOT** use Reachability to determine if a network request should be sent. - * You should **ALWAYS** send it. -* When Reachability is restored, use the event to retry failed network requests. - * Even though the network requests may still fail, this is a good moment to retry them. -* The network reachability status can be useful for determining why a network request may have failed. - * If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical errror, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -* [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. - -## Open Rdars - -The following rdars have some affect on the current implementation of Alamofire. - -* [rdar://21349340](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## License - -Alamofire is released under the MIT license. See LICENSE for details. diff --git a/Carthage/Checkouts/Alamofire/Source/Alamofire.h b/Carthage/Checkouts/Alamofire/Source/Alamofire.h deleted file mode 100644 index c27948a..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Alamofire.h +++ /dev/null @@ -1,26 +0,0 @@ -// Alamofire.h -// -// Copyright (c) 2014–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 Foundation; - -FOUNDATION_EXPORT double AlamofireVersionNumber; -FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; diff --git a/Carthage/Checkouts/Alamofire/Source/Alamofire.swift b/Carthage/Checkouts/Alamofire/Source/Alamofire.swift deleted file mode 100644 index b866f42..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,368 +0,0 @@ -// Alamofire.swift -// -// Copyright (c) 2014–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 Foundation - -// MARK: - URLStringConvertible - -/** - Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to - construct URL requests. -*/ -public protocol URLStringConvertible { - /** - A URL that conforms to RFC 2396. - - Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808. - - See https://tools.ietf.org/html/rfc2396 - See https://tools.ietf.org/html/rfc1738 - See https://tools.ietf.org/html/rfc1808 - */ - var URLString: String { get } -} - -extension String: URLStringConvertible { - public var URLString: String { - return self - } -} - -extension NSURL: URLStringConvertible { - public var URLString: String { - return absoluteString - } -} - -extension NSURLComponents: URLStringConvertible { - public var URLString: String { - return URL!.URLString - } -} - -extension NSURLRequest: URLStringConvertible { - public var URLString: String { - return URL!.URLString - } -} - -// MARK: - URLRequestConvertible - -/** - Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -*/ -public protocol URLRequestConvertible { - /// The URL request. - var URLRequest: NSMutableURLRequest { get } -} - -extension NSURLRequest: URLRequestConvertible { - public var URLRequest: NSMutableURLRequest { - return self.mutableCopy() as! NSMutableURLRequest - } -} - -// MARK: - Convenience - -func URLRequest( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil) - -> NSMutableURLRequest -{ - let mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URLString.URLString)!) - mutableURLRequest.HTTPMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - mutableURLRequest.setValue(headerValue, forHTTPHeaderField: headerField) - } - } - - return mutableURLRequest -} - -// MARK: - Request Methods - -/** - Creates a request using the shared manager instance for the specified method, URL string, parameters, and - parameter encoding. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. -*/ -public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request -{ - return Manager.sharedInstance.request( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/** - Creates a request using the shared manager instance for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. -*/ -public func request(URLRequest: URLRequestConvertible) -> Request { - return Manager.sharedInstance.request(URLRequest.URLRequest) -} - -// MARK: - Upload Methods - -// MARK: File - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and file. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and file. - - - parameter URLRequest: The URL request. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return Manager.sharedInstance.upload(URLRequest, file: file) -} - -// MARK: Data - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and data. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and data. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return Manager.sharedInstance.upload(URLRequest, data: data) -} - -// MARK: Stream - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and stream. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and stream. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return Manager.sharedInstance.upload(URLRequest, stream: stream) -} - -// MARK: MultipartFormData - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) -{ - return Manager.sharedInstance.upload( - method, - URLString, - headers: headers, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) -{ - return Manager.sharedInstance.upload( - URLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -// MARK: - Download Methods - -// MARK: URL Request - -/** - Creates a download request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request -{ - return Manager.sharedInstance.download( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers, - destination: destination - ) -} - -/** - Creates a download request using the shared manager instance for the specified URL request. - - - parameter URLRequest: The URL request. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(URLRequest, destination: destination) -} - -// MARK: Resume Data - -/** - Creates a request using the shared manager instance for downloading from the resume data produced from a - previous request cancellation. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional - information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(data, destination: destination) -} diff --git a/Carthage/Checkouts/Alamofire/Source/Download.swift b/Carthage/Checkouts/Alamofire/Source/Download.swift deleted file mode 100644 index 2ebe40f..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Download.swift +++ /dev/null @@ -1,246 +0,0 @@ -// Download.swift -// -// Copyright (c) 2014–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 Foundation - -extension Manager { - private enum Downloadable { - case Request(NSURLRequest) - case ResumeData(NSData) - } - - private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request { - var downloadTask: NSURLSessionDownloadTask! - - switch downloadable { - case .Request(let request): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithRequest(request) - } - case .ResumeData(let resumeData): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithResumeData(resumeData) - } - } - - let request = Request(session: session, task: downloadTask) - - if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate { - downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in - return destination(URL, downloadTask.response as! NSHTTPURLResponse) - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: Request - - /** - Creates a download request for the specified method, URL string, parameters, parameter encoding, headers - and destination. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - - return download(encodedURLRequest, destination: destination) - } - - /** - Creates a request for downloading from the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return download(.Request(URLRequest.URLRequest), destination: destination) - } - - // MARK: Resume Data - - /** - Creates a request for downloading from the resume data produced from a previous request cancellation. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for - additional information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request { - return download(.ResumeData(resumeData), destination: destination) - } -} - -// MARK: - - -extension Request { - /** - A closure executed once a request has successfully completed in order to determine where to move the temporary - file written to during the download process. The closure takes two arguments: the temporary file URL and the URL - response, and returns a single argument: the file URL where the temporary file should be moved. - */ - public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL - - /** - Creates a download file destination closure which uses the default file manager to move the temporary file to a - file URL in the first available directory with the specified search path directory and search path domain mask. - - - parameter directory: The search path directory. `.DocumentDirectory` by default. - - parameter domain: The search path domain mask. `.UserDomainMask` by default. - - - returns: A download file destination closure. - */ - public class func suggestedDownloadDestination( - directory directory: NSSearchPathDirectory = .DocumentDirectory, - domain: NSSearchPathDomainMask = .UserDomainMask) - -> DownloadFileDestination - { - return { temporaryURL, response -> NSURL in - let directoryURLs = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain) - - if !directoryURLs.isEmpty { - return directoryURLs[0].URLByAppendingPathComponent(response.suggestedFilename!) - } - - return temporaryURL - } - } - - /// The resume data of the underlying download task if available after a failure. - public var resumeData: NSData? { - var data: NSData? - - if let delegate = delegate as? DownloadTaskDelegate { - data = delegate.resumeData - } - - return data - } - - // MARK: - DownloadTaskDelegate - - class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate { - var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask } - var downloadProgress: ((Int64, Int64, Int64) -> Void)? - - var resumeData: NSData? - override var data: NSData? { return resumeData } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)? - var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - do { - let destination = downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - try NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination) - } catch { - self.error = error as NSError - } - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Error.swift b/Carthage/Checkouts/Alamofire/Source/Error.swift deleted file mode 100644 index 7a813f1..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Error.swift +++ /dev/null @@ -1,66 +0,0 @@ -// Error.swift -// -// Copyright (c) 2014–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 Foundation - -/// The `Error` struct provides a convenience for creating custom Alamofire NSErrors. -public struct Error { - /// The domain used for creating all Alamofire errors. - public static let Domain = "com.alamofire.error" - - /// The custom error codes generated by Alamofire. - public enum Code: Int { - case InputStreamReadFailed = -6000 - case OutputStreamWriteFailed = -6001 - case ContentTypeValidationFailed = -6002 - case StatusCodeValidationFailed = -6003 - case DataSerializationFailed = -6004 - case StringSerializationFailed = -6005 - case JSONSerializationFailed = -6006 - case PropertyListSerializationFailed = -6007 - } - - /** - Creates an `NSError` with the given error code and failure reason. - - - parameter code: The error code. - - parameter failureReason: The failure reason. - - - returns: An `NSError` with the given error code and failure reason. - */ - public static func errorWithCode(code: Code, failureReason: String) -> NSError { - return errorWithCode(code.rawValue, failureReason: failureReason) - } - - /** - Creates an `NSError` with the given error code and failure reason. - - - parameter code: The error code. - - parameter failureReason: The failure reason. - - - returns: An `NSError` with the given error code and failure reason. - */ - public static func errorWithCode(code: Int, failureReason: String) -> NSError { - let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] - return NSError(domain: Domain, code: code, userInfo: userInfo) - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist b/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist deleted file mode 100644 index 07bfcd5..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.2.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - UIRequiredDeviceCapabilities - - arm64 - - - diff --git a/Carthage/Checkouts/Alamofire/Source/Info.plist b/Carthage/Checkouts/Alamofire/Source/Info.plist deleted file mode 100644 index 340121d..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.2.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Carthage/Checkouts/Alamofire/Source/Manager.swift b/Carthage/Checkouts/Alamofire/Source/Manager.swift deleted file mode 100644 index b10045c..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Manager.swift +++ /dev/null @@ -1,695 +0,0 @@ -// Manager.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -*/ -public class Manager { - - // MARK: - Properties - - /** - A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly - for any ad hoc requests. - */ - public static let sharedInstance: Manager = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders - - return Manager(configuration: configuration) - }() - - /** - Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - */ - public static let defaultHTTPHeaders: [String: String] = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - let acceptLanguage = NSLocale.preferredLanguages().prefix(6).enumerate().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joinWithSeparator(", ") - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - let userAgent: String = { - if let info = NSBundle.mainBundle().infoDictionary { - let executable: AnyObject = info[kCFBundleExecutableKey as String] ?? "Unknown" - let bundle: AnyObject = info[kCFBundleIdentifierKey as String] ?? "Unknown" - let version: AnyObject = info[kCFBundleVersionKey as String] ?? "Unknown" - let os: AnyObject = NSProcessInfo.processInfo().operatingSystemVersionString ?? "Unknown" - - var mutableUserAgent = NSMutableString(string: "\(executable)/\(bundle) (\(version); OS \(os))") as CFMutableString - let transform = NSString(string: "Any-Latin; Latin-ASCII; [:^ASCII:] Remove") as CFString - - if CFStringTransform(mutableUserAgent, UnsafeMutablePointer(nil), transform, false) { - return mutableUserAgent as String - } - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL) - - /// The underlying session. - public let session: NSURLSession - - /// The session delegate handling all the task and session delegate callbacks. - public let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - public var startRequestsImmediately: Bool = true - - /** - The background completion handler closure provided by the UIApplicationDelegate - `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - will automatically call the handler. - - If you need to handle your own events before the handler is called, then you need to override the - SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - - `nil` by default. - */ - public var backgroundCompletionHandler: (() -> Void)? - - // MARK: - Lifecycle - - /** - Initializes the `Manager` instance with the specified configuration, delegate and server trust policy. - - - parameter configuration: The configuration used to construct the managed session. - `NSURLSessionConfiguration.defaultSessionConfiguration()` by default. - - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - default. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance. - */ - public init( - configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /** - Initializes the `Manager` instance with the specified session, delegate and server trust policy. - - - parameter session: The URL session. - - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance if the URL session's delegate matches the delegate parameter. - */ - public init?( - session: NSURLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = session - - guard delegate === session.delegate else { return nil } - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - dispatch_async(dispatch_get_main_queue()) { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Request - - /** - Creates a request for the specified method, URL string, parameters, parameter encoding and headers. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. - */ - public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - return request(encodedURLRequest) - } - - /** - Creates a request for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. - */ - public func request(URLRequest: URLRequestConvertible) -> Request { - var dataTask: NSURLSessionDataTask! - dispatch_sync(queue) { dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) } - - let request = Request(session: session, task: dataTask) - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: - SessionDelegate - - /** - Responsible for handling all delegate callbacks for the underlying session. - */ - public final class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate { - private var subdelegates: [Int: Request.TaskDelegate] = [:] - private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT) - - subscript(task: NSURLSessionTask) -> Request.TaskDelegate? { - get { - var subdelegate: Request.TaskDelegate? - dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] } - - return subdelegate - } - - set { - dispatch_barrier_async(subdelegateQueue) { self.subdelegates[task.taskIdentifier] = newValue } - } - } - - /** - Initializes the `SessionDelegate` instance. - - - returns: The new `SessionDelegate` instance. - */ - public override init() { - super.init() - } - - // MARK: - NSURLSessionDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didBecomeInvalidWithError:`. - public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`. - public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`. - public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the session has been invalidated. - - - parameter session: The session object that was invalidated. - - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - */ - public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /** - Requests credentials from the delegate in response to a session-level authentication request from the remote server. - - - parameter session: The session containing the task that requested authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - - /** - Tells the delegate that all messages enqueued for a session have been delivered. - - - parameter session: The session that no longer has any outstanding requests. - */ - public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`. - public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`. - public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`. - public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream!)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. - public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`. - public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the remote server requested an HTTP redirect. - - - parameter session: The session containing the task whose request resulted in a redirect. - - parameter task: The task whose request resulted in a redirect. - - parameter response: An object containing the server’s response to the original request. - - parameter request: A URL request object filled out with the new location. - - parameter completionHandler: A closure that your handler should call with either the value of the request - parameter, a modified URL request object, or NULL to refuse the redirect and - return the body of the redirect response. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: ((NSURLRequest?) -> Void)) - { - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /** - Requests credentials from the delegate in response to an authentication request from the remote server. - - - parameter session: The session containing the task whose request requires authentication. - - parameter task: The task whose request requires authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - completionHandler(taskDidReceiveChallenge(session, task, challenge)) - } else if let delegate = self[task] { - delegate.URLSession( - session, - task: task, - didReceiveChallenge: challenge, - completionHandler: completionHandler - ) - } else { - URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler) - } - } - - /** - Tells the delegate when a task requires a new request body stream to send to the remote server. - - - parameter session: The session containing the task that needs a new body stream. - - parameter task: The task that needs a new body stream. - - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) - { - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /** - Periodically informs the delegate of the progress of sending body content to the server. - - - parameter session: The session containing the data task. - - parameter task: The data task. - - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - - parameter totalBytesSent: The total number of bytes sent so far. - - parameter totalBytesExpectedToSend: The expected length of the body data. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task] as? Request.UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - - /** - Tells the delegate that the task finished transferring data. - - - parameter session: The session containing the task whose request finished transferring data. - - parameter task: The task whose request finished transferring data. - - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - */ - public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidComplete = taskDidComplete { - taskDidComplete(session, task, error) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, didCompleteWithError: error) - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidComplete, object: task) - - self[task] = nil - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`. - public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`. - public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`. - public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`. - public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse!)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the data task received the initial reply (headers) from the server. - - - parameter session: The session containing the data task that received an initial reply. - - parameter dataTask: The data task that received an initial reply. - - parameter response: A URL response object populated with headers. - - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - constant to indicate whether the transfer should continue as a data task or - should become a download task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: ((NSURLSessionResponseDisposition) -> Void)) - { - var disposition: NSURLSessionResponseDisposition = .Allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /** - Tells the delegate that the data task was changed to a download task. - - - parameter session: The session containing the task that was replaced by a download task. - - parameter dataTask: The data task that was replaced by a download task. - - parameter downloadTask: The new download task that replaced the data task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) - { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask) - self[downloadTask] = downloadDelegate - } - } - - /** - Tells the delegate that the data task has received some of the expected data. - - - parameter session: The session containing the data task that provided data. - - parameter dataTask: The data task that provided data. - - parameter data: A data object containing the transferred data. - */ - public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession(session, dataTask: dataTask, didReceiveData: data) - } - } - - /** - Asks the delegate whether the data (or upload) task should store the response in the cache. - - - parameter session: The session containing the data (or upload) task. - - parameter dataTask: The data (or upload) task. - - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - caching policy and the values of certain received headers, such as the Pragma - and Cache-Control headers. - - parameter completionHandler: A block that your handler must call, providing either the original proposed - response, a modified version of that response, or NULL to prevent caching the - response. If your delegate implements this method, it must call this completion - handler; otherwise, your app leaks memory. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: ((NSCachedURLResponse?) -> Void)) - { - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`. - public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`. - public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. - public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that a download task has finished downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that finished. - - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - open the file for reading or move it to a permanent location in your app’s sandbox - container directory before returning from this delegate method. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location) - } - } - - /** - Periodically informs the delegate about the download’s progress. - - - parameter session: The session containing the download task. - - parameter downloadTask: The download task. - - parameter bytesWritten: The number of bytes transferred since the last time this delegate - method was called. - - parameter totalBytesWritten: The total number of bytes transferred so far. - - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - header. If this header was not provided, the value is - `NSURLSessionTransferSizeUnknown`. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /** - Tells the delegate that the download task has resumed downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that resumed. See explanation in the discussion. - - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - existing content, then this value is zero. Otherwise, this value is an - integer representing the number of bytes on disk that do not need to be - retrieved again. - - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } - - // MARK: - NSURLSessionStreamDelegate - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - - // MARK: - NSObject - - public override func respondsToSelector(selector: Selector) -> Bool { - switch selector { - case "URLSession:didBecomeInvalidWithError:": - return sessionDidBecomeInvalidWithError != nil - case "URLSession:didReceiveChallenge:completionHandler:": - return sessionDidReceiveChallenge != nil - case "URLSessionDidFinishEventsForBackgroundURLSession:": - return sessionDidFinishEventsForBackgroundURLSession != nil - case "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:": - return taskWillPerformHTTPRedirection != nil - case "URLSession:dataTask:didReceiveResponse:completionHandler:": - return dataTaskDidReceiveResponse != nil - default: - return self.dynamicType.instancesRespondToSelector(selector) - } - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift b/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index 8c37f16..0000000 --- a/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,669 +0,0 @@ -// MultipartFormData.swift -// -// Copyright (c) 2014–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 Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(OSX) -import CoreServices -#endif - -/** - Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode - multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead - to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the - data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for - larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. - - For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well - and the w3 form documentation. - - - https://www.ietf.org/rfc/rfc2388.txt - - https://www.ietf.org/rfc/rfc2045.txt - - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -*/ -public class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let CRLF = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case Initial, Encapsulated, Final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(boundaryType boundaryType: BoundaryType, boundary: String) -> NSData { - let boundaryText: String - - switch boundaryType { - case .Initial: - boundaryText = "--\(boundary)\(EncodingCharacters.CRLF)" - case .Encapsulated: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)\(EncodingCharacters.CRLF)" - case .Final: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)--\(EncodingCharacters.CRLF)" - } - - return boundaryText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: [String: String] - let bodyStream: NSInputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: [String: String], bodyStream: NSInputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - public var contentType: String { return "multipart/form-data; boundary=\(boundary)" } - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: NSError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /** - Creates a multipart form data object. - - - returns: The multipart form data object. - */ - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /** - * The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - * information, please refer to the following article: - * - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - */ - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String) { - let headers = contentHeaders(name: name) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, mimeType: String) { - let headers = contentHeaders(name: name, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - system associated MIME type. - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String) { - if let - fileName = fileURL.lastPathComponent, - pathExtension = fileURL.pathExtension - { - let mimeType = mimeTypeForPathExtension(pathExtension) - appendBodyPart(fileURL: fileURL, name: name, fileName: fileName, mimeType: mimeType) - } else { - let failureReason = "Failed to extract the fileName of the provided URL: \(fileURL)" - setBodyPartError(Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason)) - } - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - - Content-Type: #{mimeType} (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.fileURL else { - let failureReason = "The file URL does not point to a file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - var isReachable = true - - if #available(OSX 10.10, *) { - isReachable = fileURL.checkPromisedItemIsReachableAndReturnError(nil) - } - - guard isReachable else { - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: "The file URL is not reachable: \(fileURL)") - setBodyPartError(error) - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - - guard let - path = fileURL.path - where NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory) && !isDirectory else - { - let failureReason = "The file URL is a directory, not a file: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - var bodyContentLength: UInt64? - - do { - if let - path = fileURL.path, - fileSize = try NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize] as? NSNumber - { - bodyContentLength = fileSize.unsignedLongLongValue - } - } catch { - // No-op - } - - guard let length = bodyContentLength else { - let failureReason = "Could not fetch attributes from the file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = NSInputStream(URL: fileURL) else { - let failureReason = "Failed to create an input stream from the file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorCannotOpenFile, failureReason: failureReason) - setBodyPartError(error) - return - } - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the stream and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - */ - public func appendBodyPart( - stream stream: NSInputStream, - length: UInt64, - name: String, - fileName: String, - mimeType: String) - { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part with the headers, stream and length and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - HTTP headers - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter headers: The HTTP headers for the body part. - */ - public func appendBodyPart(stream stream: NSInputStream, length: UInt64, headers: [String: String]) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /** - Encodes all the appended body parts into a single `NSData` object. - - It is important to note that this method will load all the appended body parts into memory all at the same - time. This method should only be used when the encoded data will have a small memory footprint. For large data - cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - - - throws: An `NSError` if encoding encounters an error. - - - returns: The encoded `NSData` if encoding is successful. - */ - public func encode() throws -> NSData { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - let encoded = NSMutableData() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encodeBodyPart(bodyPart) - encoded.appendData(encodedData) - } - - return encoded - } - - /** - Writes the appended body parts into the given file URL. - - This process is facilitated by reading and writing with input and output streams, respectively. Thus, - this approach is very memory efficient and should be used for large body part data. - - - parameter fileURL: The file URL to write the multipart form data into. - - - throws: An `NSError` if encoding encounters an error. - */ - public func writeEncodedDataToDisk(fileURL: NSURL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if let path = fileURL.path where NSFileManager.defaultManager().fileExistsAtPath(path) { - let failureReason = "A file already exists at the given file URL: \(fileURL)" - throw Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - } else if !fileURL.fileURL { - let failureReason = "The URL does not point to a valid file: \(fileURL)" - throw Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - } - - let outputStream: NSOutputStream - - if let possibleOutputStream = NSOutputStream(URL: fileURL, append: false) { - outputStream = possibleOutputStream - } else { - let failureReason = "Failed to create an output stream with the given URL: \(fileURL)" - throw Error.errorWithCode(NSURLErrorCannotOpenFile, failureReason: failureReason) - } - - outputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - outputStream.open() - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try writeBodyPart(bodyPart, toOutputStream: outputStream) - } - - outputStream.close() - outputStream.removeFromRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - } - - // MARK: - Private - Body Part Encoding - - private func encodeBodyPart(bodyPart: BodyPart) throws -> NSData { - let encoded = NSMutableData() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.appendData(initialData) - - let headerData = encodeHeaderDataForBodyPart(bodyPart) - encoded.appendData(headerData) - - let bodyStreamData = try encodeBodyStreamDataForBodyPart(bodyPart) - encoded.appendData(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.appendData(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaderDataForBodyPart(bodyPart: BodyPart) -> NSData { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.CRLF)" - } - headerText += EncodingCharacters.CRLF - - return headerText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - - private func encodeBodyStreamDataForBodyPart(bodyPart: BodyPart) throws -> NSData { - let inputStream = bodyPart.bodyStream - inputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - inputStream.open() - - var error: NSError? - let encoded = NSMutableData() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if inputStream.streamError != nil { - error = inputStream.streamError - break - } - - if bytesRead > 0 { - encoded.appendBytes(buffer, length: bytesRead) - } else if bytesRead < 0 { - let failureReason = "Failed to read from input stream: \(inputStream)" - error = Error.errorWithCode(.InputStreamReadFailed, failureReason: failureReason) - break - } else { - break - } - } - - inputStream.close() - inputStream.removeFromRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - - if let error = error { - throw error - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func writeBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - try writeInitialBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeHeaderDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeBodyStreamForBodyPart(bodyPart, toOutputStream: outputStream) - try writeFinalBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - } - - private func writeInitialBoundaryDataForBodyPart( - bodyPart: BodyPart, - toOutputStream outputStream: NSOutputStream) - throws - { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try writeData(initialData, toOutputStream: outputStream) - } - - private func writeHeaderDataForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let headerData = encodeHeaderDataForBodyPart(bodyPart) - return try writeData(headerData, toOutputStream: outputStream) - } - - private func writeBodyStreamForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let inputStream = bodyPart.bodyStream - inputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - inputStream.open() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw streamError - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0 { - if outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let streamError = outputStream.streamError { - throw streamError - } - - if bytesWritten < 0 { - let failureReason = "Failed to write to output stream: \(outputStream)" - throw Error.errorWithCode(.OutputStreamWriteFailed, failureReason: failureReason) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if let - id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension, nil)?.takeRetainedValue(), - contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() - { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(name name: String) -> [String: String] { - return ["Content-Disposition": "form-data; name=\"\(name)\""] - } - - private func contentHeaders(name name: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"", - "Content-Type": "\(mimeType)" - ] - } - - private func contentHeaders(name name: String, fileName: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"; filename=\"\(fileName)\"", - "Content-Type": "\(mimeType)" - ] - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(error: NSError) { - if bodyPartError == nil { - bodyPartError = error - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift b/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 63f97b6..0000000 --- a/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,239 +0,0 @@ -// NetworkReachabilityManager.swift -// -// Copyright (c) 2014–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. - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/** - The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and - WiFi network interfaces. - - Reachability can be used to determine background information about why a network operation failed, or to retry - network requests 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. -*/ -public class NetworkReachabilityManager { - /** - Defines the various states of network reachability. - - - Unknown: It is unknown whether the network is reachable. - - NotReachable: The network is not reachable. - - ReachableOnWWAN: The network is reachable over the WWAN connection. - - ReachableOnWiFi: The network is reachable over the WiFi connection. - */ - public enum NetworkReachabilityStatus { - case Unknown - case NotReachable - case Reachable(ConnectionType) - } - - /** - Defines the various connection types detected by reachability flags. - - - EthernetOrWiFi: The connection type is either over Ethernet or WiFi. - - WWAN: The connection type is a WWAN connection. - */ - public enum ConnectionType { - case EthernetOrWiFi - case WWAN - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = NetworkReachabilityStatus -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .Reachable(.WWAN) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .Reachable(.EthernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .Unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: dispatch_queue_t = dispatch_get_main_queue() - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /** - Creates a `NetworkReachabilityManager` instance with the specified host. - - - parameter host: The host used to evaluate network reachability. - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /** - Creates a `NetworkReachabilityManager` instance with the default socket address (`sockaddr_in6`). - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?() { - var address = sockaddr_in6() - address.sin6_len = UInt8(sizeofValue(address)) - address.sin6_family = sa_family_t(AF_INET6) - - guard let reachability = withUnsafePointer(&address, { - SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /** - Starts listening for changes in network reachability status. - - - returns: `true` if listening was started successfully, `false` otherwise. - */ - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque()) - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, - { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(COpaquePointer(info)).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - dispatch_async(listenerQueue) { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /** - Stops listening for changes in network reachability status. - */ - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.Reachable) else { return .NotReachable } - - var networkStatus: NetworkReachabilityStatus = .NotReachable - - if !flags.contains(.ConnectionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - - if flags.contains(.ConnectionOnDemand) || flags.contains(.ConnectionOnTraffic) { - if !flags.contains(.InterventionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - } - - #if os(iOS) - if flags.contains(.IsWWAN) { networkStatus = .Reachable(.WWAN) } - #endif - - return networkStatus - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/** - Returns whether the two network reachability status values are equal. - - - parameter lhs: The left-hand side value to compare. - - parameter rhs: The right-hand side value to compare. - - - returns: `true` if the two values are equal, `false` otherwise. -*/ -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool -{ - switch (lhs, rhs) { - case (.Unknown, .Unknown): - return true - case (.NotReachable, .NotReachable): - return true - case let (.Reachable(lhsConnectionType), .Reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/Carthage/Checkouts/Alamofire/Source/Notifications.swift b/Carthage/Checkouts/Alamofire/Source/Notifications.swift deleted file mode 100644 index 1c23540..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,45 +0,0 @@ -// Notifications.swift -// -// Copyright (c) 2014–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 Foundation - -/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload. -public struct Notifications { - /// Used as a namespace for all `NSURLSessionTask` related notifications. - public struct Task { - /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed - /// `NSURLSessionTask`. - public static let DidResume = "com.alamofire.notifications.task.didResume" - - /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the - /// suspended `NSURLSessionTask`. - public static let DidSuspend = "com.alamofire.notifications.task.didSuspend" - - /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the - /// cancelled `NSURLSessionTask`. - public static let DidCancel = "com.alamofire.notifications.task.didCancel" - - /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the - /// completed `NSURLSessionTask`. - public static let DidComplete = "com.alamofire.notifications.task.didComplete" - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift b/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index adf61c5..0000000 --- a/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,252 +0,0 @@ -// ParameterEncoding.swift -// -// Copyright (c) 2014–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 Foundation - -/** - HTTP method definitions. - - See https://tools.ietf.org/html/rfc7231#section-4.3 -*/ -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} - -// MARK: ParameterEncoding - -/** - Used to specify the way in which a set of parameters are applied to a URL request. - - - `URL`: Creates a query string to be set as or appended to any existing URL query for `GET`, `HEAD`, - and `DELETE` requests, or set as the body for requests with any other HTTP method. The - `Content-Type` HTTP header field of an encoded request with HTTP body is set to - `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification - for how to encode collection types, the convention of appending `[]` to the key for array - values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested - dictionary values (`foo[bar]=baz`). - - - `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same - implementation as the `.URL` case, but always applies the encoded result to the URL. - - - `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is - set as the body of the request. The `Content-Type` HTTP header field of an encoded request is - set to `application/json`. - - - `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, - according to the associated format and write options values, which is set as the body of the - request. The `Content-Type` HTTP header field of an encoded request is set to - `application/x-plist`. - - - `Custom`: Uses the associated closure value to construct a new request given an existing request and - parameters. -*/ -public enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - /** - Creates a URL request by encoding parameters and applying them onto an existing request. - - - parameter URLRequest: The request to have parameters applied - - parameter parameters: The parameters to apply - - - returns: A tuple containing the constructed request and the error that occurred during parameter encoding, - if any. - */ - public func encode( - URLRequest: URLRequestConvertible, - parameters: [String: AnyObject]?) - -> (NSMutableURLRequest, NSError?) - { - var mutableURLRequest = URLRequest.URLRequest - - guard let parameters = parameters else { return (mutableURLRequest, nil) } - - var encodingError: NSError? = nil - - switch self { - case .URL, .URLEncodedInURL: - func query(parameters: [String: AnyObject]) -> String { - var components: [(String, String)] = [] - - for key in parameters.keys.sort(<) { - let value = parameters[key]! - components += queryComponents(key, value) - } - - return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&") - } - - func encodesParametersInURL(method: Method) -> Bool { - switch self { - case .URLEncodedInURL: - return true - default: - break - } - - switch method { - case .GET, .HEAD, .DELETE: - return true - default: - return false - } - } - - if let method = Method(rawValue: mutableURLRequest.HTTPMethod) where encodesParametersInURL(method) { - if let - URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false) - where !parameters.isEmpty - { - let percentEncodedQuery = (URLComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - URLComponents.percentEncodedQuery = percentEncodedQuery - mutableURLRequest.URL = URLComponents.URL - } - } else { - if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { - mutableURLRequest.setValue( - "application/x-www-form-urlencoded; charset=utf-8", - forHTTPHeaderField: "Content-Type" - ) - } - - mutableURLRequest.HTTPBody = query(parameters).dataUsingEncoding( - NSUTF8StringEncoding, - allowLossyConversion: false - ) - } - case .JSON: - do { - let options = NSJSONWritingOptions() - let data = try NSJSONSerialization.dataWithJSONObject(parameters, options: options) - - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .PropertyList(let format, let options): - do { - let data = try NSPropertyListSerialization.dataWithPropertyList( - parameters, - format: format, - options: options - ) - mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .Custom(let closure): - (mutableURLRequest, encodingError) = closure(mutableURLRequest, parameters) - } - - return (mutableURLRequest, encodingError) - } - - /** - Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - - - parameter key: The key of the query component. - - parameter value: The value of the query component. - - - returns: The percent-escaped, URL encoded query string components. - */ - public func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: AnyObject] { - for (nestedKey, value) in dictionary { - components += queryComponents("\(key)[\(nestedKey)]", value) - } - } else if let array = value as? [AnyObject] { - for value in array { - components += queryComponents("\(key)[]", value) - } - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /** - 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. - - - parameter string: The string to be percent-escaped. - - - returns: The percent-escaped string. - */ - public func escape(string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet - allowedCharacterSet.removeCharactersInString(generalDelimitersToEncode + subDelimitersToEncode) - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinense characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, OSX 10.10, *) { - escaped = string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = index.advancedBy(batchSize, limit: string.endIndex) - let range = Range(start: startIndex, end: endIndex) - - let substring = string.substringWithRange(range) - - escaped += substring.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? substring - - index = endIndex - } - } - - return escaped - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Request.swift b/Carthage/Checkouts/Alamofire/Source/Request.swift deleted file mode 100644 index fa196a2..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Request.swift +++ /dev/null @@ -1,552 +0,0 @@ -// Request.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Responsible for sending a request and receiving the response and associated data from the server, as well as - managing its underlying `NSURLSessionTask`. -*/ -public class Request { - - // MARK: - Properties - - /// The delegate for the underlying task. - public let delegate: TaskDelegate - - /// The underlying task. - public var task: NSURLSessionTask { return delegate.task } - - /// The session belonging to the underlying task. - public let session: NSURLSession - - /// The request sent or to be sent to the server. - public var request: NSURLRequest? { return task.originalRequest } - - /// The response received from the server, if any. - public var response: NSHTTPURLResponse? { return task.response as? NSHTTPURLResponse } - - /// The progress of the request lifecycle. - public var progress: NSProgress { return delegate.progress } - - var startTime: CFAbsoluteTime? - var endTime: CFAbsoluteTime? - - // MARK: - Lifecycle - - init(session: NSURLSession, task: NSURLSessionTask) { - self.session = session - - switch task { - case is NSURLSessionUploadTask: - delegate = UploadTaskDelegate(task: task) - case is NSURLSessionDataTask: - delegate = DataTaskDelegate(task: task) - case is NSURLSessionDownloadTask: - delegate = DownloadTaskDelegate(task: task) - default: - delegate = TaskDelegate(task: task) - } - - delegate.queue.addOperationWithBlock { self.endTime = CFAbsoluteTimeGetCurrent() } - } - - // MARK: - Authentication - - /** - Associates an HTTP Basic credential with the request. - - - parameter user: The user. - - parameter password: The password. - - parameter persistence: The URL credential persistence. `.ForSession` by default. - - - returns: The request. - */ - public func authenticate( - user user: String, - password: String, - persistence: NSURLCredentialPersistence = .ForSession) - -> Self - { - let credential = NSURLCredential(user: user, password: password, persistence: persistence) - - return authenticate(usingCredential: credential) - } - - /** - Associates a specified credential with the request. - - - parameter credential: The credential. - - - returns: The request. - */ - public func authenticate(usingCredential credential: NSURLCredential) -> Self { - delegate.credential = credential - - return self - } - - // MARK: - Progress - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is written to or read - from the server. - - - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected - to write. - - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes - expected to read. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self { - if let uploadDelegate = delegate as? UploadTaskDelegate { - uploadDelegate.uploadProgress = closure - } else if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataProgress = closure - } else if let downloadDelegate = delegate as? DownloadTaskDelegate { - downloadDelegate.downloadProgress = closure - } - - return self - } - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - - This closure returns the bytes most recently received from the server, not including data from previous calls. - If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - also important to note that the `response` closure will be called with nil `responseData`. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func stream(closure: (NSData -> Void)? = nil) -> Self { - if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataStream = closure - } - - return self - } - - // MARK: - State - - /** - Resumes the request. - */ - public func resume() { - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task) - } - - /** - Suspends the request. - */ - public func suspend() { - task.suspend() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidSuspend, object: task) - } - - /** - Cancels the request. - */ - public func cancel() { - if let - downloadDelegate = delegate as? DownloadTaskDelegate, - downloadTask = downloadDelegate.downloadTask - { - downloadTask.cancelByProducingResumeData { data in - downloadDelegate.resumeData = data - } - } else { - task.cancel() - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidCancel, object: task) - } - - // MARK: - TaskDelegate - - /** - The task delegate is responsible for handling all delegate callbacks for the underlying task as well as - executing all operations attached to the serial operation queue upon task completion. - */ - public class TaskDelegate: NSObject { - - /// The serial operation queue used to execute all operations after the task completes. - public let queue: NSOperationQueue - - let task: NSURLSessionTask - let progress: NSProgress - - var data: NSData? { return nil } - var error: NSError? - - var initialResponseTime: CFAbsoluteTime? - var credential: NSURLCredential? - - init(task: NSURLSessionTask) { - self.task = task - self.progress = NSProgress(totalUnitCount: 0) - self.queue = { - let operationQueue = NSOperationQueue() - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.suspended = true - - if #available(OSX 10.10, *) { - operationQueue.qualityOfService = NSQualityOfService.Utility - } - - return operationQueue - }() - } - - deinit { - queue.cancelAllOperations() - queue.suspended = false - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)? - var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: ((NSURLRequest?) -> Void)) - { - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .CancelAuthenticationChallenge - } else { - credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) - - if credential != nil { - disposition = .UseCredential - } - } - } - - completionHandler(disposition, credential) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) - { - var bodyStream: NSInputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - self.error = error - - if let - downloadDelegate = self as? DownloadTaskDelegate, - userInfo = error.userInfo as? [String: AnyObject], - resumeData = userInfo[NSURLSessionDownloadTaskResumeData] as? NSData - { - downloadDelegate.resumeData = resumeData - } - } - - queue.suspended = false - } - } - } - - // MARK: - DataTaskDelegate - - class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate { - var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask } - - private var totalBytesReceived: Int64 = 0 - private var mutableData: NSMutableData - override var data: NSData? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - private var expectedContentLength: Int64? - private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)? - private var dataStream: ((data: NSData) -> Void)? - - override init(task: NSURLSessionTask) { - mutableData = NSMutableData() - super.init(task: task) - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: (NSURLSessionResponseDisposition -> Void)) - { - var disposition: NSURLSessionResponseDisposition = .Allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) - { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data: data) - } else { - mutableData.appendData(data) - } - - totalBytesReceived += data.length - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - dataProgress?( - bytesReceived: Int64(data.length), - totalBytesReceived: totalBytesReceived, - totalBytesExpectedToReceive: totalBytesExpected - ) - } - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: ((NSCachedURLResponse?) -> Void)) - { - var cachedResponse: NSCachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - - /** - The textual representation used when written to an output stream, which includes the HTTP method and URL, as - well as the response status code if a response has been received. - */ - public var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.HTTPMethod { - components.append(HTTPMethod) - } - - if let URLString = request?.URL?.absoluteString { - components.append(URLString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joinWithSeparator(" ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - func cURLRepresentation() -> String { - var components = ["$ curl -i"] - - guard let - request = self.request, - URL = request.URL, - host = URL.host - else { - return "$ curl command could not be created" - } - - if let HTTPMethod = request.HTTPMethod where HTTPMethod != "GET" { - components.append("-X \(HTTPMethod)") - } - - if let credentialStorage = self.session.configuration.URLCredentialStorage { - let protectionSpace = NSURLProtectionSpace( - host: host, - port: URL.port?.integerValue ?? 0, - `protocol`: URL.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.HTTPShouldSetCookies { - if let - cookieStorage = session.configuration.HTTPCookieStorage, - cookies = cookieStorage.cookiesForURL(URL) where !cookies.isEmpty - { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" } - components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"") - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields { - switch field { - case "Cookie": - continue - default: - components.append("-H \"\(field): \(value)\"") - } - } - } - - if let additionalHeaders = session.configuration.HTTPAdditionalHeaders { - for (field, value) in additionalHeaders { - switch field { - case "Cookie": - continue - default: - components.append("-H \"\(field): \(value)\"") - } - } - } - - if let - HTTPBodyData = request.HTTPBody, - HTTPBody = String(data: HTTPBodyData, encoding: NSUTF8StringEncoding) - { - let escapedBody = HTTPBody.stringByReplacingOccurrencesOfString("\"", withString: "\\\"") - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(URL.absoluteString)\"") - - return components.joinWithSeparator(" \\\n\t") - } - - /// The textual representation used when written to an output stream, in the form of a cURL command. - public var debugDescription: String { - return cURLRepresentation() - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Response.swift b/Carthage/Checkouts/Alamofire/Source/Response.swift deleted file mode 100644 index 153eda5..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Response.swift +++ /dev/null @@ -1,95 +0,0 @@ -// Response.swift -// -// Copyright (c) 2014–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 Foundation - -/// Used to store all response data returned from a completed `Request`. -public struct Response { - /// The URL request sent to the server. - public let request: NSURLRequest? - - /// The server's response to the URL request. - public let response: NSHTTPURLResponse? - - /// The data returned by the server. - public let data: NSData? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the `Request`. - public let timeline: Timeline - - /** - Initializes the `Response` instance with the specified URL request, URL response, server data and response - serialization result. - - - parameter request: The URL request sent to the server. - - parameter response: The server's response to the URL request. - - parameter data: The data returned by the server. - - parameter result: The result of response serialization. - - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - - - returns: the new `Response` instance. - */ - public init( - request: NSURLRequest?, - response: NSHTTPURLResponse?, - data: NSData?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - CustomStringConvertible - -extension Response: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } -} - -// MARK: - CustomDebugStringConvertible - -extension Response: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data and the response serialization result. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.length ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joinWithSeparator("\n") - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift b/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index e636072..0000000 --- a/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,364 +0,0 @@ -// ResponseSerialization.swift -// -// Copyright (c) 2014–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 Foundation - -// MARK: ResponseSerializer - -/** - The type in which all response serializers must conform to in order to serialize a response. -*/ -public protocol ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializerType`. - typealias SerializedObject - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - typealias ErrorObject: ErrorType - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get } -} - -// MARK: - - -/** - A generic `ResponseSerializerType` used to serialize a request, response, and data into a serialized object. -*/ -public struct ResponseSerializer: ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializer`. - public typealias SerializedObject = Value - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - public typealias ErrorObject = Error - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result - - /** - Initializes the `ResponseSerializer` instance with the given serialize response closure. - - - parameter serializeResponse: The closure used to serialize the response. - - - returns: The new generic response serializer instance. - */ - public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Default - -extension Request { - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Void) - -> Self - { - delegate.queue.addOperationWithBlock { - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, self.delegate.data, self.delegate.error) - } - } - - return self - } - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter responseSerializer: The response serializer responsible for serializing the request, response, - and data. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - responseSerializer: T, - completionHandler: Response -> Void) - -> Self - { - delegate.queue.addOperationWithBlock { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - let timeline = Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - - let response = Response( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: timeline - ) - - dispatch_async(queue ?? dispatch_get_main_queue()) { completionHandler(response) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - - /** - Creates a response serializer that returns the associated data as-is. - - - returns: A data response serializer. - */ - public static func dataResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSData()) } - - guard let validData = data else { - let failureReason = "Data could not be serialized. Input data was nil." - let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - return .Success(validData) - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func responseData(completionHandler: Response -> Void) -> Self { - return response(responseSerializer: Request.dataResponseSerializer(), completionHandler: completionHandler) - } -} - -// MARK: - String - -extension Request { - - /** - Creates a response serializer that returns a string initialized from the response data with the specified - string encoding. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - response, falling back to the default HTTP default character set, ISO-8859-1. - - - returns: A string response serializer. - */ - public static func stringResponseSerializer( - var encoding encoding: NSStringEncoding? = nil) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success("") } - - guard let validData = data else { - let failureReason = "String could not be serialized. Input data was nil." - let error = Error.errorWithCode(.StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - if let encodingName = response?.textEncodingName where encoding == nil { - encoding = CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName) - ) - } - - let actualEncoding = encoding ?? NSISOLatin1StringEncoding - - if let string = String(data: validData, encoding: actualEncoding) { - return .Success(string) - } else { - let failureReason = "String could not be serialized with encoding: \(actualEncoding)" - let error = Error.errorWithCode(.StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - server response, falling back to the default HTTP default character set, - ISO-8859-1. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseString( - encoding encoding: NSStringEncoding? = nil, - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - - /** - Creates a response serializer that returns a JSON object constructed from the response data using - `NSJSONSerialization` with the specified reading options. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - - returns: A JSON object response serializer. - */ - public static func JSONResponseSerializer( - options options: NSJSONReadingOptions = .AllowFragments) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "JSON could not be serialized. Input data was nil or zero length." - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let JSON = try NSJSONSerialization.JSONObjectWithData(validData, options: options) - return .Success(JSON) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseJSON( - options options: NSJSONReadingOptions = .AllowFragments, - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.JSONResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - - /** - Creates a response serializer that returns an object constructed from the response data using - `NSPropertyListSerialization` with the specified reading options. - - - parameter options: The property list reading options. `NSPropertyListReadOptions()` by default. - - - returns: A property list object response serializer. - */ - public static func propertyListResponseSerializer( - options options: NSPropertyListReadOptions = NSPropertyListReadOptions()) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "Property list could not be serialized. Input data was nil or zero length." - let error = Error.errorWithCode(.PropertyListSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let plist = try NSPropertyListSerialization.propertyListWithData(validData, options: options, format: nil) - return .Success(plist) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The property list reading options. `0` by default. - - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 3 - arguments: the URL request, the URL response, the server data and the result - produced while creating the property list. - - - returns: The request. - */ - public func responsePropertyList( - options options: NSPropertyListReadOptions = NSPropertyListReadOptions(), - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Result.swift b/Carthage/Checkouts/Alamofire/Source/Result.swift deleted file mode 100644 index a8557ca..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Result.swift +++ /dev/null @@ -1,101 +0,0 @@ -// Result.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Used to represent whether a request was successful or encountered an error. - - - Success: The request and all post processing operations were successful resulting in the serialization of the - provided associated value. - - Failure: The request encountered an error resulting in a failure. The associated values are the original data - provided by the server as well as the error that caused the failure. -*/ -public enum Result { - case Success(Value) - case Failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .Success: - return true - case .Failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .Success(let value): - return value - case .Failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .Success: - return nil - case .Failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .Success: - return "SUCCESS" - case .Failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .Success(let value): - return "SUCCESS: \(value)" - case .Failure(let error): - return "FAILURE: \(error)" - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift b/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 07cd848..0000000 --- a/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,302 +0,0 @@ -// ServerTrustPolicy.swift -// -// Copyright (c) 2014–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 Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -public class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - public let policies: [String: ServerTrustPolicy] - - /** - Initializes the `ServerTrustPolicyManager` instance with the given policies. - - Since different servers and web services can have different leaf certificates, intermediate and even root - certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - pinning for host3 and disabling evaluation for host4. - - - parameter policies: A dictionary of all policies mapped to a particular host. - - - returns: The new `ServerTrustPolicyManager` instance. - */ - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /** - Returns the `ServerTrustPolicy` for the given host if applicable. - - By default, this method will return the policy that perfectly matches the given host. Subclasses could override - this method and implement more complex mapping implementations such as wildcards. - - - parameter host: The host to use when searching for a matching policy. - - - returns: The server trust policy for the given host if found. - */ - public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension NSURLSession { - private struct AssociatedKeys { - static var ManagerKey = "NSURLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/** - The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when - connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust - with a given set of criteria to determine whether the server trust is valid and the connection should be made. - - Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other - vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged - to route all communication over an HTTPS connection with pinning enabled. - - - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to - validate the host provided by the challenge. Applications are encouraged to always - validate the host in production environments to guarantee the validity of the server's - certificate chain. - - - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is - considered valid if one of the pinned certificates match one of the server certificates. - By validating both the certificate chain and host, certificate pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered - valid if one of the pinned public keys match one of the server certificate public keys. - By validating both the certificate chain and host, public key pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. - - - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust. -*/ -public enum ServerTrustPolicy { - case PerformDefaultEvaluation(validateHost: Bool) - case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case DisableEvaluation - case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool) - - // MARK: - Bundle Location - - /** - Returns all certificates within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `.cer` files. - - - returns: All certificates within the given bundle. - */ - public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil) - }.flatten()) - - for path in paths { - if let - certificateData = NSData(contentsOfFile: path), - certificate = SecCertificateCreateWithData(nil, certificateData) - { - certificates.append(certificate) - } - } - - return certificates - } - - /** - Returns all public keys within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `*.cer` files. - - - returns: All public keys within the given bundle. - */ - public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificatesInBundle(bundle) { - if let publicKey = publicKeyForCertificate(certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /** - Evaluates whether the server trust is valid for the given host. - - - parameter serverTrust: The server trust to evaluate. - - parameter host: The host of the challenge protection space. - - - returns: Whether the server trust is valid. - */ - public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .PerformDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateDataForTrust(serverTrust) - let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData.isEqualToData(pinnedCertificateData) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .DisableEvaluation: - serverTrustIsValid = true - case let .CustomEvaluation(closure): - serverTrustIsValid = closure(serverTrust: serverTrust, host: host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType(kSecTrustResultInvalid) - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType(kSecTrustResultUnspecified) - let proceed = SecTrustResultType(kSecTrustResultProceed) - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateDataForTrust(trust: SecTrust) -> [NSData] { - var certificates: [SecCertificate] = [] - - for index in 0.. [NSData] { - return certificates.map { SecCertificateCopyData($0) as NSData } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust where trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Stream.swift b/Carthage/Checkouts/Alamofire/Source/Stream.swift deleted file mode 100644 index 905e522..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Stream.swift +++ /dev/null @@ -1,180 +0,0 @@ -// Stream.swift -// -// Copyright (c) 2014–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 Foundation - -#if !os(watchOS) - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager { - private enum Streamable { - case Stream(String, Int) - case NetService(NSNetService) - } - - private func stream(streamable: Streamable) -> Request { - var streamTask: NSURLSessionStreamTask! - - switch streamable { - case .Stream(let hostName, let port): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithHostName(hostName, port: port) - } - case .NetService(let netService): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithNetService(netService) - } - } - - let request = Request(session: session, task: streamTask) - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - /** - Creates a request for bidirectional streaming with the given hostname and port. - - - parameter hostName: The hostname of the server to connect to. - - parameter port: The port of the server to connect to. - - :returns: The created stream request. - */ - public func stream(hostName hostName: String, port: Int) -> Request { - return stream(.Stream(hostName, port)) - } - - /** - Creates a request for bidirectional streaming with the given `NSNetService`. - - - parameter netService: The net service used to identify the endpoint. - - - returns: The created stream request. - */ - public func stream(netService netService: NSNetService) -> Request { - return stream(.NetService(netService)) - } -} - -// MARK: - - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager.SessionDelegate: NSURLSessionStreamDelegate { - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`. - public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`. - public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`. - public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`. - public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - // MARK: Delegate Methods - - /** - Tells the delegate that the read side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /** - Tells the delegate that the write side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /** - Tells the delegate that the system has determined that a better route to the host is available. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /** - Tells the delegate that the stream task has been completed and provides the unopened stream objects. - - - parameter session: The session. - - parameter streamTask: The stream task. - - parameter inputStream: The new input stream. - - parameter outputStream: The new output stream. - */ - public func URLSession( - session: NSURLSession, - streamTask: NSURLSessionStreamTask, - didBecomeInputStream inputStream: NSInputStream, - outputStream: NSOutputStream) - { - streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/Carthage/Checkouts/Alamofire/Source/Timeline.swift b/Carthage/Checkouts/Alamofire/Source/Timeline.swift deleted file mode 100644 index 0b7ab5d..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,123 +0,0 @@ -// Timeline.swift -// -// Copyright (c) 2014–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 Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: NSTimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: NSTimeInterval - - /** - Creates a new `Timeline` instance with the specified request times. - - - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - Defaults to `0.0`. - - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - to `0.0`. - - - returns: The new `Timeline` instance. - */ - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) - { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - let timings = [ - "\"Latency\": \(latency) secs", - "\"Request Duration\": \(requestDuration) secs", - "\"Serialization Duration\": \(serializationDuration) secs", - "\"Total Duration\": \(totalDuration) secs" - ] - - return "Timeline: { \(timings.joinWithSeparator(", ")) }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let timings = [ - "\"Request Start Time\": \(requestStartTime)", - "\"Initial Response Time\": \(initialResponseTime)", - "\"Request Completed Time\": \(requestCompletedTime)", - "\"Serialization Completed Time\": \(serializationCompletedTime)", - "\"Latency\": \(latency) secs", - "\"Request Duration\": \(requestDuration) secs", - "\"Serialization Duration\": \(serializationDuration) secs", - "\"Total Duration\": \(totalDuration) secs" - ] - - return "Timeline: { \(timings.joinWithSeparator(", ")) }" - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Upload.swift b/Carthage/Checkouts/Alamofire/Source/Upload.swift deleted file mode 100644 index 78b3072..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Upload.swift +++ /dev/null @@ -1,374 +0,0 @@ -// Upload.swift -// -// Copyright (c) 2014–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 Foundation - -extension Manager { - private enum Uploadable { - case Data(NSURLRequest, NSData) - case File(NSURLRequest, NSURL) - case Stream(NSURLRequest, NSInputStream) - } - - private func upload(uploadable: Uploadable) -> Request { - var uploadTask: NSURLSessionUploadTask! - var HTTPBodyStream: NSInputStream? - - switch uploadable { - case .Data(let request, let data): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromData: data) - } - case .File(let request, let fileURL): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL) - } - case .Stream(let request, let stream): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithStreamedRequest(request) - } - - HTTPBodyStream = stream - } - - let request = Request(session: session, task: uploadTask) - - if HTTPBodyStream != nil { - request.delegate.taskNeedNewBodyStream = { _, _ in - return HTTPBodyStream - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: File - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return upload(.File(URLRequest.URLRequest, file)) - } - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - return upload(mutableURLRequest, file: file) - } - - // MARK: Data - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return upload(.Data(URLRequest.URLRequest, data)) - } - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, data: data) - } - - // MARK: Stream - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return upload(.Stream(URLRequest.URLRequest, stream)) - } - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, stream: stream) - } - - // MARK: MultipartFormData - - /// Default memory threshold used when encoding `MultipartFormData`. - public static let MultipartFormDataEncodingMemoryThreshold: UInt64 = 10 * 1024 * 1024 - - /** - Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - associated values. - - - Success: Represents a successful `MultipartFormData` encoding and contains the new `Request` along with - streaming information. - - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - error. - */ - public enum MultipartFormDataEncodingResult { - case Success(request: Request, streamingFromDisk: Bool, streamFileURL: NSURL?) - case Failure(ErrorType) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload( - mutableURLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) - { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { - let formData = MultipartFormData() - multipartFormData(formData) - - let URLRequestWithContentType = URLRequest.URLRequest - URLRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - do { - let data = try formData.encode() - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, data: data), - streamingFromDisk: false, - streamFileURL: nil - ) - - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } else { - let fileManager = NSFileManager.defaultManager() - let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.manager/multipart.form.data") - let fileName = NSUUID().UUIDString - let fileURL = directoryURL.URLByAppendingPathComponent(fileName) - - do { - try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil) - try formData.writeEncodedDataToDisk(fileURL) - - dispatch_async(dispatch_get_main_queue()) { - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, file: fileURL), - streamingFromDisk: true, - streamFileURL: fileURL - ) - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } - } - } -} - -// MARK: - - -extension Request { - - // MARK: - UploadTaskDelegate - - class UploadTaskDelegate: DataTaskDelegate { - var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask } - var uploadProgress: ((Int64, Int64, Int64) -> Void)! - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - progress.totalUnitCount = totalBytesExpectedToSend - progress.completedUnitCount = totalBytesSent - - uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend) - } - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Source/Validation.swift b/Carthage/Checkouts/Alamofire/Source/Validation.swift deleted file mode 100644 index 71d21e1..0000000 --- a/Carthage/Checkouts/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,189 +0,0 @@ -// Validation.swift -// -// Copyright (c) 2014–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 Foundation - -extension Request { - - /** - Used to represent whether validation was successful or encountered an error resulting in a failure. - - - Success: The validation was successful. - - Failure: The validation failed encountering the provided error. - */ - public enum ValidationResult { - case Success - case Failure(NSError) - } - - /** - A closure used to validate a request that takes a URL request and URL response, and returns whether the - request was valid. - */ - public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult - - /** - Validates the request, using the specified closure. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter validation: A closure to validate the request. - - - returns: The request. - */ - public func validate(validation: Validation) -> Self { - delegate.queue.addOperationWithBlock { - if let - response = self.response where self.delegate.error == nil, - case let .Failure(error) = validation(self.request, response) - { - self.delegate.error = error - } - } - - return self - } - - // MARK: - Status Code - - /** - Validates that the response has a status code in the specified range. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter range: The range of acceptable status codes. - - - returns: The request. - */ - public func validate(statusCode acceptableStatusCode: S) -> Self { - return validate { _, response in - if acceptableStatusCode.contains(response.statusCode) { - return .Success - } else { - let failureReason = "Response status code was unacceptable: \(response.statusCode)" - return .Failure(Error.errorWithCode(.StatusCodeValidationFailed, failureReason: failureReason)) - } - } - } - - // MARK: - Content-Type - - private struct MIMEType { - let type: String - let subtype: String - - init?(_ string: String) { - let components: [String] = { - let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) - let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex) - return split.componentsSeparatedByString("/") - }() - - if let - type = components.first, - subtype = components.last - { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(MIME: MIMEType) -> Bool { - switch (type, subtype) { - case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - /** - Validates that the response has a content type in the specified array. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - - - returns: The request. - */ - public func validate(contentType acceptableContentTypes: S) -> Self { - return validate { _, response in - guard let validData = self.delegate.data where validData.length > 0 else { return .Success } - - if let - responseContentType = response.MIMEType, - responseMIMEType = MIMEType(responseContentType) - { - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) { - return .Success - } - } - } else { - for contentType in acceptableContentTypes { - if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" { - return .Success - } - } - } - - let failureReason: String - - if let responseContentType = response.MIMEType { - failureReason = ( - "Response content type \"\(responseContentType)\" does not match any acceptable " + - "content types: \(acceptableContentTypes)" - ) - } else { - failureReason = "Response content type was missing and acceptable content type does not match \"*/*\"" - } - - return .Failure(Error.errorWithCode(.ContentTypeValidationFailed, failureReason: failureReason)) - } - } - - // MARK: - Automatic - - /** - Validates that the response has a status code in the default acceptable range of 200...299, and that the content - type matches any specified in the Accept HTTP header field. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - returns: The request. - */ - public func validate() -> Self { - let acceptableStatusCodes: Range = 200..<300 - let acceptableContentTypes: [String] = { - if let accept = request?.valueForHTTPHeaderField("Accept") { - return accept.componentsSeparatedByString(",") - } - - return ["*/*"] - }() - - return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes) - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift b/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift deleted file mode 100644 index c616174..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift +++ /dev/null @@ -1,193 +0,0 @@ -// AuthenticationTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class AuthenticationTestCase: BaseTestCase { - let user = "user" - let password = "password" - var URLString = "" - - override func setUp() { - super.setUp() - - let credentialStorage = NSURLCredentialStorage.sharedCredentialStorage() - - for (protectionSpace, credentials) in credentialStorage.allCredentials { - for (_, credential) in credentials { - credentialStorage.removeCredential(credential, forProtectionSpace: protectionSpace) - } - } - } -} - -// MARK: - - -class BasicAuthenticationTestCase: AuthenticationTestCase { - override func setUp() { - super.setUp() - URLString = "https://httpbin.org/basic-auth/\(user)/\(password)" - } - - func testHTTPBasicAuthenticationWithInvalidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 401") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: "invalid", password: "credentials") - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNil(response, "response should be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, -999, "error should be NSURLErrorDomain Code -999 'cancelled'") - } - } - - func testHTTPBasicAuthenticationWithValidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 200") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: user, password: password) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertEqual(response?.statusCode ?? 0, 200, "response status code should be 200") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } -} - -// MARK: - - -class HTTPDigestAuthenticationTestCase: AuthenticationTestCase { - let qop = "auth" - - override func setUp() { - super.setUp() - URLString = "https://httpbin.org/digest-auth/\(qop)/\(user)/\(password)" - } - - func testHTTPDigestAuthenticationWithInvalidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 401") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: "invalid", password: "credentials") - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNil(response, "response should be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, -999, "error should be NSURLErrorDomain Code -999 'cancelled'") - } - } - - func testHTTPDigestAuthenticationWithValidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 200") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: user, password: password) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertEqual(response?.statusCode ?? 0, 200, "response status code should be 200") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift b/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift deleted file mode 100644 index a9fe24c..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift +++ /dev/null @@ -1,34 +0,0 @@ -// BaseTestCase.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class BaseTestCase: XCTestCase { - let timeout: NSTimeInterval = 30.0 - - func URLForResource(fileName: String, withExtension: String) -> NSURL { - let bundle = NSBundle(forClass: BaseTestCase.self) - return bundle.URLForResource(fileName, withExtension: withExtension)! - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift b/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift deleted file mode 100644 index 0d3fe3c..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift +++ /dev/null @@ -1,351 +0,0 @@ -// CacheTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -/** - This test case tests all implemented cache policies against various `Cache-Control` header values. These tests - are meant to cover the main cases of `Cache-Control` header usage, but are no means exhaustive. - - These tests work as follows: - - - Set up an `NSURLCache` - - Set up an `Alamofire.Manager` - - Execute requests for all `Cache-Control` headers values to prime the `NSURLCache` with cached responses - - Start up a new test - - Execute another round of the same requests with a given `NSURLRequestCachePolicy` - - Verify whether the response came from the cache or from the network - - This is determined by whether the cached response timestamp matches the new response timestamp - - An important thing to note is the difference in behavior between iOS and OS X. On iOS, a response with - a `Cache-Control` header value of `no-store` is still written into the `NSURLCache` where on OS X, it is not. - The different tests below reflect and demonstrate this behavior. - - For information about `Cache-Control` HTTP headers, please refer to RFC 2616 - Section 14.9. -*/ -class CacheTestCase: BaseTestCase { - - // MARK: - - - struct CacheControl { - static let Public = "public" - static let Private = "private" - static let MaxAgeNonExpired = "max-age=3600" - static let MaxAgeExpired = "max-age=0" - static let NoCache = "no-cache" - static let NoStore = "no-store" - - static var allValues: [String] { - return [ - CacheControl.Public, - CacheControl.Private, - CacheControl.MaxAgeNonExpired, - CacheControl.MaxAgeExpired, - CacheControl.NoCache, - CacheControl.NoStore - ] - } - } - - // MARK: - Properties - - var URLCache: NSURLCache! - var manager: Manager! - - let URLString = "https://httpbin.org/response-headers" - let requestTimeout: NSTimeInterval = 30 - - var requests: [String: NSURLRequest] = [:] - var timestamps: [String: String] = [:] - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - URLCache = { - let capacity = 50 * 1024 * 1024 // MBs - let URLCache = NSURLCache(memoryCapacity: capacity, diskCapacity: capacity, diskPath: nil) - - return URLCache - }() - - manager = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - configuration.requestCachePolicy = .UseProtocolCachePolicy - configuration.URLCache = self.URLCache - - return configuration - }() - - let manager = Manager(configuration: configuration) - - return manager - }() - - primeCachedResponses() - } - - override func tearDown() { - super.tearDown() - - URLCache.removeAllCachedResponses() - } - - // MARK: - Cache Priming Methods - - /** - Executes a request for all `Cache-Control` header values to load the response into the `URLCache`. - - This implementation leverages dispatch groups to execute all the requests as well as wait an additional - second before returning. This ensures the cache contains responses for all requests that are at least - one second old. This allows the tests to distinguish whether the subsequent responses come from the cache - or the network based on the timestamp of the response. - */ - func primeCachedResponses() { - let dispatchGroup = dispatch_group_create() - let highPriorityDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) - - for cacheControl in CacheControl.allValues { - dispatch_group_enter(dispatchGroup) - - let request = startRequest( - cacheControl: cacheControl, - queue: highPriorityDispatchQueue, - completion: { _, response in - let timestamp = response!.allHeaderFields["Date"] as! String - self.timestamps[cacheControl] = timestamp - - dispatch_group_leave(dispatchGroup) - } - ) - - requests[cacheControl] = request - } - - // Wait for all requests to complete - dispatch_group_wait(dispatchGroup, dispatch_time(DISPATCH_TIME_NOW, Int64(10.0 * Float(NSEC_PER_SEC)))) - - // Pause for 1 additional second to ensure all timestamps will be different - dispatch_group_enter(dispatchGroup) - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(1.0 * Float(NSEC_PER_SEC))), highPriorityDispatchQueue) { - dispatch_group_leave(dispatchGroup) - } - - // Wait for our 1 second pause to complete - dispatch_group_wait(dispatchGroup, dispatch_time(DISPATCH_TIME_NOW, Int64(10.0 * Float(NSEC_PER_SEC)))) - } - - // MARK: - Request Helper Methods - - func URLRequest(cacheControl cacheControl: String, cachePolicy: NSURLRequestCachePolicy) -> NSURLRequest { - let parameters = ["Cache-Control": cacheControl] - let URL = NSURL(string: URLString)! - let URLRequest = NSMutableURLRequest(URL: URL, cachePolicy: cachePolicy, timeoutInterval: requestTimeout) - URLRequest.HTTPMethod = Method.GET.rawValue - - return ParameterEncoding.URL.encode(URLRequest, parameters: parameters).0 - } - - func startRequest( - cacheControl cacheControl: String, - cachePolicy: NSURLRequestCachePolicy = .UseProtocolCachePolicy, - queue: dispatch_queue_t = dispatch_get_main_queue(), - completion: (NSURLRequest?, NSHTTPURLResponse?) -> Void) - -> NSURLRequest - { - let urlRequest = URLRequest(cacheControl: cacheControl, cachePolicy: cachePolicy) - - let request = manager.request(urlRequest) - request.response( - queue: queue, - completionHandler: { _, response, data, _ in - completion(request.request, response) - } - ) - - return urlRequest - } - - // MARK: - Test Execution and Verification - - func executeTest( - cachePolicy cachePolicy: NSURLRequestCachePolicy, - cacheControl: String, - shouldReturnCachedResponse: Bool) - { - // Given - let expectation = expectationWithDescription("GET request to httpbin") - var response: NSHTTPURLResponse? - - // When - startRequest(cacheControl: cacheControl, cachePolicy: cachePolicy) { _, responseResponse in - response = responseResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - verifyResponse(response, forCacheControl: cacheControl, isCachedResponse: shouldReturnCachedResponse) - } - - func verifyResponse(response: NSHTTPURLResponse?, forCacheControl cacheControl: String, isCachedResponse: Bool) { - guard let cachedResponseTimestamp = timestamps[cacheControl] else { - XCTFail("cached response timestamp should not be nil") - return - } - - if let - response = response, - timestamp = response.allHeaderFields["Date"] as? String - { - if isCachedResponse { - XCTAssertEqual(timestamp, cachedResponseTimestamp, "timestamps should be equal") - } else { - XCTAssertNotEqual(timestamp, cachedResponseTimestamp, "timestamps should not be equal") - } - } else { - XCTFail("response should not be nil") - } - } - - // MARK: - Cache Helper Methods - - private func isCachedResponseForNoStoreHeaderExpected() -> Bool { - var storedInCache = false - - #if os(iOS) - let operatingSystemVersion = NSOperatingSystemVersion(majorVersion: 8, minorVersion: 3, patchVersion: 0) - - if !NSProcessInfo().isOperatingSystemAtLeastVersion(operatingSystemVersion) { - storedInCache = true - } - #endif - - return storedInCache - } - - // MARK: - Tests - - func testURLCacheContainsCachedResponsesForAllRequests() { - // Given - let publicRequest = requests[CacheControl.Public]! - let privateRequest = requests[CacheControl.Private]! - let maxAgeNonExpiredRequest = requests[CacheControl.MaxAgeNonExpired]! - let maxAgeExpiredRequest = requests[CacheControl.MaxAgeExpired]! - let noCacheRequest = requests[CacheControl.NoCache]! - let noStoreRequest = requests[CacheControl.NoStore]! - - // When - let publicResponse = URLCache.cachedResponseForRequest(publicRequest) - let privateResponse = URLCache.cachedResponseForRequest(privateRequest) - let maxAgeNonExpiredResponse = URLCache.cachedResponseForRequest(maxAgeNonExpiredRequest) - let maxAgeExpiredResponse = URLCache.cachedResponseForRequest(maxAgeExpiredRequest) - let noCacheResponse = URLCache.cachedResponseForRequest(noCacheRequest) - let noStoreResponse = URLCache.cachedResponseForRequest(noStoreRequest) - - // Then - XCTAssertNotNil(publicResponse, "\(CacheControl.Public) response should not be nil") - XCTAssertNotNil(privateResponse, "\(CacheControl.Private) response should not be nil") - XCTAssertNotNil(maxAgeNonExpiredResponse, "\(CacheControl.MaxAgeNonExpired) response should not be nil") - XCTAssertNotNil(maxAgeExpiredResponse, "\(CacheControl.MaxAgeExpired) response should not be nil") - XCTAssertNotNil(noCacheResponse, "\(CacheControl.NoCache) response should not be nil") - - if isCachedResponseForNoStoreHeaderExpected() { - XCTAssertNotNil(noStoreResponse, "\(CacheControl.NoStore) response should not be nil") - } else { - XCTAssertNil(noStoreResponse, "\(CacheControl.NoStore) response should be nil") - } - } - - func testDefaultCachePolicy() { - let cachePolicy: NSURLRequestCachePolicy = .UseProtocolCachePolicy - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - - func testIgnoreLocalCacheDataPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReloadIgnoringLocalCacheData - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - - func testUseLocalCacheDataIfExistsOtherwiseLoadFromNetworkPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReturnCacheDataElseLoad - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: true) - - if isCachedResponseForNoStoreHeaderExpected() { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: true) - } else { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - } - - func testUseLocalCacheDataAndDontLoadFromNetworkPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReturnCacheDataDontLoad - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: true) - - if isCachedResponseForNoStoreHeaderExpected() { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: true) - } else { - // Given - let expectation = expectationWithDescription("GET request to httpbin") - var response: NSHTTPURLResponse? - - // When - startRequest(cacheControl: CacheControl.NoStore, cachePolicy: cachePolicy) { _, responseResponse in - response = responseResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(response, "response should be nil") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift b/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift deleted file mode 100644 index 2340c0e..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift +++ /dev/null @@ -1,459 +0,0 @@ -// DownloadTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class DownloadInitializationTestCase: BaseTestCase { - let searchPathDirectory: NSSearchPathDirectory = .CachesDirectory - let searchPathDomain: NSSearchPathDomainMask = .UserDomainMask - - func testDownloadClassMethodWithMethodURLAndDestination() { - // Given - let URLString = "https://httpbin.org/" - let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) - - // When - let request = Alamofire.download(.GET, URLString, destination: destination) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should be GET") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testDownloadClassMethodWithMethodURLHeadersAndDestination() { - // Given - let URLString = "https://httpbin.org/" - let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) - - // When - let request = Alamofire.download(.GET, URLString, headers: ["Authorization": "123456"], destination: destination) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should be GET") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class DownloadResponseTestCase: BaseTestCase { - let searchPathDirectory: NSSearchPathDirectory = .CachesDirectory - let searchPathDomain: NSSearchPathDomainMask = .UserDomainMask - - let cachesURL: NSURL = { - let cachesDirectory = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true).first! - let cachesURL = NSURL(fileURLWithPath: cachesDirectory, isDirectory: true) - - return cachesURL - }() - - var randomCachesFileURL: NSURL { - return cachesURL.URLByAppendingPathComponent("\(NSUUID().UUIDString).json") - } - - func testDownloadRequest() { - // Given - let numberOfLines = 100 - let URLString = "https://httpbin.org/stream/\(numberOfLines)" - - let destination = Alamofire.Request.suggestedDownloadDestination( - directory: searchPathDirectory, - domain: searchPathDomain - ) - - let expectation = expectationWithDescription("Download request should download data to file: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var error: NSError? - - // When - Alamofire.download(.GET, URLString, destination: destination) - .response { responseRequest, responseResponse, _, responseError in - request = responseRequest - response = responseResponse - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNil(error, "error should be nil") - - let fileManager = NSFileManager.defaultManager() - let directory = fileManager.URLsForDirectory(searchPathDirectory, inDomains: self.searchPathDomain)[0] - - do { - let contents = try fileManager.contentsOfDirectoryAtURL( - directory, - includingPropertiesForKeys: nil, - options: .SkipsHiddenFiles - ) - - #if os(iOS) || os(tvOS) - let suggestedFilename = "\(numberOfLines)" - #elseif os(OSX) - let suggestedFilename = "\(numberOfLines).json" - #endif - - let predicate = NSPredicate(format: "lastPathComponent = '\(suggestedFilename)'") - let filteredContents = (contents as NSArray).filteredArrayUsingPredicate(predicate) - XCTAssertEqual(filteredContents.count, 1, "should have one file in Documents") - - if let file = filteredContents.first as? NSURL { - XCTAssertEqual( - file.lastPathComponent ?? "", - "\(suggestedFilename)", - "filename should be \(suggestedFilename)" - ) - - if let data = NSData(contentsOfURL: file) { - XCTAssertGreaterThan(data.length, 0, "data length should be non-zero") - } else { - XCTFail("data should exist for contents of URL") - } - - do { - try fileManager.removeItemAtURL(file) - } catch { - XCTFail("file manager should remove item at URL: \(file)") - } - } else { - XCTFail("file should not be nil") - } - } catch { - XCTFail("contents should not be nil") - } - } - - func testDownloadRequestWithProgress() { - // Given - let randomBytes = 4 * 1024 * 1024 - let URLString = "https://httpbin.org/bytes/\(randomBytes)" - - let fileManager = NSFileManager.defaultManager() - let directory = fileManager.URLsForDirectory(searchPathDirectory, inDomains: self.searchPathDomain)[0] - let filename = "test_download_data" - let fileURL = directory.URLByAppendingPathComponent(filename) - - let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let download = Alamofire.download(.GET, URLString) { _, _ in - return fileURL - } - download.progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - let bytes = (bytes: bytesRead, totalBytes: totalBytesRead, totalBytesExpected: totalBytesExpectedToRead) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: download.progress.completedUnitCount, - totalUnitCount: download.progress.totalUnitCount - ) - progressValues.append(progress) - } - download.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response should not be nil") - XCTAssertNil(responseData, "response data should be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0..? - - // When - let download = Alamofire.download(.GET, URLString, destination: destination) - download.progress { _, _, _ in - download.cancel() - } - download.responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - XCTAssertNotNil(response.result.error, "result error should not be nil") - } else { - XCTFail("response should not be nil") - } - - XCTAssertNotNil(download.resumeData, "resume data should not be nil") - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift b/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift deleted file mode 100644 index dbd165b..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift +++ /dev/null @@ -1,280 +0,0 @@ -// ManagerTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import XCTest - -class ManagerTestCase: BaseTestCase { - - // MARK: Initialization Tests - - func testInitializerWithDefaultArguments() { - // Given, When - let manager = Manager() - - // Then - XCTAssertNotNil(manager.session.delegate, "session delegate should not be nil") - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should be nil") - } - - func testInitializerWithSpecifiedArguments() { - // Given - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - let delegate = Manager.SessionDelegate() - let serverTrustPolicyManager = ServerTrustPolicyManager(policies: [:]) - - // When - let manager = Manager( - configuration: configuration, - delegate: delegate, - serverTrustPolicyManager: serverTrustPolicyManager - ) - - // Then - XCTAssertNotNil(manager.session.delegate, "session delegate should not be nil") - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNotNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should not be nil") - } - - func testThatFailableInitializerSucceedsWithDefaultArguments() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - if let manager = manager { - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should be nil") - } else { - XCTFail("manager should not be nil") - } - } - - func testThatFailableInitializerSucceedsWithSpecifiedArguments() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - }() - - let serverTrustPolicyManager = ServerTrustPolicyManager(policies: [:]) - - // When - let manager = Manager(session: session, delegate: delegate, serverTrustPolicyManager: serverTrustPolicyManager) - - // Then - if let manager = manager { - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNotNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should not be nil") - } else { - XCTFail("manager should not be nil") - } - } - - func testThatFailableInitializerFailsWithWhenDelegateDoesNotEqualSessionDelegate() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: Manager.SessionDelegate(), delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - XCTAssertNil(manager, "manager should be nil") - } - - func testThatFailableInitializerFailsWhenSessionDelegateIsNil() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: nil, delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - XCTAssertNil(manager, "manager should be nil") - } - - // MARK: Start Requests Immediately Tests - - func testSetStartRequestsImmediatelyToFalseAndResumeRequest() { - // Given - let manager = Alamofire.Manager() - manager.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - let expectation = expectationWithDescription("\(URL)") - - var response: NSHTTPURLResponse? - - // When - manager.request(URLRequest) - .response { _, responseResponse, _, _ in - response = responseResponse - expectation.fulfill() - } - .resume() - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response, "response should not be nil") - XCTAssertTrue(response?.statusCode == 200, "response status code should be 200") - } - - // MARK: Deinitialization Tests - - func testReleasingManagerWithPendingRequestDeinitializesSuccessfully() { - // Given - var manager: Manager? = Alamofire.Manager() - manager?.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - // When - let request = manager?.request(URLRequest) - manager = nil - - // Then - XCTAssertTrue(request?.task.state == .Suspended, "request task state should be '.Suspended'") - XCTAssertNil(manager, "manager should be nil") - } - - func testReleasingManagerWithPendingCanceledRequestDeinitializesSuccessfully() { - // Given - var manager: Manager? = Alamofire.Manager() - manager!.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - // When - let request = manager!.request(URLRequest) - request.cancel() - manager = nil - - // Then - let state = request.task.state - XCTAssertTrue(state == .Canceling || state == .Completed, "state should be .Canceling or .Completed") - XCTAssertNil(manager, "manager should be nil") - } -} - -// MARK: - - -class ManagerConfigurationHeadersTestCase: BaseTestCase { - enum ConfigurationType { - case Default, Ephemeral, Background - } - - func testThatDefaultConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Default) - } - - func testThatEphemeralConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Ephemeral) - } - - func testThatBackgroundConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Background) - } - - private func executeAuthorizationHeaderTestForConfigurationType(type: ConfigurationType) { - // Given - let manager: Manager = { - let configuration: NSURLSessionConfiguration = { - let configuration: NSURLSessionConfiguration - - switch type { - case .Default: - configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - case .Ephemeral: - configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - case .Background: - let identifier = "com.alamofire.test.manager-configuration-tests" - configuration = NSURLSessionConfiguration.backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier) - } - - var headers = Alamofire.Manager.defaultHTTPHeaders - headers["Authorization"] = "Bearer 123456" - configuration.HTTPAdditionalHeaders = headers - - return configuration - }() - - return Manager(configuration: configuration) - }() - - let expectation = expectationWithDescription("request should complete successfully") - - var response: Response? - - // When - manager.request(.GET, "https://httpbin.org/headers") - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be a success") - - if let - headers = response.result.value?["headers" as NSString] as? [String: String], - authorization = headers["Authorization"] - { - XCTAssertEqual(authorization, "Bearer 123456", "authorization header value does not match") - } else { - XCTFail("failed to extract authorization header value") - } - } else { - XCTFail("response should not be nil") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift b/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift deleted file mode 100644 index 7418ece..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift +++ /dev/null @@ -1,993 +0,0 @@ -// MultipartFormDataTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -struct EncodingCharacters { - static let CRLF = "\r\n" -} - -struct BoundaryGenerator { - enum BoundaryType { - case Initial, Encapsulated, Final - } - - static func boundary(boundaryType boundaryType: BoundaryType, boundaryKey: String) -> String { - let boundary: String - - switch boundaryType { - case .Initial: - boundary = "--\(boundaryKey)\(EncodingCharacters.CRLF)" - case .Encapsulated: - boundary = "\(EncodingCharacters.CRLF)--\(boundaryKey)\(EncodingCharacters.CRLF)" - case .Final: - boundary = "\(EncodingCharacters.CRLF)--\(boundaryKey)--\(EncodingCharacters.CRLF)" - } - - return boundary - } - - static func boundaryData(boundaryType boundaryType: BoundaryType, boundaryKey: String) -> NSData { - return BoundaryGenerator.boundary( - boundaryType: boundaryType, - boundaryKey: boundaryKey - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } -} - -private func temporaryFileURL() -> NSURL { - let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.test/multipart.form.data") - - let fileManager = NSFileManager.defaultManager() - do { - try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil) - } catch { - // No-op - will cause tests to fail, not crash - } - - let fileName = NSUUID().UUIDString - let fileURL = directoryURL.URLByAppendingPathComponent(fileName) - - return fileURL -} - -// MARK: - - -class MultipartFormDataPropertiesTestCase: BaseTestCase { - func testThatContentTypeContainsBoundary() { - // Given - let multipartFormData = MultipartFormData() - - // When - let boundary = multipartFormData.boundary - - // Then - let expectedContentType = "multipart/form-data; boundary=\(boundary)" - XCTAssertEqual(multipartFormData.contentType, expectedContentType, "contentType should match expected value") - } - - func testThatContentLengthMatchesTotalBodyPartSize() { - // Given - let multipartFormData = MultipartFormData() - let data1 = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let data2 = "Vim at integre alterum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - // When - multipartFormData.appendBodyPart(data: data1, name: "data1") - multipartFormData.appendBodyPart(data: data2, name: "data2") - - // Then - let expectedContentLength = UInt64(data1.length + data2.length) - XCTAssertEqual(multipartFormData.contentLength, expectedContentLength, "content length should match expected value") - } -} - -// MARK: - - -class MultipartFormDataEncodingTestCase: BaseTestCase { - let CRLF = EncodingCharacters.CRLF - - func testEncodingDataBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"data\"\(CRLF)\(CRLF)" + - "Lorem ipsum dolor sit amet." + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(encodedData, expectedData, "encoded data should match expected data") - } - } - - func testEncodingMultipleDataBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let emoji = "😃👍🏻🍻🎉".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - multipartFormData.appendBodyPart(data: french, name: "french") - multipartFormData.appendBodyPart(data: japanese, name: "japanese", mimeType: "text/plain") - multipartFormData.appendBodyPart(data: emoji, name: "emoji", mimeType: "text/plain") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"french\"\(CRLF)\(CRLF)" + - "français" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"japanese\"\(CRLF)" + - "Content-Type: text/plain\(CRLF)\(CRLF)" + - "日本語" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"emoji\"\(CRLF)" + - "Content-Type: text/plain\(CRLF)\(CRLF)" + - "😃👍🏻🍻🎉" + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(encodedData, expectedData, "encoded data should match expected data") - } - } - - func testEncodingFileBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleFileBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingStreamBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleStreamBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleBodyPartsWithVaryingTypes() { - // Given - let multipartFormData = MultipartFormData() - - let loremData = "Lorem ipsum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart(data: loremData, name: "lorem") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"lorem\"\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(loremData) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } -} - -// MARK: - - -class MultipartFormDataWriteEncodedDataToDiskTestCase: BaseTestCase { - let CRLF = EncodingCharacters.CRLF - - func testWritingEncodedDataBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"data\"\(CRLF)\(CRLF)" + - "Lorem ipsum dolor sit amet." + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedDataBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let emoji = "😃👍🏻🍻🎉".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - multipartFormData.appendBodyPart(data: french, name: "french") - multipartFormData.appendBodyPart(data: japanese, name: "japanese") - multipartFormData.appendBodyPart(data: emoji, name: "emoji") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"french\"\(CRLF)\(CRLF)" + - "français" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"japanese\"\(CRLF)\(CRLF)" + - "日本語" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"emoji\"\(CRLF)\(CRLF)" + - "😃👍🏻🍻🎉" + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingEncodedFileBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedFileBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingEncodedStreamBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedStreamBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedBodyPartsWithVaryingTypesToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let loremData = "Lorem ipsum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart(data: loremData, name: "lorem") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"lorem\"\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(loremData) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } -} - -// MARK: - - -class MultipartFormDataFailureTestCase: BaseTestCase { - func testThatAppendingFileBodyPartWithInvalidLastPathComponentReturnsError() { - // Given - let fileURL = NSURL(string: "")! - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "Failed to extract the fileName of the provided URL: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsNotFileURLReturnsError() { - // Given - let fileURL = NSURL(string: "https://example.com/image.jpg")! - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL does not point to a file URL: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsNotReachableReturnsError() { - // Given - let filePath = (NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("does_not_exist.jpg") - let fileURL = NSURL(fileURLWithPath: filePath) - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL is not reachable: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsDirectoryReturnsError() { - // Given - let directoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: directoryURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL is a directory, not a file: \(directoryURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatWritingEncodedDataToExistingFileURLFails() { - // Given - let fileURL = temporaryFileURL() - - var writerError: NSError? - - do { - try "dummy data".writeToURL(fileURL, atomically: true, encoding: NSUTF8StringEncoding) - } catch { - writerError = error as NSError - } - - let multipartFormData = MultipartFormData() - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(writerError, "writer error should be nil") - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let encodingError = encodingError { - XCTAssertEqual(encodingError.domain, "com.alamofire.error", "encoding error domain does not match expected value") - XCTAssertEqual(encodingError.code, NSURLErrorBadURL, "encoding error code does not match expected value") - } - } - - func testThatWritingEncodedDataToBadURLFails() { - // Given - let fileURL = NSURL(string: "/this/is/not/a/valid/url")! - - let multipartFormData = MultipartFormData() - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let encodingError = encodingError { - XCTAssertEqual(encodingError.domain, "com.alamofire.error", "encoding error domain does not match expected value") - XCTAssertEqual(encodingError.code, NSURLErrorBadURL, "encoding error code does not match expected value") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift b/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift deleted file mode 100644 index c583e4b..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift +++ /dev/null @@ -1,37 +0,0 @@ -// NSURLSessionConfiguration+AlamofireTests.swift -// -// Copyright (c) 2014–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 Foundation - -extension NSURLSessionConfiguration { - static func backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier: String) -> NSURLSessionConfiguration { - let configuration: NSURLSessionConfiguration - - if #available(OSX 10.10, *) { - configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(identifier) - } else { - configuration = NSURLSessionConfiguration.backgroundSessionConfiguration(identifier) - } - - return configuration - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift b/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift deleted file mode 100644 index 7595076..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift +++ /dev/null @@ -1,220 +0,0 @@ -// NetworkReachabilityManagerTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import SystemConfiguration -import XCTest - -class NetworkReachabilityManagerTestCase: BaseTestCase { - - // MARK: - Tests - Initialization - - func testThatManagerCanBeInitializedFromHost() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertNotNil(manager) - } - - func testThatManagerCanBeInitializedFromAddress() { - // Given, When - let manager = NetworkReachabilityManager() - - // Then - XCTAssertNotNil(manager) - } - - func testThatHostManagerIsReachableOnWiFi() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatHostManagerStartsWithReachableStatus() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatAddressManagerStartsWithReachableStatus() { - // Given, When - let manager = NetworkReachabilityManager() - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatHostManagerCanBeDeinitialized() { - // Given - var manager: NetworkReachabilityManager? = NetworkReachabilityManager(host: "localhost") - - // When - manager = nil - - // Then - XCTAssertNil(manager) - } - - func testThatAddressManagerCanBeDeinitialized() { - // Given - var manager: NetworkReachabilityManager? = NetworkReachabilityManager() - - // When - manager = nil - - // Then - XCTAssertNil(manager) - } - - // MARK: - Tests - Listener - - func testThatHostManagerIsNotifiedWhenStartListeningIsCalled() { - // Given - let manager = NetworkReachabilityManager(host: "localhost") - let expectation = expectationWithDescription("listener closure should be executed") - - var networkReachabilityStatus: NetworkReachabilityManager.NetworkReachabilityStatus? - - manager?.listener = { status in - networkReachabilityStatus = status - expectation.fulfill() - } - - // When - manager?.startListening() - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatAddressManagerIsNotifiedWhenStartListeningIsCalled() { - // Given - let manager = NetworkReachabilityManager() - let expectation = expectationWithDescription("listener closure should be executed") - - var networkReachabilityStatus: NetworkReachabilityManager.NetworkReachabilityStatus? - - manager?.listener = { status in - networkReachabilityStatus = status - expectation.fulfill() - } - - // When - manager?.startListening() - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - // MARK: - Tests - Network Reachability Status - - func testThatManagerReturnsNotReachableStatusWhenReachableFlagIsAbsent() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.ConnectionOnDemand] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .NotReachable) - } - - func testThatManagerReturnsNotReachableStatusWhenInterventionIsRequired() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnDemand, .InterventionRequired] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .NotReachable) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsNotRequired() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsOnDemand() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnDemand] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsOnTraffic() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnTraffic] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - -#if os(iOS) - func testThatManagerReturnsReachableOnWWANStatusWhenIsWWAN() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .IsWWAN] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.WWAN)) - } -#endif -} diff --git a/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift b/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift deleted file mode 100644 index c96f997..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift +++ /dev/null @@ -1,645 +0,0 @@ -// ParameterEncodingTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ParameterEncodingTestCase: BaseTestCase { - let URLRequest = NSURLRequest(URL: NSURL(string: "https://example.com/")!) -} - -// MARK: - - -class URLParameterEncodingTestCase: ParameterEncodingTestCase { - let encoding: ParameterEncoding = .URL - - // MARK: Tests - Parameter Types - - func testURLParameterEncodeNilParameters() { - // Given - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: nil) - - // Then - XCTAssertNil(URLRequest.URL?.query, "query should be nil") - } - - func testURLParameterEncodeEmptyDictionaryParameter() { - // Given - let parameters: [String: AnyObject] = [:] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertNil(URLRequest.URL?.query, "query should be nil") - } - - func testURLParameterEncodeOneStringKeyStringValueParameter() { - // Given - let parameters = ["foo": "bar"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=bar", "query is incorrect") - } - - func testURLParameterEncodeOneStringKeyStringValueParameterAppendedToQuery() { - // Given - let mutableURLRequest = self.URLRequest.URLRequest - let URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false)! - URLComponents.query = "baz=qux" - mutableURLRequest.URL = URLComponents.URL - - let parameters = ["foo": "bar"] - - // When - let (URLRequest, _) = encoding.encode(mutableURLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "baz=qux&foo=bar", "query is incorrect") - } - - func testURLParameterEncodeTwoStringKeyStringValueParameters() { - // Given - let parameters = ["foo": "bar", "baz": "qux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "baz=qux&foo=bar", "query is incorrect") - } - - func testURLParameterEncodeStringKeyIntegerValueParameter() { - // Given - let parameters = ["foo": 1] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyDoubleValueParameter() { - // Given - let parameters = ["foo": 1.1] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1.1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyBoolValueParameter() { - // Given - let parameters = ["foo": true] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyArrayValueParameter() { - // Given - let parameters = ["foo": ["a", 1, true]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5B%5D=a&foo%5B%5D=1&foo%5B%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyDictionaryValueParameter() { - // Given - let parameters = ["foo": ["bar": 1]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5Bbar%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNestedDictionaryValueParameter() { - // Given - let parameters = ["foo": ["bar": ["baz": 1]]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5Bbar%5D%5Bbaz%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNestedDictionaryArrayValueParameter() { - // Given - let parameters = ["foo": ["bar": ["baz": ["a", 1, true]]]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "foo%5Bbar%5D%5Bbaz%5D%5B%5D=a&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - // MARK: Tests - All Reserved / Unreserved / Illegal Characters According to RFC 3986 - - func testThatReservedCharactersArePercentEscapedMinusQuestionMarkAndForwardSlash() { - // Given - let generalDelimiters = ":#[]@" - let subDelimiters = "!$&'()*+,;=" - let parameters = ["reserved": "\(generalDelimiters)\(subDelimiters)"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "reserved=%3A%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - func testThatReservedCharactersQuestionMarkAndForwardSlashAreNotPercentEscaped() { - // Given - let parameters = ["reserved": "?/"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "reserved=?/", "query is incorrect") - } - - func testThatUnreservedNumericCharactersAreNotPercentEscaped() { - // Given - let parameters = ["numbers": "0123456789"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "numbers=0123456789", "query is incorrect") - } - - func testThatUnreservedLowercaseCharactersAreNotPercentEscaped() { - // Given - let parameters = ["lowercase": "abcdefghijklmnopqrstuvwxyz"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "lowercase=abcdefghijklmnopqrstuvwxyz", "query is incorrect") - } - - func testThatUnreservedUppercaseCharactersAreNotPercentEscaped() { - // Given - let parameters = ["uppercase": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "uppercase=ABCDEFGHIJKLMNOPQRSTUVWXYZ", "query is incorrect") - } - - func testThatIllegalASCIICharactersArePercentEscaped() { - // Given - let parameters = ["illegal": " \"#%<>[]\\^`{}|"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "illegal=%20%22%23%25%3C%3E%5B%5D%5C%5E%60%7B%7D%7C" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - // MARK: Tests - Special Character Queries - - func testURLParameterEncodeStringWithAmpersandKeyStringWithAmpersandValueParameter() { - // Given - let parameters = ["foo&bar": "baz&qux", "foobar": "bazqux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%26bar=baz%26qux&foobar=bazqux", "query is incorrect") - } - - func testURLParameterEncodeStringWithQuestionMarkKeyStringWithQuestionMarkValueParameter() { - // Given - let parameters = ["?foo?": "?bar?"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "?foo?=?bar?", "query is incorrect") - } - - func testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter() { - // Given - let parameters = ["foo": "/bar/baz/qux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=/bar/baz/qux", "query is incorrect") - } - - func testURLParameterEncodeStringWithSpaceKeyStringWithSpaceValueParameter() { - // Given - let parameters = [" foo ": " bar "] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "%20foo%20=%20bar%20", "query is incorrect") - } - - func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameter() { - // Given - let parameters = ["+foo+": "+bar+"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "%2Bfoo%2B=%2Bbar%2B", "query is incorrect") - } - - func testURLParameterEncodeStringKeyPercentEncodedStringValueParameter() { - // Given - let parameters = ["percent": "%25"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "percent=%2525", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNonLatinStringValueParameter() { - // Given - let parameters = [ - "french": "français", - "japanese": "日本語", - "arabic": "العربية", - "emoji": "😃" - ] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedParameterValues = [ - "arabic=%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9", - "emoji=%F0%9F%98%83", - "french=fran%C3%A7ais", - "japanese=%E6%97%A5%E6%9C%AC%E8%AA%9E" - ] - - let expectedQuery = expectedParameterValues.joinWithSeparator("&") - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - func testURLParameterEncodeStringForRequestWithPrecomposedQuery() { - // Given - let URL = NSURL(string: "https://example.com/movies?hd=[1]")! - let parameters = ["page": "0"] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "hd=%5B1%5D&page=0", "query is incorrect") - } - - func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameterForRequestWithPrecomposedQuery() { - // Given - let URL = NSURL(string: "https://example.com/movie?hd=[1]")! - let parameters = ["+foo+": "+bar+"] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "hd=%5B1%5D&%2Bfoo%2B=%2Bbar%2B", "query is incorrect") - } - - func testURLParameterEncodeStringWithThousandsOfChineseCharacters() { - // Given - let repeatedCount = 2_000 - let URL = NSURL(string: "https://example.com/movies")! - let parameters = ["chinese": String(count: repeatedCount, repeatedString: "一二三四五六七八九十")] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - var expected = "chinese=" - for _ in 0.. (NSMutableURLRequest, NSError?) = { URLRequest, parameters in - guard let parameters = parameters else { return (URLRequest.URLRequest, nil) } - - var URLString = URLRequest.URLRequest.URLString + "?" - - parameters.forEach { URLString += "\($0)=\($1)" } - - let mutableURLRequest = URLRequest.URLRequest - mutableURLRequest.URL = NSURL(string: URLString)! - - return (mutableURLRequest, nil) - } - - // When - let encoding: ParameterEncoding = .Custom(encodingClosure) - - // Then - let URL = NSURL(string: "https://example.com")! - let URLRequest = NSURLRequest(URL: URL) - let parameters: [String: AnyObject] = ["foo": "bar"] - - XCTAssertEqual( - encoding.encode(URLRequest, parameters: parameters).0.URLString, - "https://example.com?foo=bar", - "the encoded URL should match the expected value" - ) - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift b/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift deleted file mode 100644 index 1cbaa8c..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift +++ /dev/null @@ -1,617 +0,0 @@ -// RequestTests.swift -// -// Copyright (c) 2014-2015 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 Alamofire -import Foundation -import XCTest - -class RequestInitializationTestCase: BaseTestCase { - func testRequestClassMethodWithMethodAndURL() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.request(.GET, URLString) - - // Then - XCTAssertNotNil(request.request, "request URL request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "request response should be nil") - } - - func testRequestClassMethodWithMethodAndURLAndParameters() { - // Given - let URLString = "https://httpbin.org/get" - - // When - let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - - // Then - XCTAssertNotNil(request.request, "request URL request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertNotEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertEqual(request.request?.URL?.query ?? "", "foo=bar", "query is incorrect") - XCTAssertNil(request.response, "request response should be nil") - } - - func testRequestClassMethodWithMethodURLParametersAndHeaders() { - // Given - let URLString = "https://httpbin.org/get" - let headers = ["Authorization": "123456"] - - // When - let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"], headers: headers) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertNotEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertEqual(request.request?.URL?.query ?? "", "foo=bar", "query is incorrect") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class RequestResponseTestCase: BaseTestCase { - func testRequestResponse() { - // Given - let URLString = "https://httpbin.org/get" - - let expectation = expectationWithDescription("GET request should succeed: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } - - func testRequestResponseWithProgress() { - // Given - let randomBytes = 4 * 1024 * 1024 - let URLString = "https://httpbin.org/bytes/\(randomBytes)" - - let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let request = Alamofire.request(.GET, URLString) - request.progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - let bytes = (bytes: bytesRead, totalBytes: totalBytesRead, totalBytesExpected: totalBytesExpectedToRead) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: request.progress.completedUnitCount, - totalUnitCount: request.progress.totalUnitCount - ) - progressValues.append(progress) - } - request.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response response should not be nil") - XCTAssertNotNil(responseData, "response data should not be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0..? - - // When - Alamofire.request(.POST, URLString, parameters: parameters) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - - if let - JSON = response.result.value as? [String: AnyObject], - form = JSON["form"] as? [String: String] - { - XCTAssertEqual(form["french"], parameters["french"], "french parameter value should match form value") - XCTAssertEqual(form["japanese"], parameters["japanese"], "japanese parameter value should match form value") - XCTAssertEqual(form["arabic"], parameters["arabic"], "arabic parameter value should match form value") - XCTAssertEqual(form["emoji"], parameters["emoji"], "emoji parameter value should match form value") - } else { - XCTFail("form parameter in JSON should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } - - func testPOSTRequestWithBase64EncodedImages() { - // Given - let URLString = "https://httpbin.org/post" - - let pngBase64EncodedString: String = { - let URL = URLForResource("unicorn", withExtension: "png") - let data = NSData(contentsOfURL: URL)! - - return data.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) - }() - - let jpegBase64EncodedString: String = { - let URL = URLForResource("rainbow", withExtension: "jpg") - let data = NSData(contentsOfURL: URL)! - - return data.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) - }() - - let parameters = [ - "email": "user@alamofire.org", - "png_image": pngBase64EncodedString, - "jpeg_image": jpegBase64EncodedString - ] - - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.POST, URLString, parameters: parameters) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - if let - JSON = response.result.value as? [String: AnyObject], - form = JSON["form"] as? [String: String] - { - XCTAssertEqual(form["email"], parameters["email"], "email parameter value should match form value") - XCTAssertEqual(form["png_image"], parameters["png_image"], "png_image parameter value should match form value") - XCTAssertEqual(form["jpeg_image"], parameters["jpeg_image"], "jpeg_image parameter value should match form value") - } else { - XCTFail("form parameter in JSON should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -extension Request { - private func preValidate(operation: Void -> Void) -> Self { - delegate.queue.addOperationWithBlock { - operation() - } - - return self - } - - private func postValidate(operation: Void -> Void) -> Self { - delegate.queue.addOperationWithBlock { - operation() - } - - return self - } -} - -// MARK: - - -class RequestExtensionTestCase: BaseTestCase { - func testThatRequestExtensionHasAccessToTaskDelegateQueue() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("GET request should succeed: \(URLString)") - - var responses: [String] = [] - - // When - Alamofire.request(.GET, URLString) - .preValidate { - responses.append("preValidate") - } - .validate() - .postValidate { - responses.append("postValidate") - } - .response { _, _, _, _ in - responses.append("response") - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if responses.count == 3 { - XCTAssertEqual(responses[0], "preValidate", "response at index 0 should be preValidate") - XCTAssertEqual(responses[1], "postValidate", "response at index 1 should be postValidate") - XCTAssertEqual(responses[2], "response", "response at index 2 should be response") - } else { - XCTFail("responses count should be equal to 3") - } - } -} - -// MARK: - - -class RequestDescriptionTestCase: BaseTestCase { - func testRequestDescription() { - // Given - let URLString = "https://httpbin.org/get" - let request = Alamofire.request(.GET, URLString) - let initialRequestDescription = request.description - - let expectation = expectationWithDescription("Request description should update: \(URLString)") - - var finalRequestDescription: String? - var response: NSHTTPURLResponse? - - // When - request.response { _, responseResponse, _, _ in - finalRequestDescription = request.description - response = responseResponse - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(initialRequestDescription, "GET https://httpbin.org/get", "incorrect request description") - XCTAssertEqual( - finalRequestDescription ?? "", - "GET https://httpbin.org/get (\(response?.statusCode ?? -1))", - "incorrect request description" - ) - } -} - -// MARK: - - -class RequestDebugDescriptionTestCase: BaseTestCase { - // MARK: Properties - - let manager: Manager = { - let manager = Manager(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) - manager.startRequestsImmediately = false - return manager - }() - - let managerDisallowingCookies: Manager = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPShouldSetCookies = false - - let manager = Manager(configuration: configuration) - manager.startRequestsImmediately = false - - return manager - }() - - // MARK: Tests - - func testGETRequestDebugDescription() { - // Given - let URLString = "https://httpbin.org/get" - - // When - let request = manager.request(.GET, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertFalse(components.contains("-X"), "command should not contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - // When - let request = manager.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestWithJSONParametersDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - // When - let request = manager.request(.POST, URLString, parameters: ["foo": "bar"], encoding: .JSON) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertTrue( - request.debugDescription.rangeOfString("-H \"Content-Type: application/json\"") != nil, - "command should contain 'application/json' Content-Type" - ) - XCTAssertTrue( - request.debugDescription.rangeOfString("-d \"{\\\"foo\\\":\\\"bar\\\"}\"") != nil, - "command data should contain JSON encoded parameters" - ) - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestWithCookieDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - let properties = [ - NSHTTPCookieDomain: "httpbin.org", - NSHTTPCookiePath: "/post", - NSHTTPCookieName: "foo", - NSHTTPCookieValue: "bar", - ] - - let cookie = NSHTTPCookie(properties: properties)! - manager.session.configuration.HTTPCookieStorage?.setCookie(cookie) - - // When - let request = manager.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - XCTAssertEqual(components[5..<6], ["-b"], "command should contain -b flag") - } - - func testPOSTRequestWithCookiesDisabledDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - let properties = [ - NSHTTPCookieDomain: "httpbin.org", - NSHTTPCookiePath: "/post", - NSHTTPCookieName: "foo", - NSHTTPCookieValue: "bar", - ] - - let cookie = NSHTTPCookie(properties: properties)! - managerDisallowingCookies.session.configuration.HTTPCookieStorage?.setCookie(cookie) - - // When - let request = managerDisallowingCookies.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - let cookieComponents = components.filter { $0 == "-b" } - XCTAssertTrue(cookieComponents.isEmpty, "command should not contain -b flag") - } - - func testThatRequestWithInvalidURLDebugDescription() { - // Given - let URLString = "invalid_url" - - // When - let request = manager.request(.GET, URLString) - let debugDescription = request.debugDescription - - // Then - XCTAssertNotNil(debugDescription, "debugDescription should not crash") - } - - // MARK: Test Helper Methods - - private func cURLCommandComponents(request: Request) -> [String] { - let whitespaceCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet() - return request.debugDescription.componentsSeparatedByCharactersInSet(whitespaceCharacterSet) - .filter { $0 != "" && $0 != "\\" } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer deleted file mode 100644 index b5ae743..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer deleted file mode 100644 index 38596c5..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer deleted file mode 100644 index edd135c..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer deleted file mode 100644 index af5e484..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer deleted file mode 100644 index 9e4ef3c..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer deleted file mode 100644 index 39828eb..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer deleted file mode 100644 index 1acfcfc..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer deleted file mode 100644 index 709889d..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer deleted file mode 100644 index 01c404b..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer deleted file mode 100644 index a5da56d..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer deleted file mode 100644 index 80838d4..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer deleted file mode 100644 index 959a5d8..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer deleted file mode 100644 index 14866ee..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer deleted file mode 100644 index e5e2343..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer deleted file mode 100644 index 6779096..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer deleted file mode 100644 index d22b9ab..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID9DCCAtygAwIBAgIJAIqBVOBRW4qMMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoT -IVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZTAeFw0xNTEyMTEwMjA5 -MDlaFw0xNjEyMTAwMjA5MDlaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTER -MA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVz -IGluIEFsYW1vRmlyZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJy9 -FTR4QzhYyo2v2yv8SwlBQ32MHQF8Ez1J+YBsyZjcTVOGJtyPxrbJxGuRhyDzKUqz -X/zTsT+JPvZQXXBmyq0l0DhCcK84cHyVLcdEAzukam85EpJRWzSg8kDKzuTx2oLk -X8Zdcj7EEtYWV/5+/YahM4tXYhg+Lqm6koJEVHMld6zfedC7HN+jsTb73IrAY0dd -BPl7WPgDIPEl0kcGI6F7NS0+CKsgX412E5+TGUkvA8VI+e9+cn/EXBdklVQQGSOu -rHpcoOi1VqnQI0hGXlFi4MpamwMG2yArIUU0TXZ7G+/AbUYiGdB6ogvg5UTCfyZy -UXVljSJyzYmLs7hXQK8CAwEAAaOBvjCBuzAdBgNVHQ4EFgQU9EaWHrJGYvpCEW5f -CUEMRk9DlN8wgYsGA1UdIwSBgzCBgIAU9EaWHrJGYvpCEW5fCUEMRk9DlN+hXaRb -MFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkx -KjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZYIJAIqB -VOBRW4qMMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEeHeXNZGHJW -VImbOHrYmSsZ5jFnzjGw8ynkOrcoJzaxg3OHoo/pNCQ7KcrIa5YPNFiNoaSa/Lzn -LBt6HkM1Vi1rMaERHLWp/W5ruInCu4CuVtQshdNcOEofJ03wdrQylOBZq8MZkTVn -NcqUFg/sBANM/9WhafVi7XaUjWl+V7ZnzdbKP/ywvsiJ+wyKMA7Wt19HMrV2dTBz -CD4vxpwOBev0oTp2NvAHdgNkeK52skHoz+MY8uivVJQr4hqLYJPXUyAcVZCaqeK/ -hxDkbRo6eZsYcjTRqMKtGMVjHHd8alXcVJwcuWkhUYxy8jRf0kFj/9mMie9jRokJ -ovKLbNJfEbI= ------END CERTIFICATE----- diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt deleted file mode 100644 index d22b9ab..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID9DCCAtygAwIBAgIJAIqBVOBRW4qMMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoT -IVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZTAeFw0xNTEyMTEwMjA5 -MDlaFw0xNjEyMTAwMjA5MDlaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTER -MA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVz -IGluIEFsYW1vRmlyZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJy9 -FTR4QzhYyo2v2yv8SwlBQ32MHQF8Ez1J+YBsyZjcTVOGJtyPxrbJxGuRhyDzKUqz -X/zTsT+JPvZQXXBmyq0l0DhCcK84cHyVLcdEAzukam85EpJRWzSg8kDKzuTx2oLk -X8Zdcj7EEtYWV/5+/YahM4tXYhg+Lqm6koJEVHMld6zfedC7HN+jsTb73IrAY0dd -BPl7WPgDIPEl0kcGI6F7NS0+CKsgX412E5+TGUkvA8VI+e9+cn/EXBdklVQQGSOu -rHpcoOi1VqnQI0hGXlFi4MpamwMG2yArIUU0TXZ7G+/AbUYiGdB6ogvg5UTCfyZy -UXVljSJyzYmLs7hXQK8CAwEAAaOBvjCBuzAdBgNVHQ4EFgQU9EaWHrJGYvpCEW5f -CUEMRk9DlN8wgYsGA1UdIwSBgzCBgIAU9EaWHrJGYvpCEW5fCUEMRk9DlN+hXaRb -MFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkx -KjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZYIJAIqB -VOBRW4qMMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEeHeXNZGHJW -VImbOHrYmSsZ5jFnzjGw8ynkOrcoJzaxg3OHoo/pNCQ7KcrIa5YPNFiNoaSa/Lzn -LBt6HkM1Vi1rMaERHLWp/W5ruInCu4CuVtQshdNcOEofJ03wdrQylOBZq8MZkTVn -NcqUFg/sBANM/9WhafVi7XaUjWl+V7ZnzdbKP/ywvsiJ+wyKMA7Wt19HMrV2dTBz -CD4vxpwOBev0oTp2NvAHdgNkeK52skHoz+MY8uivVJQr4hqLYJPXUyAcVZCaqeK/ -hxDkbRo6eZsYcjTRqMKtGMVjHHd8alXcVJwcuWkhUYxy8jRf0kFj/9mMie9jRokJ -ovKLbNJfEbI= ------END CERTIFICATE----- diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der deleted file mode 100644 index 969657d..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt b/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt deleted file mode 100644 index 23d1360..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg b/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg deleted file mode 100644 index 9122468..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png b/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png deleted file mode 100644 index bc504e5..0000000 Binary files a/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png and /dev/null differ diff --git a/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift deleted file mode 100644 index e65d41a..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift +++ /dev/null @@ -1,591 +0,0 @@ -// ResponseSerializationTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ResponseSerializationTestCase: BaseTestCase { - let error = NSError(domain: Error.Domain, code: -10000, userInfo: nil) - - // MARK: - Data Response Serializer Tests - - func testThatDataResponseSerializerSucceedsWhenDataIsNotNil() { - // Given - let serializer = Request.dataResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatDataResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.dataResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.DataSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.dataResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.dataResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.DataSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.dataResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let data = result.value { - XCTAssertEqual(data.length, 0, "data length should be zero") - } - } - - // MARK: - String Response Serializer Tests - - func testThatStringResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerSucceedsWhenDataIsEmpty() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataAndNoProvidedEncoding() { - let serializer = Request.stringResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataAndUTF8ProvidedEncoding() { - let serializer = Request.stringResponseSerializer(encoding: NSUTF8StringEncoding) - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataUsingResponseTextEncodingName() { - let serializer = Request.stringResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - let response = NSHTTPURLResponse( - URL: NSURL(string: "https://httpbin.org/get")!, - statusCode: 200, - HTTPVersion: "HTTP/1.1", - headerFields: ["Content-Type": "image/jpeg; charset=utf-8"] - ) - - // When - let result = serializer.serializeResponse(nil, response, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerFailsWithUTF32DataAndUTF8ProvidedEncoding() { - // Given - let serializer = Request.stringResponseSerializer(encoding: NSUTF8StringEncoding) - let data = "random data".dataUsingEncoding(NSUTF32StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWithUTF32DataAndUTF8ResponseEncoding() { - // Given - let serializer = Request.stringResponseSerializer() - let data = "random data".dataUsingEncoding(NSUTF32StringEncoding)! - let response = NSHTTPURLResponse( - URL: NSURL(string: "https://httpbin.org/get")!, - statusCode: 200, - HTTPVersion: "HTTP/1.1", - headerFields: ["Content-Type": "image/jpeg; charset=utf-8"] - ) - - // When - let result = serializer.serializeResponse(nil, response, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.stringResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.stringResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let string = result.value { - XCTAssertEqual(string, "", "string should be equal to empty string") - } - } - - // MARK: - JSON Response Serializer Tests - - func testThatJSONResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenDataIsEmpty() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerSucceedsWhenDataIsValidJSON() { - // Given - let serializer = Request.stringResponseSerializer() - let data = "{\"json\": true}".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatJSONResponseSerializerFailsWhenDataIsInvalidJSON() { - // Given - let serializer = Request.JSONResponseSerializer() - let data = "definitely not valid json".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, NSCocoaErrorDomain, "error domain should match expected value") - XCTAssertEqual(error.code, 3840, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.JSONResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.JSONResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let json = result.value as? NSNull { - XCTAssertEqual(json, NSNull(), "json should be equal to NSNull") - } - } - - // MARK: - Property List Response Serializer Tests - - func testThatPropertyListResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsEmpty() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerSucceedsWhenDataIsValidPropertyListData() { - // Given - let serializer = Request.propertyListResponseSerializer() - let data = NSKeyedArchiver.archivedDataWithRootObject(["foo": "bar"]) - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsInvalidPropertyListData() { - // Given - let serializer = Request.propertyListResponseSerializer() - let data = "definitely not valid plist data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, NSCocoaErrorDomain, "error domain should match expected value") - XCTAssertEqual(error.code, 3840, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.propertyListResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.propertyListResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let plist = result.value as? NSNull { - XCTAssertEqual(plist, NSNull(), "plist should be equal to NSNull") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift deleted file mode 100644 index 66659a5..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift +++ /dev/null @@ -1,533 +0,0 @@ -// ResponseTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ResponseDataTestCase: BaseTestCase { - func testThatResponseDataReturnsSuccessResultWithValidData() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseData { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseDataReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseData { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class ResponseStringTestCase: BaseTestCase { - func testThatResponseStringReturnsSuccessResultWithValidString() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseString { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseStringReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseString { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class ResponseJSONTestCase: BaseTestCase { - func testThatResponseJSONReturnsSuccessResultWithValidJSON() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseStringReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseJSONReturnsSuccessResultForGETRequest() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let args = response.result.value?["args" as NSString] as? [String: String] { - XCTAssertEqual(args, ["foo": "bar"], "args should match parameters") - } else { - XCTFail("args should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseJSONReturnsSuccessResultForPOSTRequest() { - // Given - let URLString = "https://httpbin.org/post" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.POST, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let form = response.result.value?["form" as NSString] as? [String: String] { - XCTAssertEqual(form, ["foo": "bar"], "form should match parameters") - } else { - XCTFail("form should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class RedirectResponseTestCase: BaseTestCase { - - // MARK: Setup and Teardown - - override func tearDown() { - super.tearDown() - Alamofire.Manager.sharedInstance.delegate.taskWillPerformHTTPRedirection = nil - } - - // MARK: Tests - - func testThatRequestWillPerformHTTPRedirectionByDefault() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatRequestWillPerformRedirectionMultipleTimesByDefault() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect/5" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatTaskOverrideClosureCanPerformHTTPRedirection() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - - delegate.taskWillPerformHTTPRedirection = { _, _, _, request in - return request - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatTaskOverrideClosureCanCancelHTTPRedirection() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should not redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - - delegate.taskWillPerformHTTPRedirection = { _, _, _, _ in - return nil - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", URLString, "response URL should match the origin URL") - XCTAssertEqual(response?.statusCode ?? -1, 302, "response should have a 302 status code") - } - - func testThatTaskOverrideClosureIsCalledMultipleTimesForMultipleHTTPRedirects() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect/5" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - var totalRedirectCount = 0 - - delegate.taskWillPerformHTTPRedirection = { _, _, _, request in - ++totalRedirectCount - return request - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - XCTAssertEqual(totalRedirectCount, 5, "total redirect count should be 5") - } - - func testThatRedirectedRequestContainsAllHeadersFromOriginalRequest() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - let headers = [ - "Authorization": "1234", - "Custom-Header": "foobar", - ] - - // NOTE: It appears that most headers are maintained during a redirect with the exception of the `Authorization` - // header. It appears that Apple's strips the `Authorization` header from the redirected URL request. If you - // need to maintain the `Authorization` header, you need to manually append it to the redirected request. - - let manager = Manager(configuration: NSURLSessionConfiguration.ephemeralSessionConfiguration()) - - manager.delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var redirectedRequest = request - - if let - originalRequest = task.originalRequest, - headers = originalRequest.allHTTPHeaderFields, - authorizationHeaderValue = headers["Authorization"] - { - let mutableRequest = request.mutableCopy() as! NSMutableURLRequest - mutableRequest.setValue(authorizationHeaderValue, forHTTPHeaderField: "Authorization") - redirectedRequest = mutableRequest - } - - return redirectedRequest - } - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var response: Response? - - // When - manager.request(.GET, URLString, headers: headers) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertNotNil(response?.data, "data should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "response result should be a success") - - if let - JSON = response?.result.value as? [String: AnyObject], - headers = JSON["headers"] as? [String: String] - { - XCTAssertEqual(headers["Custom-Header"], "foobar", "Custom-Header should be equal to foobar") - XCTAssertEqual(headers["Authorization"], "1234", "Authorization header should be equal to 1234") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift b/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift deleted file mode 100644 index 4b1f002..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift +++ /dev/null @@ -1,145 +0,0 @@ -// ResultTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import XCTest - -class ResultTestCase: BaseTestCase { - let error = Error.errorWithCode(.StatusCodeValidationFailed, failureReason: "Status code validation failed") - - // MARK: - Is Success Tests - - func testThatIsSuccessPropertyReturnsTrueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true for success case") - } - - func testThatIsSuccessPropertyReturnsFalseForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertFalse(result.isSuccess, "result is success should be true for failure case") - } - - // MARK: - Is Failure Tests - - func testThatIsFailurePropertyReturnsFalseForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertFalse(result.isFailure, "result is failure should be false for success case") - } - - func testThatIsFailurePropertyReturnsTrueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true for failure case") - } - - // MARK: - Value Tests - - func testThatValuePropertyReturnsValueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertEqual(result.value ?? "", "success", "result value should match expected value") - } - - func testThatValuePropertyReturnsNilForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertNil(result.value, "result value should be nil for failure case") - } - - // MARK: - Error Tests - - func testThatErrorPropertyReturnsNilForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertTrue(result.error == nil, "result error should be nil for success case") - } - - func testThatErrorPropertyReturnsErrorForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertTrue(result.error != nil, "result error should not be nil for failure case") - } - - // MARK: - Description Tests - - func testThatDescriptionStringMatchesExpectedValueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertEqual(result.description, "SUCCESS", "result description should match expected value for success case") - } - - func testThatDescriptionStringMatchesExpectedValueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertEqual(result.description, "FAILURE", "result description should match expected value for failure case") - } - - // MARK: - Debug Description Tests - - func testThatDebugDescriptionStringMatchesExpectedValueForSuccessCase() { - // Given, When - let result = Result.Success("success value") - - // Then - XCTAssertEqual( - result.debugDescription, - "SUCCESS: success value", - "result debug description should match expected value for success case" - ) - } - - func testThatDebugDescriptionStringMatchesExpectedValueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertEqual( - result.debugDescription, - "FAILURE: \(error)", - "result debug description should match expected value for failure case" - ) - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift b/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift deleted file mode 100644 index 2c24188..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift +++ /dev/null @@ -1,1418 +0,0 @@ -// MultipartFormDataTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -private struct TestCertificates { - // Root Certificates - static let RootCA = TestCertificates.certificateWithFileName("alamofire-root-ca") - - // Intermediate Certificates - static let IntermediateCA1 = TestCertificates.certificateWithFileName("alamofire-signing-ca1") - static let IntermediateCA2 = TestCertificates.certificateWithFileName("alamofire-signing-ca2") - - // Leaf Certificates - Signed by CA1 - static let LeafWildcard = TestCertificates.certificateWithFileName("wildcard.alamofire.org") - static let LeafMultipleDNSNames = TestCertificates.certificateWithFileName("multiple-dns-names") - static let LeafSignedByCA1 = TestCertificates.certificateWithFileName("signed-by-ca1") - static let LeafDNSNameAndURI = TestCertificates.certificateWithFileName("test.alamofire.org") - - // Leaf Certificates - Signed by CA2 - static let LeafExpired = TestCertificates.certificateWithFileName("expired") - static let LeafMissingDNSNameAndURI = TestCertificates.certificateWithFileName("missing-dns-name-and-uri") - static let LeafSignedByCA2 = TestCertificates.certificateWithFileName("signed-by-ca2") - static let LeafValidDNSName = TestCertificates.certificateWithFileName("valid-dns-name") - static let LeafValidURI = TestCertificates.certificateWithFileName("valid-uri") - - static func certificateWithFileName(fileName: String) -> SecCertificate { - class Bundle {} - let filePath = NSBundle(forClass: Bundle.self).pathForResource(fileName, ofType: "cer")! - let data = NSData(contentsOfFile: filePath)! - let certificate = SecCertificateCreateWithData(nil, data)! - - return certificate - } -} - -// MARK: - - -private struct TestPublicKeys { - // Root Public Keys - static let RootCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.RootCA) - - // Intermediate Public Keys - static let IntermediateCA1 = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA1) - static let IntermediateCA2 = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA2) - - // Leaf Public Keys - Signed by CA1 - static let LeafWildcard = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafWildcard) - static let LeafMultipleDNSNames = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafMultipleDNSNames) - static let LeafSignedByCA1 = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafSignedByCA1) - static let LeafDNSNameAndURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafDNSNameAndURI) - - // Leaf Public Keys - Signed by CA2 - static let LeafExpired = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafExpired) - static let LeafMissingDNSNameAndURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafMissingDNSNameAndURI) - static let LeafSignedByCA2 = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafSignedByCA2) - static let LeafValidDNSName = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafValidDNSName) - static let LeafValidURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafValidURI) - - static func publicKeyForCertificate(certificate: SecCertificate) -> SecKey { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificate, policy, &trust) - - let publicKey = SecTrustCopyPublicKey(trust!)! - - return publicKey - } -} - -// MARK: - - -private enum TestTrusts { - // Leaf Trusts - Signed by CA1 - case LeafWildcard - case LeafMultipleDNSNames - case LeafSignedByCA1 - case LeafDNSNameAndURI - - // Leaf Trusts - Signed by CA2 - case LeafExpired - case LeafMissingDNSNameAndURI - case LeafSignedByCA2 - case LeafValidDNSName - case LeafValidURI - - // Invalid Trusts - case LeafValidDNSNameMissingIntermediate - case LeafValidDNSNameWithIncorrectIntermediate - - var trust: SecTrust { - let trust: SecTrust - - switch self { - case .LeafWildcard: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafWildcard, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafMultipleDNSNames: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafMultipleDNSNames, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafSignedByCA1: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafSignedByCA1, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafDNSNameAndURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafExpired: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafExpired, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafMissingDNSNameAndURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafMissingDNSNameAndURI, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafSignedByCA2: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafSignedByCA2, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafValidDNSName: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafValidURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidURI, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case LeafValidDNSNameMissingIntermediate: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.RootCA - ]) - case LeafValidDNSNameWithIncorrectIntermediate: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - } - - return trust - } - - static func trustWithCertificates(certificates: [SecCertificate]) -> SecTrust { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificates, policy, &trust) - - return trust! - } -} - -// MARK: - Basic X509 and SSL Exploration Tests - - -class ServerTrustPolicyTestCase: BaseTestCase { - func setRootCertificateAsLoneAnchorCertificateForTrust(trust: SecTrust) { - SecTrustSetAnchorCertificates(trust, [TestCertificates.RootCA]) - SecTrustSetAnchorCertificatesOnly(trust, true) - } - - func trustIsValid(trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType(kSecTrustResultInvalid) - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType(kSecTrustResultUnspecified) - let proceed = SecTrustResultType(kSecTrustResultProceed) - - isValid = result == unspecified || result == proceed - } - - return isValid - } -} - -// MARK: - - -class ServerTrustPolicyExplorationBasicX509PolicyValidationTestCase: ServerTrustPolicyTestCase { - func testThatAnchoredRootCertificatePassesBasicX509ValidationWithRootInTrust() { - // Given - let trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatAnchoredRootCertificatePassesBasicX509ValidationWithoutRootInTrust() { - // Given - let trust = TestTrusts.LeafDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatCertificateMissingDNSNamePassesBasicX509Validation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatExpiredCertificateFailsBasicX509Validation() { - // Given - let trust = TestTrusts.LeafExpired.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } -} - -// MARK: - - -class ServerTrustPolicyExplorationSSLPolicyValidationTestCase: ServerTrustPolicyTestCase { - func testThatAnchoredRootCertificatePassesSSLValidationWithRootInTrust() { - // Given - let trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatAnchoredRootCertificatePassesSSLValidationWithoutRootInTrust() { - // Given - let trust = TestTrusts.LeafDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatCertificateMissingDNSNameFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } - - func testThatWildcardCertificatePassesSSLValidation() { - // Given - let trust = TestTrusts.LeafWildcard.trust // *.alamofire.org - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatDNSNameCertificatePassesSSLValidation() { - // Given - let trust = TestTrusts.LeafValidDNSName.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatURICertificateFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafValidURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } - - func testThatMultipleDNSNamesCertificatePassesSSLValidationForAllEntries() { - // Given - let trust = TestTrusts.LeafMultipleDNSNames.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [ - SecPolicyCreateSSL(true, "test.alamofire.org"), - SecPolicyCreateSSL(true, "blog.alamofire.org"), - SecPolicyCreateSSL(true, "www.alamofire.org") - ] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should not be valid") - } - - func testThatPassingNilForHostParameterAllowsCertificateMissingDNSNameToPassSSLValidation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, nil)] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should not be valid") - } - - func testThatExpiredCertificateFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafExpired.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } -} - -// MARK: - Server Trust Policy Tests - - -class ServerTrustPolicyPerformDefaultEvaluationTestCase: ServerTrustPolicyTestCase { - - // MARK: Do NOT Validate Host - - func testThatValidCertificateChainPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatNonAnchoredRootCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2 - ]) - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingDNSNameLeafCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafMissingDNSNameAndURI.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingIntermediateCertificateInChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Validate Host - - func testThatValidCertificateChainPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatNonAnchoredRootCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2 - ]) - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingDNSNameLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafMissingDNSNameAndURI.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatWildcardedLeafCertificateChainPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafWildcard.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingIntermediateCertificateInChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyPinCertificatesTestCase: ServerTrustPolicyTestCase { - - // MARK: Validate Certificate Chain Without Validating Host - - func testThatPinnedLeafCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Validate Certificate Chain and Host - - func testThatPinnedLeafCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Do NOT Validate Certificate Chain or Host - - func testThatPinnedLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainWithoutCertificateChainValidationFailsEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainWithoutCertificateChainValidationFailsEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootCertificateWithExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningMultipleCertificatesWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - - let certificates = [ - TestCertificates.LeafMultipleDNSNames, // not in certificate chain - TestCertificates.LeafSignedByCA1, // not in certificate chain - TestCertificates.LeafExpired, // in certificate chain 👍🏼👍🏼 - TestCertificates.LeafWildcard, // not in certificate chain - TestCertificates.LeafDNSNameAndURI, // not in certificate chain - ] - - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyPinPublicKeysTestCase: ServerTrustPolicyTestCase { - - // MARK: Validate Certificate Chain Without Validating Host - - func testThatPinningLeafKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningKeyNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningBackupKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA1, TestPublicKeys.IntermediateCA1, TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - // MARK: Validate Certificate Chain and Host - - func testThatPinningLeafKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningKeyNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningBackupKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA1, TestPublicKeys.IntermediateCA1, TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - // MARK: Do NOT Validate Certificate Chain or Host - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithMissingIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyWithoutCertificateChainValidationFailsEvaluationWithMissingIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithIncorrectIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameWithIncorrectIntermediate.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyDisableEvaluationTestCase: ServerTrustPolicyTestCase { - func testThatCertificateChainMissingIntermediateCertificatePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.DisableEvaluation - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredLeafCertificatePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.DisableEvaluation - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyCustomEvaluationTestCase: ServerTrustPolicyTestCase { - func testThatReturningTrueFromClosurePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.CustomEvaluation { _, _ in - return true - } - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatReturningFalseFromClosurePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.CustomEvaluation { _, _ in - return false - } - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyCertificatesInBundleTestCase: ServerTrustPolicyTestCase { - func testOnlyValidCertificatesAreDetected() { - // Given - // Files present in bundle in the form of type+encoding+extension [key|cert][DER|PEM].[cer|crt|der|key|pem] - // certDER.cer: DER-encoded well-formed certificate - // certDER.crt: DER-encoded well-formed certificate - // certDER.der: DER-encoded well-formed certificate - // certPEM.*: PEM-encoded well-formed certificates, expected to fail: Apple API only handles DER encoding - // devURandomGibberish.crt: Random data, should fail - // keyDER.der: DER-encoded key, not a certificate, should fail - - // When - let certificates = ServerTrustPolicy.certificatesInBundle( - NSBundle(forClass: ServerTrustPolicyCertificatesInBundleTestCase.self) - ) - - // Then - // Expectation: 18 well-formed certificates in the test bundle plus 4 invalid certificates. - #if os(OSX) - // For some reason, OSX is allowing all certificates to be considered valid. Need to file a - // rdar demonstrating this behavior. - XCTAssertEqual(certificates.count, 22, "Expected 22 well-formed certificates") - #else - XCTAssertEqual(certificates.count, 18, "Expected 18 well-formed certificates") - #endif - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift b/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift deleted file mode 100644 index 6a1a3ab..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift +++ /dev/null @@ -1,31 +0,0 @@ -// NSURLSessionConfiguration+AlamofireTests.swift -// -// Copyright (c) 2014–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 Foundation - -extension String { - init(count: Int, repeatedString: String) { - var value = "" - for _ in 0.. SecCertificate { - class Bundle {} - let filePath = NSBundle(forClass: Bundle.self).pathForResource(fileName, ofType: "cer")! - let data = NSData(contentsOfFile: filePath)! - let certificate = SecCertificateCreateWithData(nil, data)! - - return certificate - } -} - -// MARK: - - -private struct TestPublicKeys { - static let RootCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.RootCA) - static let IntermediateCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA) - static let Leaf = TestPublicKeys.publicKeyForCertificate(TestCertificates.Leaf) - - static func publicKeyForCertificate(certificate: SecCertificate) -> SecKey { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificate, policy, &trust) - - let publicKey = SecTrustCopyPublicKey(trust!)! - - return publicKey - } -} - -// MARK: - - -class TLSEvaluationExpiredLeafCertificateTestCase: BaseTestCase { - let URL = "https://testssl-expire.disig.sk/" - let host = "testssl-expire.disig.sk" - var configuration: NSURLSessionConfiguration! - - // MARK: Setup and Teardown - - override func setUp() { - super.setUp() - configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - } - - // MARK: Default Behavior Tests - - func testThatExpiredCertificateRequestFailsWithNoServerTrustPolicy() { - // Given - weak var expectation = expectationWithDescription("\(URL)") - let manager = Manager(configuration: configuration) - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorServerCertificateUntrusted, "code should be untrusted server certficate") - } else { - XCTFail("error should be an NSError") - } - } - - // MARK: Server Trust Policy - Perform Default Tests - - func testThatExpiredCertificateRequestFailsWithDefaultServerTrustPolicy() { - // Given - let policies = [host: ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true)] - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - // MARK: Server Trust Policy - Certificate Pinning Tests - - func testThatExpiredCertificateRequestFailsWhenPinningLeafCertificateWithCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestFailsWhenPinningAllCertificatesWithCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf, TestCertificates.IntermediateCA, TestCertificates.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningLeafCertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningIntermediateCACertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.IntermediateCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningRootCACertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Public Key Pinning Tests - - func testThatExpiredCertificateRequestFailsWhenPinningLeafPublicKeyWithCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningLeafPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningIntermediateCAPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.IntermediateCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningRootCAPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Disabling Evaluation Tests - - func testThatExpiredCertificateRequestSucceedsWhenDisablingEvaluation() { - // Given - let policies = [host: ServerTrustPolicy.DisableEvaluation] - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Custom Evaluation Tests - - func testThatExpiredCertificateRequestSucceedsWhenCustomEvaluationReturnsTrue() { - // Given - let policies = [ - host: ServerTrustPolicy.CustomEvaluation { _, _ in - // Implement a custom evaluation routine here... - return true - } - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestFailsWhenCustomEvaluationReturnsFalse() { - // Given - let policies = [ - host: ServerTrustPolicy.CustomEvaluation { _, _ in - // Implement a custom evaluation routine here... - return false - } - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift b/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift deleted file mode 100644 index 11a2d32..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift +++ /dev/null @@ -1,169 +0,0 @@ -// URLProtocolTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ProxyURLProtocol: NSURLProtocol { - - // MARK: Properties - - struct PropertyKeys { - static let HandledByForwarderURLProtocol = "HandledByProxyURLProtocol" - } - - lazy var session: NSURLSession = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - - return configuration - }() - - let session = NSURLSession(configuration: configuration, delegate: self, delegateQueue: nil) - - return session - }() - - var activeTask: NSURLSessionTask? - - // MARK: Class Request Methods - - override class func canInitWithRequest(request: NSURLRequest) -> Bool { - if NSURLProtocol.propertyForKey(PropertyKeys.HandledByForwarderURLProtocol, inRequest: request) != nil { - return false - } - - return true - } - - override class func canonicalRequestForRequest(request: NSURLRequest) -> NSURLRequest { - return request - } - - override class func requestIsCacheEquivalent(a: NSURLRequest, toRequest b: NSURLRequest) -> Bool { - return false - } - - // MARK: Loading Methods - - override func startLoading() { - let mutableRequest = request.URLRequest - NSURLProtocol.setProperty(true, forKey: PropertyKeys.HandledByForwarderURLProtocol, inRequest: mutableRequest) - - activeTask = session.dataTaskWithRequest(mutableRequest) - activeTask?.resume() - } - - override func stopLoading() { - activeTask?.cancel() - } -} - -// MARK: - - -extension ProxyURLProtocol: NSURLSessionDelegate { - - // MARK: NSURLSessionDelegate - - func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - client?.URLProtocol(self, didLoadData: data) - } - - func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let response = task.response { - client?.URLProtocol(self, didReceiveResponse: response, cacheStoragePolicy: .NotAllowed) - } - - client?.URLProtocolDidFinishLoading(self) - } -} - -// MARK: - - -class URLProtocolTestCase: BaseTestCase { - - // MARK: Setup and Teardown Methods - - override func setUp() { - super.setUp() - - let configuration = Alamofire.Manager.sharedInstance.session.configuration - - configuration.protocolClasses = [ProxyURLProtocol.self] - configuration.HTTPAdditionalHeaders = ["Session-Configuration-Header": "foo"] - } - - override func tearDown() { - super.tearDown() - - Alamofire.Manager.sharedInstance.session.configuration.protocolClasses = [] - } - - // MARK: Tests - - func testThatURLProtocolReceivesRequestHeadersAndNotSessionConfigurationHeaders() { - // Given - let URLString = "https://httpbin.org/response-headers" - let URL = NSURL(string: URLString)! - let parameters = ["request-header": "foobar"] - - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.HTTPMethod = Method.GET.rawValue - - let URLRequest = ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 - - let expectation = expectationWithDescription("GET request should succeed") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(URLRequest) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - if let headers = response?.allHeaderFields as? [String: String] { - XCTAssertEqual(headers["request-header"] ?? "", "foobar", "urlrequest-header should be foobar") - XCTAssertNil(headers["Session-Configuration-Header"], "Session-Configuration-Header should be nil") - } else { - XCTFail("headers should not be nil") - } - } -} diff --git a/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift b/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift deleted file mode 100644 index 7e2b901..0000000 --- a/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift +++ /dev/null @@ -1,766 +0,0 @@ -// UploadTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class UploadFileInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndFile() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - - // When - let request = Alamofire.upload(.POST, URLString, file: imageURL) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndFile() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], file: imageURL) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadDataInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndData() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.upload(.POST, URLString, data: NSData()) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndData() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], data: NSData()) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadStreamInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndStream() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - let imageStream = NSInputStream(URL: imageURL)! - - // When - let request = Alamofire.upload(.POST, URLString, stream: imageStream) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndStream() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - let imageStream = NSInputStream(URL: imageURL)! - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], stream: imageStream) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadDataTestCase: BaseTestCase { - func testUploadDataRequest() { - // Given - let URLString = "https://httpbin.org/post" - let data = "Lorem ipsum dolor sit amet".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let expectation = expectationWithDescription("Upload request should succeed: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var error: NSError? - - // When - Alamofire.upload(.POST, URLString, data: data) - .response { responseRequest, responseResponse, _, responseError in - request = responseRequest - response = responseResponse - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNil(error, "error should be nil") - } - - func testUploadDataRequestWithProgress() { - // Given - let URLString = "https://httpbin.org/post" - let data: NSData = { - var text = "" - for _ in 1...3_000 { - text += "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " - } - - return text.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - }() - - let expectation = expectationWithDescription("Bytes upload progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let upload = Alamofire.upload(.POST, URLString, data: data) - upload.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in - let bytes = (bytes: bytesWritten, totalBytes: totalBytesWritten, totalBytesExpected: totalBytesExpectedToWrite) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: upload.progress.completedUnitCount, - totalUnitCount: upload.progress.totalUnitCount - ) - progressValues.append(progress) - } - upload.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response response should not be nil") - XCTAssertNotNil(responseData, "response data should not be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0.. Request { - var dataTask: NSURLSessionDataTask! - - dispatch_sync(queue) { - dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) - } - - let request = MockRequest(session: session, task: dataTask) - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - } - - class MockRequest: Request { - override var response: NSHTTPURLResponse? { - return MockHTTPURLResponse( - URL: NSURL(string: request!.URLString)!, - statusCode: 204, - HTTPVersion: "HTTP/1.1", - headerFields: nil - ) - } - } - - class MockHTTPURLResponse: NSHTTPURLResponse { - override var MIMEType: String? { return nil } - } - - let manager: Manager = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - - return configuration - }() - - return MockManager(configuration: configuration) - }() - - let URLString = "https://httpbin.org/delete" - let expectation = expectationWithDescription("request should be stubbed and return 204 status code") - - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - manager.request(.DELETE, URLString) - .validate(contentType: ["*/*"]) - .response { _, responseResponse, responseData, responseError in - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - if let response = response { - XCTAssertEqual(response.statusCode, 204, "response status code should be 204") - XCTAssertNil(response.MIMEType, "response mime type should be nil") - } - } -} - -// MARK: - - -class MultipleValidationTestCase: BaseTestCase { - func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() { - // Given - let URLString = "https://httpbin.org/ip" - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponseFailsWithStatusCodeError() { - // Given - let URLString = "https://httpbin.org/xml" - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(statusCode: 400..<600) - .validate(contentType: ["application/octet-stream"]) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.StatusCodeValidationFailed.rawValue, "code should be status code validation failure") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponseFailsWithContentTypeError() { - // Given - let URLString = "https://httpbin.org/xml" - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(contentType: ["application/octet-stream"]) - .validate(statusCode: 400..<600) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.ContentTypeValidationFailed.rawValue, "code should be content type validation failure") - } else { - XCTFail("error should be an NSError") - } - } -} - -// MARK: - - -class AutomaticValidationTestCase: BaseTestCase { - func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/ip")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableStatusCodeResponseFails() { - // Given - let URLString = "https://httpbin.org/status/404" - let expectation = expectationWithDescription("request should return 404 status code") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.StatusCodeValidationFailed.rawValue, "code should be status code validation failure") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatValidationForRequestWithAcceptableWildcardContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/ip")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/*", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithAcceptableComplexContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/xml")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - - let headerValue = "text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8,*/*;q=0.5" - mutableURLRequest.setValue(headerValue, forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableContentTypeResponseFails() { - // Given - let URL = NSURL(string: "https://httpbin.org/xml")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.ContentTypeValidationFailed.rawValue, "code should be content type validation failure") - } else { - XCTFail("error should be an NSError") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/.gitignore b/Carthage/Checkouts/AlamofireImage/.gitignore deleted file mode 100644 index 222e8ec..0000000 --- a/Carthage/Checkouts/AlamofireImage/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Mac OS X -.DS_Store - -# Xcode - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -.build/ - -# Carthage -Carthage/Build diff --git a/Carthage/Checkouts/AlamofireImage/.gitmodules b/Carthage/Checkouts/AlamofireImage/.gitmodules deleted file mode 100644 index b07b6de..0000000 --- a/Carthage/Checkouts/AlamofireImage/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Carthage/Checkouts/Alamofire"] - path = Carthage/Checkouts/Alamofire - url = https://github.com/Alamofire/Alamofire.git diff --git a/Carthage/Checkouts/AlamofireImage/.travis.yml b/Carthage/Checkouts/AlamofireImage/.travis.yml deleted file mode 100644 index fefa2cd..0000000 --- a/Carthage/Checkouts/AlamofireImage/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -language: objective-c -osx_image: xcode7.2 -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - WORKSPACE=AlamofireImage.xcworkspace - - IOS_FRAMEWORK_SCHEME="AlamofireImage iOS" - - OSX_FRAMEWORK_SCHEME="AlamofireImage OSX" - - TVOS_FRAMEWORK_SCHEME="AlamofireImage tvOS" - - WATCHOS_FRAMEWORK_SCHEME="AlamofireImage watchOS" - - IOS_SDK=iphonesimulator9.2 - - OSX_SDK=macosx10.11 - - TVOS_SDK=appletvsimulator9.1 - - WATCHOS_SDK=watchsimulator2.1 - - EXAMPLE_SCHEME="iOS Example" - matrix: - - DESTINATION="OS=2.1,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="YES" - - DESTINATION="OS=9.1,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" SDK="$OSX_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - - DESTINATION="OS=9.0,name=iPad 2" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - - DESTINATION="OS=9.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.1,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - - DESTINATION="OS=9.2,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.2,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - - DESTINATION="OS=8.1,name=iPad 2" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.2,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.3,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.4,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" -before_install: - - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet -script: - - set -o pipefail - - git submodule update --init --recursive - - xcodebuild -version - - xcodebuild -showsdks - - # Build Framework in Debug and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Framework in ReleaseTest and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Debug if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Release if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Run `pod lib lint` if specified - - if [ $POD_LINT == "YES" ]; then - pod repo update master; - pod lib lint; - fi diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.podspec b/Carthage/Checkouts/AlamofireImage/AlamofireImage.podspec deleted file mode 100644 index 5f58a29..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'AlamofireImage' - s.version = '2.3.1' - s.license = 'MIT' - s.summary = 'AlamofireImage is an image component library for Alamofire' - s.homepage = 'https://github.com/Alamofire/AlamofireImage' - s.social_media_url = 'http://twitter.com/AlamofireSF' - s.authors = { 'Alamofire Software Foundation' => 'info@alamofire.org' } - - s.source = { :git => 'https://github.com/Alamofire/AlamofireImage.git', :tag => s.version } - s.source_files = 'Source/*.swift' - - s.osx.exclude_files = [ - 'Source/UIButton+AlamofireImage.swift', - 'Source/UIImage*.swift' - ] - s.watchos.exclude_files = [ - 'Source/UIButton+AlamofireImage.swift', - 'Source/UIImageView+AlamofireImage.swift' - ] - - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '2.0' - - s.dependency 'Alamofire', '~> 3.1' -end diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.pbxproj b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.pbxproj deleted file mode 100644 index 455af9c..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.pbxproj +++ /dev/null @@ -1,2711 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4C0893EC1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0893EB1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift */; }; - 4C0893F51B937404005125D9 /* UIImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0893F41B937404005125D9 /* UIImageTests.swift */; }; - 4C0894E41B9382EB005125D9 /* apple.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894501B9382EB005125D9 /* apple.jpg */; }; - 4C0894E51B9382EB005125D9 /* apple.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894501B9382EB005125D9 /* apple.jpg */; }; - 4C0894E61B9382EB005125D9 /* pirate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894511B9382EB005125D9 /* pirate.jpg */; }; - 4C0894E71B9382EB005125D9 /* pirate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894511B9382EB005125D9 /* pirate.jpg */; }; - 4C0894E81B9382EB005125D9 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894521B9382EB005125D9 /* rainbow.jpg */; }; - 4C0894E91B9382EB005125D9 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894521B9382EB005125D9 /* rainbow.jpg */; }; - 4C0894EA1B9382EB005125D9 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894531B9382EB005125D9 /* unicorn.png */; }; - 4C0894EB1B9382EB005125D9 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894531B9382EB005125D9 /* unicorn.png */; }; - 4C0897E81B93B0FB005125D9 /* huge_map.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0897E71B93B0FB005125D9 /* huge_map.jpg */; }; - 4C0897E91B93B0FB005125D9 /* huge_map.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0897E71B93B0FB005125D9 /* huge_map.jpg */; }; - 4C0897EB1B93BC0D005125D9 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0897EA1B93BC0D005125D9 /* RequestTests.swift */; }; - 4C0897EC1B93BC0D005125D9 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0897EA1B93BC0D005125D9 /* RequestTests.swift */; }; - 4C1624851AABE8E600A0385D /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1624841AABE8E600A0385D /* BaseTestCase.swift */; }; - 4C1624861AABE8E600A0385D /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1624841AABE8E600A0385D /* BaseTestCase.swift */; }; - 4C16B3871BA9399500A66EF0 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16B37D1BA9399500A66EF0 /* AlamofireImage.framework */; }; - 4C16B39C1BA93A3D00A66EF0 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16B3971BA9399500A66EF0 /* Alamofire.framework */; }; - 4C16B39F1BA93AA600A66EF0 /* AlamofireImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4C16B3A01BA93AB700A66EF0 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8290791B927CE6005E24C8 /* Image.swift */; }; - 4C16B3A11BA93AB700A66EF0 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */; }; - 4C16B3A21BA93AB700A66EF0 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */; }; - 4C16B3A31BA93AB700A66EF0 /* ImageFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */; }; - 4C16B3A41BA93AB700A66EF0 /* Request+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */; }; - 4C16B3A51BA93AB700A66EF0 /* UIImage+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C53084F1AB561BF0051DBAC /* UIImage+AlamofireImage.swift */; }; - 4C16B3A61BA93AB700A66EF0 /* UIImageView+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C78EA711AACD28C002C0569 /* UIImageView+AlamofireImage.swift */; }; - 4C16B3A71BA93ADB00A66EF0 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1624841AABE8E600A0385D /* BaseTestCase.swift */; }; - 4C16B3A81BA93ADB00A66EF0 /* ImageCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEBB53F1B93C622001391DE /* ImageCacheTests.swift */; }; - 4C16B3A91BA93ADB00A66EF0 /* ImageDownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5874851B93F81800407E58 /* ImageDownloaderTests.swift */; }; - 4C16B3AA1BA93ADB00A66EF0 /* ImageFilterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5872C91B93DEAC00407E58 /* ImageFilterTests.swift */; }; - 4C16B3AB1BA93ADB00A66EF0 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0897EA1B93BC0D005125D9 /* RequestTests.swift */; }; - 4C16B3AC1BA93ADB00A66EF0 /* UIImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0893F41B937404005125D9 /* UIImageTests.swift */; }; - 4C16B3AD1BA93ADB00A66EF0 /* UIImageViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C62D30F1B96C1500011B036 /* UIImageViewTests.swift */; }; - 4C16B3AE1BA93ADB00A66EF0 /* UIImage+AlamofireImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0893EB1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift */; }; - 4C16B3AF1BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F61B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C16B3B01BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F71B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C16B3B11BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F81B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C16B3B21BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F91B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C16B3B31BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FA1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C16B3B41BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FB1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C16B3B51BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FC1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C16B3B61BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FD1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C16B3B71BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FE1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C16B3B81BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C16B3B91BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873001B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C16B3BA1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873011B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C16B3BB1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873021B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C16B3BC1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873031B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C16B3BD1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873041B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C16B3BE1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873051B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C16B3BF1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873061B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C16B3C01BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873071B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C16B3C11BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C16B3C21BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C16B3C31BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C16B3C41BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C16B3C51BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C16B3C61BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C16B3C71BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730E1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C16B3C81BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730F1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C16B3C91BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873101B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C16B3CA1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C16B3CB1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C16B3CC1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C16B3CD1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C16B3CE1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C16B3CF1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C16B3D01BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C16B3D11BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C16B3D21BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C16B3D31BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png */; }; - 4C16B3D41BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png */; }; - 4C16B3D51BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png */; }; - 4C16B3D61BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C16B3D71BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873201B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C16B3D81BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873211B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C16B3D91BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873231B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C16B3DA1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873241B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C16B3DB1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873251B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C16B3DC1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873261B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C16B3DD1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873271B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C16B3DE1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873281B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C16B3DF1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873291B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C16B3E01BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732A1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C16B3E11BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732B1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C16B3E21BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C16B3E31BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C16B3E41BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C16B3E51BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C16B3E61BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873301B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C16B3E71BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873311B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C16B3E81BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873321B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C16B3E91BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873331B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C16B3EA1BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873341B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C16B3EB1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873351B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C16B3EC1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873361B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C16B3ED1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873371B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C16B3EE1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873381B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C16B3EF1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873391B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C16B3F01BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C16B3F11BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C16B3F21BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C16B3F31BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C16B3F41BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C16B3F51BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C16B3F61BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873401B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C16B3F71BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873411B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C16B3F81BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873421B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C16B3F91BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873431B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C16B3FA1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873441B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C16B3FB1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873451B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C16B3FC1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873461B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C16B3FD1BA93AEF00A66EF0 /* apple-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873481B93EFFB00407E58 /* apple-circle.png */; }; - 4C16B3FE1BA93AEF00A66EF0 /* pirate-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873491B93EFFB00407E58 /* pirate-circle.png */; }; - 4C16B3FF1BA93AEF00A66EF0 /* rainbow-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734A1B93EFFB00407E58 /* rainbow-circle.png */; }; - 4C16B4001BA93AEF00A66EF0 /* unicorn-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734B1B93EFFB00407E58 /* unicorn-circle.png */; }; - 4C16B4021BA93AEF00A66EF0 /* unicorn-sepia.tone.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734E1B93EFFB00407E58 /* unicorn-sepia.tone.png */; }; - 4C16B4031BA93AF200A66EF0 /* apple-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873501B93EFFB00407E58 /* apple-radius-20.png */; }; - 4C16B4041BA93AF200A66EF0 /* pirate-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873511B93EFFB00407E58 /* pirate-radius-20.png */; }; - 4C16B4051BA93AF200A66EF0 /* rainbow-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873521B93EFFB00407E58 /* rainbow-radius-20.png */; }; - 4C16B4061BA93AF200A66EF0 /* unicorn-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873531B93EFFB00407E58 /* unicorn-radius-20.png */; }; - 4C16B4071BA93AFD00A66EF0 /* apple-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873551B93EFFB00407E58 /* apple-scaled-30x60-@1x.png */; }; - 4C16B4081BA93AFD00A66EF0 /* apple-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873561B93EFFB00407E58 /* apple-scaled-30x60-@2x.png */; }; - 4C16B4091BA93AFD00A66EF0 /* apple-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873571B93EFFB00407E58 /* apple-scaled-30x60-@3x.png */; }; - 4C16B40A1BA93AFD00A66EF0 /* apple-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873581B93EFFB00407E58 /* apple-scaled-50x50-@1x.png */; }; - 4C16B40B1BA93AFD00A66EF0 /* apple-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873591B93EFFB00407E58 /* apple-scaled-50x50-@2x.png */; }; - 4C16B40C1BA93AFD00A66EF0 /* apple-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735A1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png */; }; - 4C16B40D1BA93AFD00A66EF0 /* apple-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735B1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png */; }; - 4C16B40E1BA93AFD00A66EF0 /* apple-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735C1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png */; }; - 4C16B40F1BA93AFD00A66EF0 /* apple-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735D1B93EFFB00407E58 /* apple-scaled-60x30-@3x.png */; }; - 4C16B4101BA93AFD00A66EF0 /* pirate-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735E1B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png */; }; - 4C16B4111BA93AFD00A66EF0 /* pirate-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735F1B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png */; }; - 4C16B4121BA93AFD00A66EF0 /* pirate-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873601B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png */; }; - 4C16B4131BA93AFD00A66EF0 /* pirate-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873611B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png */; }; - 4C16B4141BA93AFD00A66EF0 /* pirate-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873621B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png */; }; - 4C16B4151BA93AFD00A66EF0 /* pirate-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873631B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png */; }; - 4C16B4161BA93AFD00A66EF0 /* pirate-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873641B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png */; }; - 4C16B4171BA93AFD00A66EF0 /* pirate-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873651B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png */; }; - 4C16B4181BA93AFD00A66EF0 /* pirate-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873661B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png */; }; - 4C16B4191BA93AFD00A66EF0 /* rainbow-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873671B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png */; }; - 4C16B41A1BA93AFD00A66EF0 /* rainbow-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873681B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png */; }; - 4C16B41B1BA93AFD00A66EF0 /* rainbow-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873691B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png */; }; - 4C16B41C1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736A1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png */; }; - 4C16B41D1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736B1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png */; }; - 4C16B41E1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736C1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png */; }; - 4C16B41F1BA93AFD00A66EF0 /* rainbow-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736D1B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png */; }; - 4C16B4201BA93AFD00A66EF0 /* rainbow-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736E1B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png */; }; - 4C16B4211BA93AFD00A66EF0 /* rainbow-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736F1B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png */; }; - 4C16B4221BA93AFD00A66EF0 /* unicorn-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873701B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png */; }; - 4C16B4231BA93AFD00A66EF0 /* unicorn-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873711B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png */; }; - 4C16B4241BA93AFD00A66EF0 /* unicorn-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873721B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png */; }; - 4C16B4251BA93AFD00A66EF0 /* unicorn-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873731B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png */; }; - 4C16B4261BA93AFD00A66EF0 /* unicorn-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873741B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png */; }; - 4C16B4271BA93AFD00A66EF0 /* unicorn-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873751B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png */; }; - 4C16B4281BA93AFD00A66EF0 /* unicorn-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873761B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png */; }; - 4C16B4291BA93AFD00A66EF0 /* unicorn-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873771B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png */; }; - 4C16B42A1BA93AFD00A66EF0 /* unicorn-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png */; }; - 4C16B42B1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png */; }; - 4C16B42C1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png */; }; - 4C16B42D1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png */; }; - 4C16B42E1BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737E1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C16B42F1BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C16B4301BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C16B4311BA93AFD00A66EF0 /* apple.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894501B9382EB005125D9 /* apple.jpg */; }; - 4C16B4321BA93AFD00A66EF0 /* huge_map.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0897E71B93B0FB005125D9 /* huge_map.jpg */; }; - 4C16B4331BA93AFD00A66EF0 /* pirate.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894511B9382EB005125D9 /* pirate.jpg */; }; - 4C16B4341BA93AFD00A66EF0 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894521B9382EB005125D9 /* rainbow.jpg */; }; - 4C16B4351BA93AFD00A66EF0 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C0894531B9382EB005125D9 /* unicorn.png */; }; - 4C16B4361BA93B3300A66EF0 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE611321AABC24E00D35044 /* AlamofireImage.framework */; }; - 4C16B4371BA93B4000A66EF0 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C9043771AABBFC5001B4E60 /* AlamofireImage.framework */; }; - 4C4D4EC91B9297B300C96855 /* AlamofireImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4C4D4ECA1B9297BB00C96855 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8290791B927CE6005E24C8 /* Image.swift */; }; - 4C4D4ECB1B9297BB00C96855 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */; }; - 4C4D4ECC1B9297BB00C96855 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */; }; - 4C4D4ECD1B9297BB00C96855 /* ImageFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */; }; - 4C4D4ECE1B9297BB00C96855 /* Request+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */; }; - 4C4D4ECF1B9297BB00C96855 /* UIImage+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C53084F1AB561BF0051DBAC /* UIImage+AlamofireImage.swift */; }; - 4C5308501AB561BF0051DBAC /* UIImage+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C53084F1AB561BF0051DBAC /* UIImage+AlamofireImage.swift */; }; - 4C54EE911AABC04900CD894C /* AlamofireImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4C5872CA1B93DEAC00407E58 /* ImageFilterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5872C91B93DEAC00407E58 /* ImageFilterTests.swift */; }; - 4C5873811B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F61B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873821B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F61B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873831B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F71B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873841B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F71B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873851B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F81B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873861B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F81B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873871B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F91B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873881B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872F91B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873891B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FA1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C58738A1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FA1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C58738B1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FB1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C58738C1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FB1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C58738D1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FC1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C58738E1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FC1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C58738F1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FD1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873901B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FD1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873911B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FE1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873921B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FE1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873931B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873941B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5872FF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873951B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873001B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873961B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873001B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873971B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873011B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873981B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873011B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873991B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873021B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C58739A1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873021B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C58739B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873031B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C58739C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873031B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C58739D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873041B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C58739E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873041B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C58739F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873051B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873A01B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873051B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873A11B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873061B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873A21B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873061B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873A31B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873071B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873A41B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873071B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873A51B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873A61B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873A71B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873A81B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873A91B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873AA1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873AB1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873AC1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873AD1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C5873AE1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C5873AF1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C5873B01B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C5873B11B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730E1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873B21B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730E1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873B31B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730F1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873B41B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58730F1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873B51B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873101B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873B61B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873101B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873B71B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873B81B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png */; }; - 4C5873B91B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873BA1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png */; }; - 4C5873BB1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873BC1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png */; }; - 4C5873BD1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873BE1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png */; }; - 4C5873BF1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C5873C01B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png */; }; - 4C5873C11B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C5873C21B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png */; }; - 4C5873C31B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873C41B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png */; }; - 4C5873C51B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873C61B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png */; }; - 4C5873C71B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873C81B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png */; }; - 4C5873C91B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png */; }; - 4C5873CA1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png */; }; - 4C5873CB1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png */; }; - 4C5873CC1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png */; }; - 4C5873CD1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png */; }; - 4C5873CE1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png */; }; - 4C5873CF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C5873D01B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58731F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C5873D11B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873201B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C5873D21B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873201B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C5873D31B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873211B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C5873D41B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873211B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C5873D51B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873231B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873D61B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873231B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873D71B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873241B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873D81B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873241B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873D91B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873251B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873DA1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873251B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873DB1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873261B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5873DC1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873261B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5873DD1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873271B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5873DE1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873271B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5873DF1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873281B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5873E01B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873281B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5873E11B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873291B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5873E21B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873291B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5873E31B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732A1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5873E41B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732A1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5873E51B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732B1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C5873E61B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732B1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C5873E71B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873E81B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873E91B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873EA1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873EB1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873EC1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873ED1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5873EE1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58732F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5873EF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873301B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5873F01B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873301B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5873F11B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873311B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5873F21B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873311B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5873F31B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873321B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5873F41B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873321B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5873F51B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873331B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5873F61B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873331B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5873F71B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873341B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C5873F81B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873341B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C5873F91B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873351B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873FA1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873351B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C5873FB1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873361B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873FC1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873361B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C5873FD1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873371B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873FE1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873371B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5873FF1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873381B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5874001B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873381B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5874011B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873391B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5874021B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873391B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5874031B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5874041B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5874051B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5874061B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5874071B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5874081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C5874091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C58740A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C58740B1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C58740C1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png */; }; - 4C58740D1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C58740E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58733F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png */; }; - 4C58740F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873401B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5874101B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873401B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png */; }; - 4C5874111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873411B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5874121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873411B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png */; }; - 4C5874131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873421B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5874141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873421B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png */; }; - 4C5874151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873431B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5874161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873431B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png */; }; - 4C5874171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873441B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5874181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873441B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png */; }; - 4C5874191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873451B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C58741A1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873451B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png */; }; - 4C58741B1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873461B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C58741C1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873461B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png */; }; - 4C58741D1B93EFFB00407E58 /* apple-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873481B93EFFB00407E58 /* apple-circle.png */; }; - 4C58741E1B93EFFB00407E58 /* apple-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873481B93EFFB00407E58 /* apple-circle.png */; }; - 4C58741F1B93EFFB00407E58 /* pirate-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873491B93EFFB00407E58 /* pirate-circle.png */; }; - 4C5874201B93EFFB00407E58 /* pirate-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873491B93EFFB00407E58 /* pirate-circle.png */; }; - 4C5874211B93EFFB00407E58 /* rainbow-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734A1B93EFFB00407E58 /* rainbow-circle.png */; }; - 4C5874221B93EFFB00407E58 /* rainbow-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734A1B93EFFB00407E58 /* rainbow-circle.png */; }; - 4C5874231B93EFFB00407E58 /* unicorn-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734B1B93EFFB00407E58 /* unicorn-circle.png */; }; - 4C5874241B93EFFB00407E58 /* unicorn-circle.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734B1B93EFFB00407E58 /* unicorn-circle.png */; }; - 4C5874271B93EFFB00407E58 /* unicorn-sepia.tone.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734E1B93EFFB00407E58 /* unicorn-sepia.tone.png */; }; - 4C5874281B93EFFB00407E58 /* unicorn-sepia.tone.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58734E1B93EFFB00407E58 /* unicorn-sepia.tone.png */; }; - 4C5874291B93EFFB00407E58 /* apple-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873501B93EFFB00407E58 /* apple-radius-20.png */; }; - 4C58742A1B93EFFB00407E58 /* apple-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873501B93EFFB00407E58 /* apple-radius-20.png */; }; - 4C58742B1B93EFFB00407E58 /* pirate-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873511B93EFFB00407E58 /* pirate-radius-20.png */; }; - 4C58742C1B93EFFB00407E58 /* pirate-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873511B93EFFB00407E58 /* pirate-radius-20.png */; }; - 4C58742D1B93EFFB00407E58 /* rainbow-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873521B93EFFB00407E58 /* rainbow-radius-20.png */; }; - 4C58742E1B93EFFB00407E58 /* rainbow-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873521B93EFFB00407E58 /* rainbow-radius-20.png */; }; - 4C58742F1B93EFFB00407E58 /* unicorn-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873531B93EFFB00407E58 /* unicorn-radius-20.png */; }; - 4C5874301B93EFFB00407E58 /* unicorn-radius-20.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873531B93EFFB00407E58 /* unicorn-radius-20.png */; }; - 4C5874311B93EFFB00407E58 /* apple-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873551B93EFFB00407E58 /* apple-scaled-30x60-@1x.png */; }; - 4C5874321B93EFFB00407E58 /* apple-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873551B93EFFB00407E58 /* apple-scaled-30x60-@1x.png */; }; - 4C5874331B93EFFB00407E58 /* apple-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873561B93EFFB00407E58 /* apple-scaled-30x60-@2x.png */; }; - 4C5874341B93EFFB00407E58 /* apple-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873561B93EFFB00407E58 /* apple-scaled-30x60-@2x.png */; }; - 4C5874351B93EFFB00407E58 /* apple-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873571B93EFFB00407E58 /* apple-scaled-30x60-@3x.png */; }; - 4C5874361B93EFFB00407E58 /* apple-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873571B93EFFB00407E58 /* apple-scaled-30x60-@3x.png */; }; - 4C5874371B93EFFB00407E58 /* apple-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873581B93EFFB00407E58 /* apple-scaled-50x50-@1x.png */; }; - 4C5874381B93EFFB00407E58 /* apple-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873581B93EFFB00407E58 /* apple-scaled-50x50-@1x.png */; }; - 4C5874391B93EFFB00407E58 /* apple-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873591B93EFFB00407E58 /* apple-scaled-50x50-@2x.png */; }; - 4C58743A1B93EFFB00407E58 /* apple-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873591B93EFFB00407E58 /* apple-scaled-50x50-@2x.png */; }; - 4C58743B1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735A1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png */; }; - 4C58743C1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735A1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png */; }; - 4C58743D1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735B1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png */; }; - 4C58743E1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735B1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png */; }; - 4C58743F1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735C1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png */; }; - 4C5874401B93EFFB00407E58 /* apple-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735C1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png */; }; - 4C5874411B93EFFB00407E58 /* apple-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735D1B93EFFB00407E58 /* apple-scaled-60x30-@3x.png */; }; - 4C5874421B93EFFB00407E58 /* apple-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735D1B93EFFB00407E58 /* apple-scaled-60x30-@3x.png */; }; - 4C5874431B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735E1B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png */; }; - 4C5874441B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735E1B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png */; }; - 4C5874451B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735F1B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png */; }; - 4C5874461B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58735F1B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png */; }; - 4C5874471B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873601B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png */; }; - 4C5874481B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873601B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png */; }; - 4C5874491B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873611B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png */; }; - 4C58744A1B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873611B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png */; }; - 4C58744B1B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873621B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png */; }; - 4C58744C1B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873621B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png */; }; - 4C58744D1B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873631B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png */; }; - 4C58744E1B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873631B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png */; }; - 4C58744F1B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873641B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png */; }; - 4C5874501B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873641B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png */; }; - 4C5874511B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873651B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png */; }; - 4C5874521B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873651B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png */; }; - 4C5874531B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873661B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png */; }; - 4C5874541B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873661B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png */; }; - 4C5874551B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873671B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png */; }; - 4C5874561B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873671B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png */; }; - 4C5874571B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873681B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png */; }; - 4C5874581B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873681B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png */; }; - 4C5874591B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873691B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png */; }; - 4C58745A1B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873691B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png */; }; - 4C58745B1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736A1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png */; }; - 4C58745C1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736A1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png */; }; - 4C58745D1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736B1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png */; }; - 4C58745E1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736B1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png */; }; - 4C58745F1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736C1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png */; }; - 4C5874601B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736C1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png */; }; - 4C5874611B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736D1B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png */; }; - 4C5874621B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736D1B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png */; }; - 4C5874631B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736E1B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png */; }; - 4C5874641B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736E1B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png */; }; - 4C5874651B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736F1B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png */; }; - 4C5874661B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58736F1B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png */; }; - 4C5874671B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873701B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png */; }; - 4C5874681B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873701B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png */; }; - 4C5874691B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873711B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png */; }; - 4C58746A1B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873711B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png */; }; - 4C58746B1B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873721B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png */; }; - 4C58746C1B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873721B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png */; }; - 4C58746D1B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873731B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png */; }; - 4C58746E1B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873731B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png */; }; - 4C58746F1B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873741B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png */; }; - 4C5874701B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873741B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png */; }; - 4C5874711B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873751B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png */; }; - 4C5874721B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873751B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png */; }; - 4C5874731B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873761B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png */; }; - 4C5874741B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873761B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png */; }; - 4C5874751B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873771B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png */; }; - 4C5874761B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873771B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png */; }; - 4C5874771B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png */; }; - 4C5874781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png */; }; - 4C5874791B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png */; }; - 4C58747A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png */; }; - 4C58747B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png */; }; - 4C58747C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png */; }; - 4C58747D1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png */; }; - 4C58747E1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png */; }; - 4C58747F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737E1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C5874801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737E1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png */; }; - 4C5874811B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C5874821B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C58737F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png */; }; - 4C5874831B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C5874841B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C5873801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png */; }; - 4C5874861B93F81800407E58 /* ImageDownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5874851B93F81800407E58 /* ImageDownloaderTests.swift */; }; - 4C5874871B93F81800407E58 /* ImageDownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5874851B93F81800407E58 /* ImageDownloaderTests.swift */; }; - 4C62D3101B96C1500011B036 /* UIImageViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C62D30F1B96C1500011B036 /* UIImageViewTests.swift */; }; - 4C78EA721AACD28C002C0569 /* UIImageView+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C78EA711AACD28C002C0569 /* UIImageView+AlamofireImage.swift */; }; - 4C8290781B926F19005E24C8 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */; }; - 4C82907A1B927CE6005E24C8 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8290791B927CE6005E24C8 /* Image.swift */; }; - 4C82907B1B927CE6005E24C8 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8290791B927CE6005E24C8 /* Image.swift */; }; - 4C82907C1B927D13005E24C8 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */; }; - 4C82907D1B927DA9005E24C8 /* ImageFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */; }; - 4C96A4781AAE9488008AE0B6 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */; }; - 4CB2DBE61C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE31C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png */; }; - 4CB2DBE71C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE31C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png */; }; - 4CB2DBE81C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE31C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png */; }; - 4CB2DBE91C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE41C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png */; }; - 4CB2DBEA1C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE41C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png */; }; - 4CB2DBEB1C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE41C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png */; }; - 4CB2DBEC1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE51C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png */; }; - 4CB2DBED1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE51C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png */; }; - 4CB2DBEE1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */ = {isa = PBXBuildFile; fileRef = 4CB2DBE51C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png */; }; - 4CE5AABB1B9BF104003530D6 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE5AAAF1B9BF09A003530D6 /* Alamofire.framework */; }; - 4CE5AABE1B9BF111003530D6 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE5AAAF1B9BF09A003530D6 /* Alamofire.framework */; }; - 4CE5AAC11B9BF11F003530D6 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE5AAAF1B9BF09A003530D6 /* Alamofire.framework */; }; - 4CE6112C1AABC24E00D35044 /* AlamofireImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CE611551AABC8D900D35044 /* Request+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */; }; - 4CE611561AABC8D900D35044 /* Request+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */; }; - 4CEBB5401B93C622001391DE /* ImageCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEBB53F1B93C622001391DE /* ImageCacheTests.swift */; }; - 4CEBB5411B93C622001391DE /* ImageCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEBB53F1B93C622001391DE /* ImageCacheTests.swift */; }; - 4CFC0A061AB4FEC90004D0B8 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */; }; - 4CFC0A091AB52BD90004D0B8 /* ImageFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */; }; - CF24CF421C253CB100904E85 /* UIButton+AlamofireImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF24CF411C253CB100904E85 /* UIButton+AlamofireImage.swift */; }; - CF24CF461C253D4F00904E85 /* UIButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF24CF3C1C253CA000904E85 /* UIButtonTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4C16B3881BA9399500A66EF0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C90436E1AABBFC5001B4E60 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4C16B37C1BA9399500A66EF0; - remoteInfo = "AlamofireImage tvOS"; - }; - 4C16B3961BA9399500A66EF0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - 4C16B3981BA9399500A66EF0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - 4C16B39D1BA93A4B00A66EF0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 4CF626EE1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - 4C9043841AABBFC5001B4E60 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C90436E1AABBFC5001B4E60 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4C9043761AABBFC5001B4E60; - remoteInfo = AlamofireImage; - }; - 4CE5AAAE1B9BF09A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 4CE5AAB01B9BF09A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4CE5AAB21B9BF09A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 4CE5AAB41B9BF09A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = "Alamofire iOS Tests"; - }; - 4CE5AAB61B9BF09A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 4CE5AAB91B9BF0F6003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 4CE5AABC1B9BF10C003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 4DD67C0A1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4CE5AABF1B9BF11A003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = E4202FCD1B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 4CE6114E1AABC5C900D35044 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C90436E1AABBFC5001B4E60 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4CE611281AABC24E00D35044; - remoteInfo = "AlamofireImage OSX"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 4C0893EB1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+AlamofireImageTests.swift"; sourceTree = ""; }; - 4C0893F41B937404005125D9 /* UIImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageTests.swift; sourceTree = ""; }; - 4C0894501B9382EB005125D9 /* apple.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = apple.jpg; sourceTree = ""; }; - 4C0894511B9382EB005125D9 /* pirate.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = pirate.jpg; sourceTree = ""; }; - 4C0894521B9382EB005125D9 /* rainbow.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbow.jpg; sourceTree = ""; }; - 4C0894531B9382EB005125D9 /* unicorn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unicorn.png; sourceTree = ""; }; - 4C0897E71B93B0FB005125D9 /* huge_map.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = huge_map.jpg; sourceTree = ""; }; - 4C0897EA1B93BC0D005125D9 /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; - 4C1624841AABE8E600A0385D /* BaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTestCase.swift; sourceTree = ""; }; - 4C16B37D1BA9399500A66EF0 /* AlamofireImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C16B3861BA9399500A66EF0 /* AlamofireImage tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireImage tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C4D4EC11B92976900C96855 /* AlamofireImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C53084F1AB561BF0051DBAC /* UIImage+AlamofireImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+AlamofireImage.swift"; sourceTree = ""; }; - 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlamofireImage.h; sourceTree = ""; }; - 4C54EE901AABC04900CD894C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 4C54EE961AABC08B00CD894C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 4C5872C91B93DEAC00407E58 /* ImageFilterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageFilterTests.swift; sourceTree = ""; }; - 4C5872F61B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-30x60-@1x.png"; sourceTree = ""; }; - 4C5872F71B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-30x60-@2x.png"; sourceTree = ""; }; - 4C5872F81B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-30x60-@3x.png"; sourceTree = ""; }; - 4C5872F91B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-50x50-@1x.png"; sourceTree = ""; }; - 4C5872FA1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-50x50-@2x.png"; sourceTree = ""; }; - 4C5872FB1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-50x50-@3x.png"; sourceTree = ""; }; - 4C5872FC1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-60x30-@1x.png"; sourceTree = ""; }; - 4C5872FD1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-60x30-@2x.png"; sourceTree = ""; }; - 4C5872FE1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fill-60x30-@3x.png"; sourceTree = ""; }; - 4C5872FF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-30x60-@1x.png"; sourceTree = ""; }; - 4C5873001B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-30x60-@2x.png"; sourceTree = ""; }; - 4C5873011B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-30x60-@3x.png"; sourceTree = ""; }; - 4C5873021B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-50x50-@1x.png"; sourceTree = ""; }; - 4C5873031B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-50x50-@2x.png"; sourceTree = ""; }; - 4C5873041B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-50x50-@3x.png"; sourceTree = ""; }; - 4C5873051B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-60x30-@1x.png"; sourceTree = ""; }; - 4C5873061B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-60x30-@2x.png"; sourceTree = ""; }; - 4C5873071B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill-60x30-@3x.png"; sourceTree = ""; }; - 4C5873081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-30x60-@1x.png"; sourceTree = ""; }; - 4C5873091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-30x60-@2x.png"; sourceTree = ""; }; - 4C58730A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-30x60-@3x.png"; sourceTree = ""; }; - 4C58730B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-50x50-@1x.png"; sourceTree = ""; }; - 4C58730C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-50x50-@2x.png"; sourceTree = ""; }; - 4C58730D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-50x50-@3x.png"; sourceTree = ""; }; - 4C58730E1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-60x30-@1x.png"; sourceTree = ""; }; - 4C58730F1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-60x30-@2x.png"; sourceTree = ""; }; - 4C5873101B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fill-60x30-@3x.png"; sourceTree = ""; }; - 4C5873111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-30x60-@1x.png"; sourceTree = ""; }; - 4C5873121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-30x60-@2x.png"; sourceTree = ""; }; - 4C5873131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-30x60-@3x.png"; sourceTree = ""; }; - 4C5873141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-50x50-@1x.png"; sourceTree = ""; }; - 4C5873151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-50x50-@2x.png"; sourceTree = ""; }; - 4C5873161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-50x50-@3x.png"; sourceTree = ""; }; - 4C5873171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-60x30-@1x.png"; sourceTree = ""; }; - 4C5873181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-60x30-@2x.png"; sourceTree = ""; }; - 4C5873191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fill-60x30-@3x.png"; sourceTree = ""; }; - 4C58731B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png"; sourceTree = ""; }; - 4C58731C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png"; sourceTree = ""; }; - 4C58731D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png"; sourceTree = ""; }; - 4C58731F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png"; sourceTree = ""; }; - 4C5873201B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png"; sourceTree = ""; }; - 4C5873211B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png"; sourceTree = ""; }; - 4C5873231B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-30x60-@1x.png"; sourceTree = ""; }; - 4C5873241B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-30x60-@2x.png"; sourceTree = ""; }; - 4C5873251B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-30x60-@3x.png"; sourceTree = ""; }; - 4C5873261B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-50x50-@1x.png"; sourceTree = ""; }; - 4C5873271B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-50x50-@2x.png"; sourceTree = ""; }; - 4C5873281B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-50x50-@3x.png"; sourceTree = ""; }; - 4C5873291B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-60x30-@1x.png"; sourceTree = ""; }; - 4C58732A1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-60x30-@2x.png"; sourceTree = ""; }; - 4C58732B1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-aspect.scaled.to.fit-60x30-@3x.png"; sourceTree = ""; }; - 4C58732C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-30x60-@1x.png"; sourceTree = ""; }; - 4C58732D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-30x60-@2x.png"; sourceTree = ""; }; - 4C58732E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-30x60-@3x.png"; sourceTree = ""; }; - 4C58732F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-50x50-@1x.png"; sourceTree = ""; }; - 4C5873301B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-50x50-@2x.png"; sourceTree = ""; }; - 4C5873311B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-50x50-@3x.png"; sourceTree = ""; }; - 4C5873321B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-60x30-@1x.png"; sourceTree = ""; }; - 4C5873331B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-60x30-@2x.png"; sourceTree = ""; }; - 4C5873341B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-aspect.scaled.to.fit-60x30-@3x.png"; sourceTree = ""; }; - 4C5873351B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-30x60-@1x.png"; sourceTree = ""; }; - 4C5873361B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-30x60-@2x.png"; sourceTree = ""; }; - 4C5873371B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-30x60-@3x.png"; sourceTree = ""; }; - 4C5873381B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-50x50-@1x.png"; sourceTree = ""; }; - 4C5873391B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-50x50-@2x.png"; sourceTree = ""; }; - 4C58733A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-50x50-@3x.png"; sourceTree = ""; }; - 4C58733B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-60x30-@1x.png"; sourceTree = ""; }; - 4C58733C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-60x30-@2x.png"; sourceTree = ""; }; - 4C58733D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-aspect.scaled.to.fit-60x30-@3x.png"; sourceTree = ""; }; - 4C58733E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-30x60-@1x.png"; sourceTree = ""; }; - 4C58733F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-30x60-@2x.png"; sourceTree = ""; }; - 4C5873401B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-30x60-@3x.png"; sourceTree = ""; }; - 4C5873411B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-50x50-@1x.png"; sourceTree = ""; }; - 4C5873421B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-50x50-@2x.png"; sourceTree = ""; }; - 4C5873431B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-50x50-@3x.png"; sourceTree = ""; }; - 4C5873441B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-60x30-@1x.png"; sourceTree = ""; }; - 4C5873451B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-60x30-@2x.png"; sourceTree = ""; }; - 4C5873461B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-aspect.scaled.to.fit-60x30-@3x.png"; sourceTree = ""; }; - 4C5873481B93EFFB00407E58 /* apple-circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-circle.png"; sourceTree = ""; }; - 4C5873491B93EFFB00407E58 /* pirate-circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-circle.png"; sourceTree = ""; }; - 4C58734A1B93EFFB00407E58 /* rainbow-circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-circle.png"; sourceTree = ""; }; - 4C58734B1B93EFFB00407E58 /* unicorn-circle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-circle.png"; sourceTree = ""; }; - 4C58734E1B93EFFB00407E58 /* unicorn-sepia.tone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-sepia.tone.png"; sourceTree = ""; }; - 4C5873501B93EFFB00407E58 /* apple-radius-20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-radius-20.png"; sourceTree = ""; }; - 4C5873511B93EFFB00407E58 /* pirate-radius-20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-radius-20.png"; sourceTree = ""; }; - 4C5873521B93EFFB00407E58 /* rainbow-radius-20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-radius-20.png"; sourceTree = ""; }; - 4C5873531B93EFFB00407E58 /* unicorn-radius-20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-radius-20.png"; sourceTree = ""; }; - 4C5873551B93EFFB00407E58 /* apple-scaled-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-30x60-@1x.png"; sourceTree = ""; }; - 4C5873561B93EFFB00407E58 /* apple-scaled-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-30x60-@2x.png"; sourceTree = ""; }; - 4C5873571B93EFFB00407E58 /* apple-scaled-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-30x60-@3x.png"; sourceTree = ""; }; - 4C5873581B93EFFB00407E58 /* apple-scaled-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-50x50-@1x.png"; sourceTree = ""; }; - 4C5873591B93EFFB00407E58 /* apple-scaled-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-50x50-@2x.png"; sourceTree = ""; }; - 4C58735A1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-50x50-@3x.png"; sourceTree = ""; }; - 4C58735B1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-60x30-@1x.png"; sourceTree = ""; }; - 4C58735C1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-60x30-@2x.png"; sourceTree = ""; }; - 4C58735D1B93EFFB00407E58 /* apple-scaled-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "apple-scaled-60x30-@3x.png"; sourceTree = ""; }; - 4C58735E1B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-30x60-@1x.png"; sourceTree = ""; }; - 4C58735F1B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-30x60-@2x.png"; sourceTree = ""; }; - 4C5873601B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-30x60-@3x.png"; sourceTree = ""; }; - 4C5873611B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-50x50-@1x.png"; sourceTree = ""; }; - 4C5873621B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-50x50-@2x.png"; sourceTree = ""; }; - 4C5873631B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-50x50-@3x.png"; sourceTree = ""; }; - 4C5873641B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-60x30-@1x.png"; sourceTree = ""; }; - 4C5873651B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-60x30-@2x.png"; sourceTree = ""; }; - 4C5873661B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled-60x30-@3x.png"; sourceTree = ""; }; - 4C5873671B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-30x60-@1x.png"; sourceTree = ""; }; - 4C5873681B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-30x60-@2x.png"; sourceTree = ""; }; - 4C5873691B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-30x60-@3x.png"; sourceTree = ""; }; - 4C58736A1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-50x50-@1x.png"; sourceTree = ""; }; - 4C58736B1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-50x50-@2x.png"; sourceTree = ""; }; - 4C58736C1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-50x50-@3x.png"; sourceTree = ""; }; - 4C58736D1B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-60x30-@1x.png"; sourceTree = ""; }; - 4C58736E1B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-60x30-@2x.png"; sourceTree = ""; }; - 4C58736F1B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "rainbow-scaled-60x30-@3x.png"; sourceTree = ""; }; - 4C5873701B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-30x60-@1x.png"; sourceTree = ""; }; - 4C5873711B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-30x60-@2x.png"; sourceTree = ""; }; - 4C5873721B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-30x60-@3x.png"; sourceTree = ""; }; - 4C5873731B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-50x50-@1x.png"; sourceTree = ""; }; - 4C5873741B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-50x50-@2x.png"; sourceTree = ""; }; - 4C5873751B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-50x50-@3x.png"; sourceTree = ""; }; - 4C5873761B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-60x30-@1x.png"; sourceTree = ""; }; - 4C5873771B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-60x30-@2x.png"; sourceTree = ""; }; - 4C5873781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-scaled-60x30-@3x.png"; sourceTree = ""; }; - 4C58737A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.circle-100x100-@1x.png"; sourceTree = ""; }; - 4C58737B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.circle-100x100-@2x.png"; sourceTree = ""; }; - 4C58737C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.circle-100x100-@3x.png"; sourceTree = ""; }; - 4C58737E1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png"; sourceTree = ""; }; - 4C58737F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png"; sourceTree = ""; }; - 4C5873801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png"; sourceTree = ""; }; - 4C5874851B93F81800407E58 /* ImageDownloaderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDownloaderTests.swift; sourceTree = ""; }; - 4C62D30F1B96C1500011B036 /* UIImageViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageViewTests.swift; sourceTree = ""; }; - 4C78EA711AACD28C002C0569 /* UIImageView+AlamofireImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+AlamofireImage.swift"; sourceTree = ""; }; - 4C8290791B927CE6005E24C8 /* Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; - 4C9043771AABBFC5001B4E60 /* AlamofireImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C9043821AABBFC5001B4E60 /* AlamofireImage iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireImage iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDownloader.swift; sourceTree = ""; }; - 4CB2B2F31C0270C500B442EA /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; - 4CB2DBE31C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-blurred-8-ios-8.1.png"; sourceTree = ""; }; - 4CB2DBE41C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-blurred-8-ios-8.3.png"; sourceTree = ""; }; - 4CB2DBE51C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "unicorn-blurred-8-ios-9.png"; sourceTree = ""; }; - 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Carthage/Checkouts/Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; - 4CE611321AABC24E00D35044 /* AlamofireImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CE611471AABC5C900D35044 /* AlamofireImage OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AlamofireImage OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Request+AlamofireImage.swift"; sourceTree = ""; }; - 4CEBB53F1B93C622001391DE /* ImageCacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCacheTests.swift; sourceTree = ""; }; - 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; - 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageFilter.swift; sourceTree = ""; }; - CF24CF3C1C253CA000904E85 /* UIButtonTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIButtonTests.swift; sourceTree = ""; }; - CF24CF411C253CB100904E85 /* UIButton+AlamofireImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIButton+AlamofireImage.swift"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 4C16B3791BA9399500A66EF0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B39C1BA93A3D00A66EF0 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C16B3831BA9399500A66EF0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B3871BA9399500A66EF0 /* AlamofireImage.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C4D4EBD1B92976900C96855 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CE5AAC11B9BF11F003530D6 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C9043731AABBFC5001B4E60 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CE5AABB1B9BF104003530D6 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C90437F1AABBFC5001B4E60 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B4371BA93B4000A66EF0 /* AlamofireImage.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE6112A1AABC24E00D35044 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CE5AABE1B9BF111003530D6 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE611441AABC5C900D35044 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B4361BA93B3300A66EF0 /* AlamofireImage.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4C0893EA1B936A4D005125D9 /* Extensions */ = { - isa = PBXGroup; - children = ( - 4C0893EB1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift */, - ); - name = Extensions; - sourceTree = ""; - }; - 4C0894021B9382EB005125D9 /* Resources */ = { - isa = PBXGroup; - children = ( - 4C5872F41B93EFFB00407E58 /* Modified Images */, - 4C08944F1B9382EB005125D9 /* Original Images */, - ); - path = Resources; - sourceTree = ""; - }; - 4C08944F1B9382EB005125D9 /* Original Images */ = { - isa = PBXGroup; - children = ( - 4C0894501B9382EB005125D9 /* apple.jpg */, - 4C0897E71B93B0FB005125D9 /* huge_map.jpg */, - 4C0894511B9382EB005125D9 /* pirate.jpg */, - 4C0894521B9382EB005125D9 /* rainbow.jpg */, - 4C0894531B9382EB005125D9 /* unicorn.png */, - ); - path = "Original Images"; - sourceTree = ""; - }; - 4C54EE8E1AABC04900CD894C /* Source */ = { - isa = PBXGroup; - children = ( - 4C8290791B927CE6005E24C8 /* Image.swift */, - 4CFC0A051AB4FEC90004D0B8 /* ImageCache.swift */, - 4C96A4771AAE9488008AE0B6 /* ImageDownloader.swift */, - 4CFC0A081AB52BD90004D0B8 /* ImageFilter.swift */, - 4C5D84571AAD958A00A42375 /* Extensions */, - 4C54EE931AABC05100CD894C /* Supporting Files */, - ); - path = Source; - sourceTree = ""; - }; - 4C54EE931AABC05100CD894C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 4C54EE8F1AABC04900CD894C /* AlamofireImage.h */, - 4C54EE901AABC04900CD894C /* Info.plist */, - 4CB2B2F31C0270C500B442EA /* Info-tvOS.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 4C54EE941AABC08B00CD894C /* Tests */ = { - isa = PBXGroup; - children = ( - 4C1624841AABE8E600A0385D /* BaseTestCase.swift */, - 4CEBB53F1B93C622001391DE /* ImageCacheTests.swift */, - 4C5874851B93F81800407E58 /* ImageDownloaderTests.swift */, - 4C5872C91B93DEAC00407E58 /* ImageFilterTests.swift */, - 4C0897EA1B93BC0D005125D9 /* RequestTests.swift */, - CF24CF3C1C253CA000904E85 /* UIButtonTests.swift */, - 4C0893F41B937404005125D9 /* UIImageTests.swift */, - 4C62D30F1B96C1500011B036 /* UIImageViewTests.swift */, - 4C0893EA1B936A4D005125D9 /* Extensions */, - 4C0894021B9382EB005125D9 /* Resources */, - 4C54EE991AABC09000CD894C /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - 4C54EE991AABC09000CD894C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 4C54EE961AABC08B00CD894C /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 4C5872F41B93EFFB00407E58 /* Modified Images */ = { - isa = PBXGroup; - children = ( - 4C5872F51B93EFFB00407E58 /* Aspect Scaled to Fill */, - 4C58731A1B93EFFB00407E58 /* Aspect Scaled to Fill Circle */, - 4C58731E1B93EFFB00407E58 /* Aspect Scaled to Fill with Rounded Corners */, - 4C5873221B93EFFB00407E58 /* Aspect Scaled to Fit */, - 4C5873471B93EFFB00407E58 /* Circle */, - 4C58734C1B93EFFB00407E58 /* Core Image Filters */, - 4C58734F1B93EFFB00407E58 /* Radius */, - 4C5873541B93EFFB00407E58 /* Scaled */, - 4C5873791B93EFFB00407E58 /* Scaled to Size Circle */, - 4C58737D1B93EFFB00407E58 /* Scaled with Rounded Corners */, - ); - path = "Modified Images"; - sourceTree = ""; - }; - 4C5872F51B93EFFB00407E58 /* Aspect Scaled to Fill */ = { - isa = PBXGroup; - children = ( - 4C5872F61B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png */, - 4C5872F71B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png */, - 4C5872F81B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png */, - 4C5872F91B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png */, - 4C5872FA1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png */, - 4C5872FB1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png */, - 4C5872FC1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png */, - 4C5872FD1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png */, - 4C5872FE1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png */, - 4C5872FF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png */, - 4C5873001B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png */, - 4C5873011B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png */, - 4C5873021B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png */, - 4C5873031B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png */, - 4C5873041B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png */, - 4C5873051B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png */, - 4C5873061B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png */, - 4C5873071B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png */, - 4C5873081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png */, - 4C5873091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png */, - 4C58730A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png */, - 4C58730B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png */, - 4C58730C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png */, - 4C58730D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png */, - 4C58730E1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png */, - 4C58730F1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png */, - 4C5873101B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png */, - 4C5873111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png */, - 4C5873121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png */, - 4C5873131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png */, - 4C5873141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png */, - 4C5873151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png */, - 4C5873161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png */, - 4C5873171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png */, - 4C5873181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png */, - 4C5873191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png */, - ); - path = "Aspect Scaled to Fill"; - sourceTree = ""; - }; - 4C58731A1B93EFFB00407E58 /* Aspect Scaled to Fill Circle */ = { - isa = PBXGroup; - children = ( - 4C58731B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png */, - 4C58731C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png */, - 4C58731D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png */, - ); - path = "Aspect Scaled to Fill Circle"; - sourceTree = ""; - }; - 4C58731E1B93EFFB00407E58 /* Aspect Scaled to Fill with Rounded Corners */ = { - isa = PBXGroup; - children = ( - 4C58731F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png */, - 4C5873201B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png */, - 4C5873211B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png */, - ); - path = "Aspect Scaled to Fill with Rounded Corners"; - sourceTree = ""; - }; - 4C5873221B93EFFB00407E58 /* Aspect Scaled to Fit */ = { - isa = PBXGroup; - children = ( - 4C5873231B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png */, - 4C5873241B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png */, - 4C5873251B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png */, - 4C5873261B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png */, - 4C5873271B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png */, - 4C5873281B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png */, - 4C5873291B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png */, - 4C58732A1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png */, - 4C58732B1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png */, - 4C58732C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png */, - 4C58732D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png */, - 4C58732E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png */, - 4C58732F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png */, - 4C5873301B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png */, - 4C5873311B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png */, - 4C5873321B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png */, - 4C5873331B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png */, - 4C5873341B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png */, - 4C5873351B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png */, - 4C5873361B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png */, - 4C5873371B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png */, - 4C5873381B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png */, - 4C5873391B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png */, - 4C58733A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png */, - 4C58733B1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png */, - 4C58733C1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png */, - 4C58733D1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png */, - 4C58733E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png */, - 4C58733F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png */, - 4C5873401B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png */, - 4C5873411B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png */, - 4C5873421B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png */, - 4C5873431B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png */, - 4C5873441B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png */, - 4C5873451B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png */, - 4C5873461B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png */, - ); - path = "Aspect Scaled to Fit"; - sourceTree = ""; - }; - 4C5873471B93EFFB00407E58 /* Circle */ = { - isa = PBXGroup; - children = ( - 4C5873481B93EFFB00407E58 /* apple-circle.png */, - 4C5873491B93EFFB00407E58 /* pirate-circle.png */, - 4C58734A1B93EFFB00407E58 /* rainbow-circle.png */, - 4C58734B1B93EFFB00407E58 /* unicorn-circle.png */, - ); - path = Circle; - sourceTree = ""; - }; - 4C58734C1B93EFFB00407E58 /* Core Image Filters */ = { - isa = PBXGroup; - children = ( - 4CB2DBE31C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png */, - 4CB2DBE41C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png */, - 4CB2DBE51C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png */, - 4C58734E1B93EFFB00407E58 /* unicorn-sepia.tone.png */, - ); - path = "Core Image Filters"; - sourceTree = ""; - }; - 4C58734F1B93EFFB00407E58 /* Radius */ = { - isa = PBXGroup; - children = ( - 4C5873501B93EFFB00407E58 /* apple-radius-20.png */, - 4C5873511B93EFFB00407E58 /* pirate-radius-20.png */, - 4C5873521B93EFFB00407E58 /* rainbow-radius-20.png */, - 4C5873531B93EFFB00407E58 /* unicorn-radius-20.png */, - ); - path = Radius; - sourceTree = ""; - }; - 4C5873541B93EFFB00407E58 /* Scaled */ = { - isa = PBXGroup; - children = ( - 4C5873551B93EFFB00407E58 /* apple-scaled-30x60-@1x.png */, - 4C5873561B93EFFB00407E58 /* apple-scaled-30x60-@2x.png */, - 4C5873571B93EFFB00407E58 /* apple-scaled-30x60-@3x.png */, - 4C5873581B93EFFB00407E58 /* apple-scaled-50x50-@1x.png */, - 4C5873591B93EFFB00407E58 /* apple-scaled-50x50-@2x.png */, - 4C58735A1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png */, - 4C58735B1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png */, - 4C58735C1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png */, - 4C58735D1B93EFFB00407E58 /* apple-scaled-60x30-@3x.png */, - 4C58735E1B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png */, - 4C58735F1B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png */, - 4C5873601B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png */, - 4C5873611B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png */, - 4C5873621B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png */, - 4C5873631B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png */, - 4C5873641B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png */, - 4C5873651B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png */, - 4C5873661B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png */, - 4C5873671B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png */, - 4C5873681B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png */, - 4C5873691B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png */, - 4C58736A1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png */, - 4C58736B1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png */, - 4C58736C1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png */, - 4C58736D1B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png */, - 4C58736E1B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png */, - 4C58736F1B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png */, - 4C5873701B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png */, - 4C5873711B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png */, - 4C5873721B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png */, - 4C5873731B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png */, - 4C5873741B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png */, - 4C5873751B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png */, - 4C5873761B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png */, - 4C5873771B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png */, - 4C5873781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png */, - ); - path = Scaled; - sourceTree = ""; - }; - 4C5873791B93EFFB00407E58 /* Scaled to Size Circle */ = { - isa = PBXGroup; - children = ( - 4C58737A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png */, - 4C58737B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png */, - 4C58737C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png */, - ); - path = "Scaled to Size Circle"; - sourceTree = ""; - }; - 4C58737D1B93EFFB00407E58 /* Scaled with Rounded Corners */ = { - isa = PBXGroup; - children = ( - 4C58737E1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png */, - 4C58737F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png */, - 4C5873801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png */, - ); - path = "Scaled with Rounded Corners"; - sourceTree = ""; - }; - 4C5D84571AAD958A00A42375 /* Extensions */ = { - isa = PBXGroup; - children = ( - 4CF6CC601AAD289E007A38CB /* Alamofire */, - 4CF6CC5D1AAD2822007A38CB /* UIKit */, - ); - name = Extensions; - sourceTree = ""; - }; - 4C90436D1AABBFC5001B4E60 = { - isa = PBXGroup; - children = ( - 4C54EE8E1AABC04900CD894C /* Source */, - 4C54EE941AABC08B00CD894C /* Tests */, - 4C9043781AABBFC5001B4E60 /* Products */, - 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */, - ); - sourceTree = ""; - }; - 4C9043781AABBFC5001B4E60 /* Products */ = { - isa = PBXGroup; - children = ( - 4C9043771AABBFC5001B4E60 /* AlamofireImage.framework */, - 4C9043821AABBFC5001B4E60 /* AlamofireImage iOS Tests.xctest */, - 4CE611321AABC24E00D35044 /* AlamofireImage.framework */, - 4CE611471AABC5C900D35044 /* AlamofireImage OSX Tests.xctest */, - 4C4D4EC11B92976900C96855 /* AlamofireImage.framework */, - 4C16B37D1BA9399500A66EF0 /* AlamofireImage.framework */, - 4C16B3861BA9399500A66EF0 /* AlamofireImage tvOS Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 4CE5AAA71B9BF099003530D6 /* Products */ = { - isa = PBXGroup; - children = ( - 4CE5AAAF1B9BF09A003530D6 /* Alamofire.framework */, - 4CE5AAB51B9BF09A003530D6 /* Alamofire iOS Tests.xctest */, - 4CE5AAB11B9BF09A003530D6 /* Alamofire.framework */, - 4CE5AAB71B9BF09A003530D6 /* Alamofire OSX Tests.xctest */, - 4C16B3971BA9399500A66EF0 /* Alamofire.framework */, - 4C16B3991BA9399500A66EF0 /* Alamofire tvOS Tests.xctest */, - 4CE5AAB31B9BF09A003530D6 /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; - 4CF6CC5D1AAD2822007A38CB /* UIKit */ = { - isa = PBXGroup; - children = ( - CF24CF411C253CB100904E85 /* UIButton+AlamofireImage.swift */, - 4C53084F1AB561BF0051DBAC /* UIImage+AlamofireImage.swift */, - 4C78EA711AACD28C002C0569 /* UIImageView+AlamofireImage.swift */, - ); - name = UIKit; - sourceTree = ""; - }; - 4CF6CC601AAD289E007A38CB /* Alamofire */ = { - isa = PBXGroup; - children = ( - 4CE611541AABC8D900D35044 /* Request+AlamofireImage.swift */, - ); - name = Alamofire; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 4C16B37A1BA9399500A66EF0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B39F1BA93AA600A66EF0 /* AlamofireImage.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C4D4EBE1B92976900C96855 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C4D4EC91B9297B300C96855 /* AlamofireImage.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C9043741AABBFC5001B4E60 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C54EE911AABC04900CD894C /* AlamofireImage.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE6112B1AABC24E00D35044 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CE6112C1AABC24E00D35044 /* AlamofireImage.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 4C16B37C1BA9399500A66EF0 /* AlamofireImage tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4C16B39A1BA9399500A66EF0 /* Build configuration list for PBXNativeTarget "AlamofireImage tvOS" */; - buildPhases = ( - 4C16B3781BA9399500A66EF0 /* Sources */, - 4C16B3791BA9399500A66EF0 /* Frameworks */, - 4C16B37A1BA9399500A66EF0 /* Headers */, - 4C16B37B1BA9399500A66EF0 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4C16B39E1BA93A4B00A66EF0 /* PBXTargetDependency */, - ); - name = "AlamofireImage tvOS"; - productName = "AlamofireImage tvOS"; - productReference = 4C16B37D1BA9399500A66EF0 /* AlamofireImage.framework */; - productType = "com.apple.product-type.framework"; - }; - 4C16B3851BA9399500A66EF0 /* AlamofireImage tvOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4C16B39B1BA9399500A66EF0 /* Build configuration list for PBXNativeTarget "AlamofireImage tvOS Tests" */; - buildPhases = ( - 4C16B3821BA9399500A66EF0 /* Sources */, - 4C16B3831BA9399500A66EF0 /* Frameworks */, - 4C16B3841BA9399500A66EF0 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4C16B3891BA9399500A66EF0 /* PBXTargetDependency */, - ); - name = "AlamofireImage tvOS Tests"; - productName = "AlamofireImage tvOSTests"; - productReference = 4C16B3861BA9399500A66EF0 /* AlamofireImage tvOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 4C4D4EC01B92976900C96855 /* AlamofireImage watchOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4C4D4EC61B92976900C96855 /* Build configuration list for PBXNativeTarget "AlamofireImage watchOS" */; - buildPhases = ( - 4C4D4EBC1B92976900C96855 /* Sources */, - 4C4D4EBD1B92976900C96855 /* Frameworks */, - 4C4D4EBE1B92976900C96855 /* Headers */, - 4C4D4EBF1B92976900C96855 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CE5AAC01B9BF11A003530D6 /* PBXTargetDependency */, - ); - name = "AlamofireImage watchOS"; - productName = "AlamofireImage watchOS"; - productReference = 4C4D4EC11B92976900C96855 /* AlamofireImage.framework */; - productType = "com.apple.product-type.framework"; - }; - 4C9043761AABBFC5001B4E60 /* AlamofireImage iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4C90438D1AABBFC5001B4E60 /* Build configuration list for PBXNativeTarget "AlamofireImage iOS" */; - buildPhases = ( - 4C9043721AABBFC5001B4E60 /* Sources */, - 4C9043731AABBFC5001B4E60 /* Frameworks */, - 4C9043741AABBFC5001B4E60 /* Headers */, - 4C9043751AABBFC5001B4E60 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CE5AABA1B9BF0F6003530D6 /* PBXTargetDependency */, - ); - name = "AlamofireImage iOS"; - productName = AlamofireImage; - productReference = 4C9043771AABBFC5001B4E60 /* AlamofireImage.framework */; - productType = "com.apple.product-type.framework"; - }; - 4C9043811AABBFC5001B4E60 /* AlamofireImage iOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4C9043901AABBFC5001B4E60 /* Build configuration list for PBXNativeTarget "AlamofireImage iOS Tests" */; - buildPhases = ( - 4C90437E1AABBFC5001B4E60 /* Sources */, - 4C90437F1AABBFC5001B4E60 /* Frameworks */, - 4C9043801AABBFC5001B4E60 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4C9043851AABBFC5001B4E60 /* PBXTargetDependency */, - ); - name = "AlamofireImage iOS Tests"; - productName = AlamofireImageTests; - productReference = 4C9043821AABBFC5001B4E60 /* AlamofireImage iOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 4CE611281AABC24E00D35044 /* AlamofireImage OSX */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CE6112F1AABC24E00D35044 /* Build configuration list for PBXNativeTarget "AlamofireImage OSX" */; - buildPhases = ( - 4CE611291AABC24E00D35044 /* Sources */, - 4CE6112A1AABC24E00D35044 /* Frameworks */, - 4CE6112B1AABC24E00D35044 /* Headers */, - 4CE6112D1AABC24E00D35044 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CE5AABD1B9BF10C003530D6 /* PBXTargetDependency */, - ); - name = "AlamofireImage OSX"; - productName = AlamofireImage; - productReference = 4CE611321AABC24E00D35044 /* AlamofireImage.framework */; - productType = "com.apple.product-type.framework"; - }; - 4CE611461AABC5C900D35044 /* AlamofireImage OSX Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CE611501AABC5C900D35044 /* Build configuration list for PBXNativeTarget "AlamofireImage OSX Tests" */; - buildPhases = ( - 4CE611431AABC5C900D35044 /* Sources */, - 4CE611441AABC5C900D35044 /* Frameworks */, - 4CE611451AABC5C900D35044 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CE6114F1AABC5C900D35044 /* PBXTargetDependency */, - ); - name = "AlamofireImage OSX Tests"; - productName = "AlamofireImage OSX Tests"; - productReference = 4CE611471AABC5C900D35044 /* AlamofireImage OSX Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 4C90436E1AABBFC5001B4E60 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftMigration = 0700; - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - 4C16B37C1BA9399500A66EF0 = { - CreatedOnToolsVersion = 7.1; - }; - 4C16B3851BA9399500A66EF0 = { - CreatedOnToolsVersion = 7.1; - }; - 4C4D4EC01B92976900C96855 = { - CreatedOnToolsVersion = 7.0; - }; - 4C9043761AABBFC5001B4E60 = { - CreatedOnToolsVersion = 6.2; - }; - 4C9043811AABBFC5001B4E60 = { - CreatedOnToolsVersion = 6.2; - }; - 4CE611461AABC5C900D35044 = { - CreatedOnToolsVersion = 6.2; - }; - }; - }; - buildConfigurationList = 4C9043711AABBFC5001B4E60 /* Build configuration list for PBXProject "AlamofireImage" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 4C90436D1AABBFC5001B4E60; - productRefGroup = 4C9043781AABBFC5001B4E60 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 4CE5AAA71B9BF099003530D6 /* Products */; - ProjectRef = 4CE5AAA61B9BF099003530D6 /* Alamofire.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 4C9043761AABBFC5001B4E60 /* AlamofireImage iOS */, - 4C9043811AABBFC5001B4E60 /* AlamofireImage iOS Tests */, - 4CE611281AABC24E00D35044 /* AlamofireImage OSX */, - 4CE611461AABC5C900D35044 /* AlamofireImage OSX Tests */, - 4C16B37C1BA9399500A66EF0 /* AlamofireImage tvOS */, - 4C16B3851BA9399500A66EF0 /* AlamofireImage tvOS Tests */, - 4C4D4EC01B92976900C96855 /* AlamofireImage watchOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 4C16B3971BA9399500A66EF0 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4C16B3961BA9399500A66EF0 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4C16B3991BA9399500A66EF0 /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = 4C16B3981BA9399500A66EF0 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AAAF1B9BF09A003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AAAE1B9BF09A003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AAB11B9BF09A003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AAB01B9BF09A003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AAB31B9BF09A003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AAB21B9BF09A003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AAB51B9BF09A003530D6 /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = 4CE5AAB41B9BF09A003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AAB71B9BF09A003530D6 /* Alamofire OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire OSX Tests.xctest"; - remoteRef = 4CE5AAB61B9BF09A003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 4C16B37B1BA9399500A66EF0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C16B3841BA9399500A66EF0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B4161BA93AFD00A66EF0 /* pirate-scaled-60x30-@1x.png in Resources */, - 4C16B3F91BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C16B3C71BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C16B3F31BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C16B3CA1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C16B3B61BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C16B3B21BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C16B3D41BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */, - 4C16B3B31BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C16B3BE1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C16B4221BA93AFD00A66EF0 /* unicorn-scaled-30x60-@1x.png in Resources */, - 4C16B41D1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@2x.png in Resources */, - 4C16B3EB1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C16B3E51BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C16B3FF1BA93AEF00A66EF0 /* rainbow-circle.png in Resources */, - 4C16B4191BA93AFD00A66EF0 /* rainbow-scaled-30x60-@1x.png in Resources */, - 4CB2DBEB1C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */, - 4C16B4281BA93AFD00A66EF0 /* unicorn-scaled-60x30-@1x.png in Resources */, - 4C16B3FD1BA93AEF00A66EF0 /* apple-circle.png in Resources */, - 4C16B3B41BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C16B4121BA93AFD00A66EF0 /* pirate-scaled-30x60-@3x.png in Resources */, - 4C16B3B11BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C16B3C21BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C16B4041BA93AF200A66EF0 /* pirate-radius-20.png in Resources */, - 4C16B3E71BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C16B4061BA93AF200A66EF0 /* unicorn-radius-20.png in Resources */, - 4C16B3F01BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C16B3FA1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C16B3E21BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C16B3C81BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C16B3B81BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C16B41F1BA93AFD00A66EF0 /* rainbow-scaled-60x30-@1x.png in Resources */, - 4C16B3B01BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C16B4091BA93AFD00A66EF0 /* apple-scaled-30x60-@3x.png in Resources */, - 4C16B42F1BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C16B3F51BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C16B3D91BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C16B4341BA93AFD00A66EF0 /* rainbow.jpg in Resources */, - 4C16B3E31BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C16B40E1BA93AFD00A66EF0 /* apple-scaled-60x30-@2x.png in Resources */, - 4C16B4251BA93AFD00A66EF0 /* unicorn-scaled-50x50-@1x.png in Resources */, - 4C16B4071BA93AFD00A66EF0 /* apple-scaled-30x60-@1x.png in Resources */, - 4C16B3CB1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C16B3F71BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C16B3BF1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C16B3F11BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C16B3E41BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C16B4231BA93AFD00A66EF0 /* unicorn-scaled-30x60-@2x.png in Resources */, - 4C16B4261BA93AFD00A66EF0 /* unicorn-scaled-50x50-@2x.png in Resources */, - 4C16B4201BA93AFD00A66EF0 /* rainbow-scaled-60x30-@2x.png in Resources */, - 4C16B3F61BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C16B3CD1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C16B41C1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@1x.png in Resources */, - 4C16B42E1BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4CB2DBE81C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */, - 4C16B3CE1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C16B40D1BA93AFD00A66EF0 /* apple-scaled-60x30-@1x.png in Resources */, - 4C16B42D1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */, - 4C16B3D61BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4C16B3E11BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C16B4111BA93AFD00A66EF0 /* pirate-scaled-30x60-@2x.png in Resources */, - 4C16B3E61BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C16B3C41BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C16B3D01BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C16B40C1BA93AFD00A66EF0 /* apple-scaled-50x50-@3x.png in Resources */, - 4C16B3F41BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C16B41A1BA93AFD00A66EF0 /* rainbow-scaled-30x60-@2x.png in Resources */, - 4C16B3EE1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C16B3BC1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C16B3D21BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C16B3D51BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */, - 4C16B3BB1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C16B3DF1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C16B4031BA93AF200A66EF0 /* apple-radius-20.png in Resources */, - 4C16B3C31BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C16B4211BA93AFD00A66EF0 /* rainbow-scaled-60x30-@3x.png in Resources */, - 4C16B3DB1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C16B3D71BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C16B42B1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */, - 4C16B42A1BA93AFD00A66EF0 /* unicorn-scaled-60x30-@3x.png in Resources */, - 4C16B3EA1BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C16B3B91BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C16B3EF1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C16B4241BA93AFD00A66EF0 /* unicorn-scaled-30x60-@3x.png in Resources */, - 4C16B3D81BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C16B3FB1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C16B41B1BA93AFD00A66EF0 /* rainbow-scaled-30x60-@3x.png in Resources */, - 4CB2DBEE1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */, - 4C16B4171BA93AFD00A66EF0 /* pirate-scaled-60x30-@2x.png in Resources */, - 4C16B3C91BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C16B4311BA93AFD00A66EF0 /* apple.jpg in Resources */, - 4C16B4051BA93AF200A66EF0 /* rainbow-radius-20.png in Resources */, - 4C16B40B1BA93AFD00A66EF0 /* apple-scaled-50x50-@2x.png in Resources */, - 4C16B42C1BA93AFD00A66EF0 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */, - 4C16B3B71BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C16B4141BA93AFD00A66EF0 /* pirate-scaled-50x50-@2x.png in Resources */, - 4C16B3DA1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C16B3BA1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C16B4021BA93AEF00A66EF0 /* unicorn-sepia.tone.png in Resources */, - 4C16B3FC1BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C16B3E91BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C16B41E1BA93AFD00A66EF0 /* rainbow-scaled-50x50-@3x.png in Resources */, - 4C16B3F81BA93AEF00A66EF0 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C16B4301BA93AFD00A66EF0 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C16B3E81BA93AEF00A66EF0 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C16B3AF1BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C16B3D31BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */, - 4C16B3CF1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C16B3C01BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C16B4271BA93AFD00A66EF0 /* unicorn-scaled-50x50-@3x.png in Resources */, - 4C16B3C51BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C16B4101BA93AFD00A66EF0 /* pirate-scaled-30x60-@1x.png in Resources */, - 4C16B3C61BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C16B4291BA93AFD00A66EF0 /* unicorn-scaled-60x30-@2x.png in Resources */, - 4C16B3D11BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C16B4081BA93AFD00A66EF0 /* apple-scaled-30x60-@2x.png in Resources */, - 4C16B3BD1BA93AE600A66EF0 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C16B4151BA93AFD00A66EF0 /* pirate-scaled-50x50-@3x.png in Resources */, - 4C16B3CC1BA93AE600A66EF0 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C16B3DC1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C16B4001BA93AEF00A66EF0 /* unicorn-circle.png in Resources */, - 4C16B4351BA93AFD00A66EF0 /* unicorn.png in Resources */, - 4C16B3C11BA93AE600A66EF0 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C16B4331BA93AFD00A66EF0 /* pirate.jpg in Resources */, - 4C16B3FE1BA93AEF00A66EF0 /* pirate-circle.png in Resources */, - 4C16B3F21BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C16B3EC1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C16B4321BA93AFD00A66EF0 /* huge_map.jpg in Resources */, - 4C16B4181BA93AFD00A66EF0 /* pirate-scaled-60x30-@3x.png in Resources */, - 4C16B3ED1BA93AEF00A66EF0 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C16B3DE1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C16B3DD1BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C16B40A1BA93AFD00A66EF0 /* apple-scaled-50x50-@1x.png in Resources */, - 4C16B3B51BA93AE600A66EF0 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C16B4131BA93AFD00A66EF0 /* pirate-scaled-50x50-@1x.png in Resources */, - 4C16B40F1BA93AFD00A66EF0 /* apple-scaled-60x30-@3x.png in Resources */, - 4C16B3E01BA93AEF00A66EF0 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C4D4EBF1B92976900C96855 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C9043751AABBFC5001B4E60 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C9043801AABBFC5001B4E60 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C5874011B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873B31B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5873C31B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C5873A11B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5874211B93EFFB00407E58 /* rainbow-circle.png in Resources */, - 4C5873A31B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C5874671B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png in Resources */, - 4C5873B51B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C58738B1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C5874231B93EFFB00407E58 /* unicorn-circle.png in Resources */, - 4C5874491B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png in Resources */, - 4C5874031B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873D31B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C58745D1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png in Resources */, - 4C5873911B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C0894E41B9382EB005125D9 /* apple.jpg in Resources */, - 4CB2DBE91C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */, - 4C5873E31B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873B11B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C58747B1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */, - 4C5873EB1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C5874291B93EFFB00407E58 /* apple-radius-20.png in Resources */, - 4C5873E11B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5873E71B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5874791B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */, - 4C5873891B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5874771B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png in Resources */, - 4C58745B1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png in Resources */, - 4C5873CB1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */, - 4C5873C71B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C5874111B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5873FF1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5873951B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C5873BF1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873AD1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873E91B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C5873F71B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58738D1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C5874351B93EFFB00407E58 /* apple-scaled-30x60-@3x.png in Resources */, - 4C5874331B93EFFB00407E58 /* apple-scaled-30x60-@2x.png in Resources */, - 4C58744B1B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png in Resources */, - 4C5874711B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png in Resources */, - 4C5874091B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58739B1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873CD1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */, - 4C5873A51B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C5873851B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5874751B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png in Resources */, - 4C58746B1B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png in Resources */, - 4C5874631B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png in Resources */, - 4C58744D1B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png in Resources */, - 4C58741F1B93EFFB00407E58 /* pirate-circle.png in Resources */, - 4C5873A71B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C0897E81B93B0FB005125D9 /* huge_map.jpg in Resources */, - 4CB2DBE61C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */, - 4C5873EF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873BB1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5873DB1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5874191B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873F91B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5873C91B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */, - 4C5873D71B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C5873F11B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C58743D1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png in Resources */, - 4C5873D91B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C58738F1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5873D51B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5874571B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png in Resources */, - 4C5873B71B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C5873D11B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C5874051B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5874731B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png in Resources */, - 4C5874131B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C0894EA1B9382EB005125D9 /* unicorn.png in Resources */, - 4C5874651B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png in Resources */, - 4C5874451B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png in Resources */, - 4C5873CF1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4C5874271B93EFFB00407E58 /* unicorn-sepia.tone.png in Resources */, - 4C5873B91B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C58740D1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C5874691B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png in Resources */, - 4C5873831B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C5874411B93EFFB00407E58 /* apple-scaled-60x30-@3x.png in Resources */, - 4C5873C11B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C58747D1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */, - 4C5873931B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C58741D1B93EFFB00407E58 /* apple-circle.png in Resources */, - 4CB2DBEC1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */, - 4C58739F1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C58746F1B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png in Resources */, - 4C5873DF1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873F51B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873811B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C5874391B93EFFB00407E58 /* apple-scaled-50x50-@2x.png in Resources */, - 4C5874511B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png in Resources */, - 4C58742D1B93EFFB00407E58 /* rainbow-radius-20.png in Resources */, - 4C5874831B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C5874611B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png in Resources */, - 4C5874591B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png in Resources */, - 4C5873F31B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5874551B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png in Resources */, - 4C5874811B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C58742B1B93EFFB00407E58 /* pirate-radius-20.png in Resources */, - 4C5873971B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5873ED1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5874371B93EFFB00407E58 /* apple-scaled-50x50-@1x.png in Resources */, - 4C5873E51B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58743B1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png in Resources */, - 4C5874431B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png in Resources */, - 4C5873C51B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5873991B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C58744F1B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png in Resources */, - 4C5873A91B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5874471B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png in Resources */, - 4C5874171B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5873DD1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873AF1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C58747F1B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4C0894E81B9382EB005125D9 /* rainbow.jpg in Resources */, - 4C58745F1B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png in Resources */, - 4C5874071B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5874531B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png in Resources */, - 4C5873FB1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C58741B1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58746D1B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png in Resources */, - 4C5873AB1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C5874311B93EFFB00407E58 /* apple-scaled-30x60-@1x.png in Resources */, - 4C0894E61B9382EB005125D9 /* pirate.jpg in Resources */, - 4C58740F1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C58739D1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C58743F1B93EFFB00407E58 /* apple-scaled-60x30-@2x.png in Resources */, - 4C5874151B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873BD1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C58740B1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5873FD1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C5873871B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C58742F1B93EFFB00407E58 /* unicorn-radius-20.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE6112D1AABC24E00D35044 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE611451AABC5C900D35044 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C5874021B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873B41B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5873C41B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C5873A21B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5874221B93EFFB00407E58 /* rainbow-circle.png in Resources */, - 4C5873A41B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C5874681B93EFFB00407E58 /* unicorn-scaled-30x60-@1x.png in Resources */, - 4C5873B61B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C58738C1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C5874241B93EFFB00407E58 /* unicorn-circle.png in Resources */, - 4C58744A1B93EFFB00407E58 /* pirate-scaled-50x50-@1x.png in Resources */, - 4C5874041B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873D41B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C58745E1B93EFFB00407E58 /* rainbow-scaled-50x50-@2x.png in Resources */, - 4C5873921B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C0894E51B9382EB005125D9 /* apple.jpg in Resources */, - 4CB2DBEA1C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.3.png in Resources */, - 4C5873E41B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873B21B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C58747C1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@2x.png in Resources */, - 4C5873EC1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C58742A1B93EFFB00407E58 /* apple-radius-20.png in Resources */, - 4C5873E21B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5873E81B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C58747A1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@1x.png in Resources */, - 4C58738A1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5874781B93EFFB00407E58 /* unicorn-scaled-60x30-@3x.png in Resources */, - 4C58745C1B93EFFB00407E58 /* rainbow-scaled-50x50-@1x.png in Resources */, - 4C5873CC1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png in Resources */, - 4C5873C81B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@3x.png in Resources */, - 4C5874121B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5874001B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5873961B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C5873C01B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873AE1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873EA1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C5873F81B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58738E1B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C5874361B93EFFB00407E58 /* apple-scaled-30x60-@3x.png in Resources */, - 4C5874341B93EFFB00407E58 /* apple-scaled-30x60-@2x.png in Resources */, - 4C58744C1B93EFFB00407E58 /* pirate-scaled-50x50-@2x.png in Resources */, - 4C5874721B93EFFB00407E58 /* unicorn-scaled-50x50-@3x.png in Resources */, - 4C58740A1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58739C1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@2x.png in Resources */, - 4C5873CE1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png in Resources */, - 4C5873A61B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C5873861B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5874761B93EFFB00407E58 /* unicorn-scaled-60x30-@2x.png in Resources */, - 4C58746C1B93EFFB00407E58 /* unicorn-scaled-30x60-@3x.png in Resources */, - 4C5874641B93EFFB00407E58 /* rainbow-scaled-60x30-@2x.png in Resources */, - 4C58744E1B93EFFB00407E58 /* pirate-scaled-50x50-@3x.png in Resources */, - 4C5874201B93EFFB00407E58 /* pirate-circle.png in Resources */, - 4C5873A81B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C0897E91B93B0FB005125D9 /* huge_map.jpg in Resources */, - 4CB2DBE71C632D3E000CC9C2 /* unicorn-blurred-8-ios-8.1.png in Resources */, - 4C5873F01B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873BC1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5873DC1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C58741A1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873FA1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5873CA1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png in Resources */, - 4C5873D81B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C5873F21B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C58743E1B93EFFB00407E58 /* apple-scaled-60x30-@1x.png in Resources */, - 4C5873DA1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C5873901B93EFFB00407E58 /* apple-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C5873D61B93EFFB00407E58 /* apple-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5874581B93EFFB00407E58 /* rainbow-scaled-30x60-@2x.png in Resources */, - 4C5873B81B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C5873D21B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C5874061B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5874741B93EFFB00407E58 /* unicorn-scaled-60x30-@1x.png in Resources */, - 4C5874141B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C0894EB1B9382EB005125D9 /* unicorn.png in Resources */, - 4C5874661B93EFFB00407E58 /* rainbow-scaled-60x30-@3x.png in Resources */, - 4C5874461B93EFFB00407E58 /* pirate-scaled-30x60-@2x.png in Resources */, - 4C5873D01B93EFFB00407E58 /* pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4C5874281B93EFFB00407E58 /* unicorn-sepia.tone.png in Resources */, - 4C5873BA1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C58740E1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C58746A1B93EFFB00407E58 /* unicorn-scaled-30x60-@2x.png in Resources */, - 4C5873841B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@2x.png in Resources */, - 4C5874421B93EFFB00407E58 /* apple-scaled-60x30-@3x.png in Resources */, - 4C5873C21B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C58747E1B93EFFB00407E58 /* pirate-scaled.to.size.circle-100x100-@3x.png in Resources */, - 4C5873941B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C58741E1B93EFFB00407E58 /* apple-circle.png in Resources */, - 4CB2DBED1C632D3E000CC9C2 /* unicorn-blurred-8-ios-9.png in Resources */, - 4C5873A01B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-60x30-@1x.png in Resources */, - 4C5874701B93EFFB00407E58 /* unicorn-scaled-50x50-@2x.png in Resources */, - 4C5873E01B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873F61B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5873821B93EFFB00407E58 /* apple-aspect.scaled.to.fill-30x60-@1x.png in Resources */, - 4C58743A1B93EFFB00407E58 /* apple-scaled-50x50-@2x.png in Resources */, - 4C5874521B93EFFB00407E58 /* pirate-scaled-60x30-@2x.png in Resources */, - 4C58742E1B93EFFB00407E58 /* rainbow-radius-20.png in Resources */, - 4C5874841B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png in Resources */, - 4C5874621B93EFFB00407E58 /* rainbow-scaled-60x30-@1x.png in Resources */, - 4C58745A1B93EFFB00407E58 /* rainbow-scaled-30x60-@3x.png in Resources */, - 4C5873F41B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5874561B93EFFB00407E58 /* rainbow-scaled-30x60-@1x.png in Resources */, - 4C5874821B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png in Resources */, - 4C58742C1B93EFFB00407E58 /* pirate-radius-20.png in Resources */, - 4C5873981B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5873EE1B93EFFB00407E58 /* pirate-aspect.scaled.to.fit-50x50-@1x.png in Resources */, - 4C5874381B93EFFB00407E58 /* apple-scaled-50x50-@1x.png in Resources */, - 4C5873E61B93EFFB00407E58 /* apple-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58743C1B93EFFB00407E58 /* apple-scaled-50x50-@3x.png in Resources */, - 4C5874441B93EFFB00407E58 /* pirate-scaled-30x60-@1x.png in Resources */, - 4C5873C61B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-60x30-@2x.png in Resources */, - 4C58739A1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C5874501B93EFFB00407E58 /* pirate-scaled-60x30-@1x.png in Resources */, - 4C5873AA1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-30x60-@3x.png in Resources */, - 4C5874481B93EFFB00407E58 /* pirate-scaled-30x60-@3x.png in Resources */, - 4C5874181B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@1x.png in Resources */, - 4C5873DE1B93EFFB00407E58 /* apple-aspect.scaled.to.fit-50x50-@2x.png in Resources */, - 4C5873B01B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C5874801B93EFFB00407E58 /* pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png in Resources */, - 4C0894E91B9382EB005125D9 /* rainbow.jpg in Resources */, - 4C5874601B93EFFB00407E58 /* rainbow-scaled-50x50-@3x.png in Resources */, - 4C5874081B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-60x30-@2x.png in Resources */, - 4C5874541B93EFFB00407E58 /* pirate-scaled-60x30-@3x.png in Resources */, - 4C5873FC1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@2x.png in Resources */, - 4C58741C1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-60x30-@3x.png in Resources */, - 4C58746E1B93EFFB00407E58 /* unicorn-scaled-50x50-@1x.png in Resources */, - 4C5873AC1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C5874321B93EFFB00407E58 /* apple-scaled-30x60-@1x.png in Resources */, - 4C0894E71B9382EB005125D9 /* pirate.jpg in Resources */, - 4C5874101B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C58739E1B93EFFB00407E58 /* pirate-aspect.scaled.to.fill-50x50-@3x.png in Resources */, - 4C5874401B93EFFB00407E58 /* apple-scaled-60x30-@2x.png in Resources */, - 4C5874161B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-50x50-@3x.png in Resources */, - 4C5873BE1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C58740C1B93EFFB00407E58 /* unicorn-aspect.scaled.to.fit-30x60-@1x.png in Resources */, - 4C5873FE1B93EFFB00407E58 /* rainbow-aspect.scaled.to.fit-30x60-@3x.png in Resources */, - 4C5873881B93EFFB00407E58 /* apple-aspect.scaled.to.fill-50x50-@1x.png in Resources */, - 4C5874301B93EFFB00407E58 /* unicorn-radius-20.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 4C16B3781BA9399500A66EF0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B3A11BA93AB700A66EF0 /* ImageCache.swift in Sources */, - 4C16B3A61BA93AB700A66EF0 /* UIImageView+AlamofireImage.swift in Sources */, - 4C16B3A41BA93AB700A66EF0 /* Request+AlamofireImage.swift in Sources */, - 4C16B3A51BA93AB700A66EF0 /* UIImage+AlamofireImage.swift in Sources */, - 4C16B3A31BA93AB700A66EF0 /* ImageFilter.swift in Sources */, - 4C16B3A21BA93AB700A66EF0 /* ImageDownloader.swift in Sources */, - 4C16B3A01BA93AB700A66EF0 /* Image.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C16B3821BA9399500A66EF0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C16B3AB1BA93ADB00A66EF0 /* RequestTests.swift in Sources */, - 4C16B3A81BA93ADB00A66EF0 /* ImageCacheTests.swift in Sources */, - 4C16B3AE1BA93ADB00A66EF0 /* UIImage+AlamofireImageTests.swift in Sources */, - 4C16B3AA1BA93ADB00A66EF0 /* ImageFilterTests.swift in Sources */, - 4C16B3A71BA93ADB00A66EF0 /* BaseTestCase.swift in Sources */, - 4C16B3AD1BA93ADB00A66EF0 /* UIImageViewTests.swift in Sources */, - 4C16B3A91BA93ADB00A66EF0 /* ImageDownloaderTests.swift in Sources */, - 4C16B3AC1BA93ADB00A66EF0 /* UIImageTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C4D4EBC1B92976900C96855 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C4D4ECB1B9297BB00C96855 /* ImageCache.swift in Sources */, - 4C4D4ECE1B9297BB00C96855 /* Request+AlamofireImage.swift in Sources */, - 4C4D4ECF1B9297BB00C96855 /* UIImage+AlamofireImage.swift in Sources */, - 4C4D4ECD1B9297BB00C96855 /* ImageFilter.swift in Sources */, - 4C4D4ECC1B9297BB00C96855 /* ImageDownloader.swift in Sources */, - 4C4D4ECA1B9297BB00C96855 /* Image.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C9043721AABBFC5001B4E60 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C82907A1B927CE6005E24C8 /* Image.swift in Sources */, - 4C96A4781AAE9488008AE0B6 /* ImageDownloader.swift in Sources */, - 4CFC0A091AB52BD90004D0B8 /* ImageFilter.swift in Sources */, - CF24CF421C253CB100904E85 /* UIButton+AlamofireImage.swift in Sources */, - 4C78EA721AACD28C002C0569 /* UIImageView+AlamofireImage.swift in Sources */, - 4C5308501AB561BF0051DBAC /* UIImage+AlamofireImage.swift in Sources */, - 4CFC0A061AB4FEC90004D0B8 /* ImageCache.swift in Sources */, - 4CE611551AABC8D900D35044 /* Request+AlamofireImage.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4C90437E1AABBFC5001B4E60 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C62D3101B96C1500011B036 /* UIImageViewTests.swift in Sources */, - CF24CF461C253D4F00904E85 /* UIButtonTests.swift in Sources */, - 4C0897EB1B93BC0D005125D9 /* RequestTests.swift in Sources */, - 4C5872CA1B93DEAC00407E58 /* ImageFilterTests.swift in Sources */, - 4CEBB5401B93C622001391DE /* ImageCacheTests.swift in Sources */, - 4C0893EC1B936A7A005125D9 /* UIImage+AlamofireImageTests.swift in Sources */, - 4C1624851AABE8E600A0385D /* BaseTestCase.swift in Sources */, - 4C0893F51B937404005125D9 /* UIImageTests.swift in Sources */, - 4C5874861B93F81800407E58 /* ImageDownloaderTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE611291AABC24E00D35044 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C8290781B926F19005E24C8 /* ImageCache.swift in Sources */, - 4C82907D1B927DA9005E24C8 /* ImageFilter.swift in Sources */, - 4C82907B1B927CE6005E24C8 /* Image.swift in Sources */, - 4C82907C1B927D13005E24C8 /* ImageDownloader.swift in Sources */, - 4CE611561AABC8D900D35044 /* Request+AlamofireImage.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CE611431AABC5C900D35044 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C1624861AABE8E600A0385D /* BaseTestCase.swift in Sources */, - 4CEBB5411B93C622001391DE /* ImageCacheTests.swift in Sources */, - 4C5874871B93F81800407E58 /* ImageDownloaderTests.swift in Sources */, - 4C0897EC1B93BC0D005125D9 /* RequestTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4C16B3891BA9399500A66EF0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4C16B37C1BA9399500A66EF0 /* AlamofireImage tvOS */; - targetProxy = 4C16B3881BA9399500A66EF0 /* PBXContainerItemProxy */; - }; - 4C16B39E1BA93A4B00A66EF0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire tvOS"; - targetProxy = 4C16B39D1BA93A4B00A66EF0 /* PBXContainerItemProxy */; - }; - 4C9043851AABBFC5001B4E60 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4C9043761AABBFC5001B4E60 /* AlamofireImage iOS */; - targetProxy = 4C9043841AABBFC5001B4E60 /* PBXContainerItemProxy */; - }; - 4CE5AABA1B9BF0F6003530D6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire iOS"; - targetProxy = 4CE5AAB91B9BF0F6003530D6 /* PBXContainerItemProxy */; - }; - 4CE5AABD1B9BF10C003530D6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire OSX"; - targetProxy = 4CE5AABC1B9BF10C003530D6 /* PBXContainerItemProxy */; - }; - 4CE5AAC01B9BF11A003530D6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire watchOS"; - targetProxy = 4CE5AABF1B9BF11A003530D6 /* PBXContainerItemProxy */; - }; - 4CE6114F1AABC5C900D35044 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4CE611281AABC24E00D35044 /* AlamofireImage OSX */; - targetProxy = 4CE6114E1AABC5C900D35044 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 4C16B38E1BA9399500A66EF0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AlamofireImage; - PRODUCT_NAME = AlamofireImage; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4C16B38F1BA9399500A66EF0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AlamofireImage; - PRODUCT_NAME = AlamofireImage; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4C16B3901BA9399500A66EF0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4C16B3911BA9399500A66EF0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4C4D4EC71B92976900C96855 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-watchOS"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Debug; - }; - 4C4D4EC81B92976900C96855 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-watchOS"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Release; - }; - 4C90438B1AABBFC5001B4E60 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Debug; - }; - 4C90438C1AABBFC5001B4E60 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Release; - }; - 4C90438E1AABBFC5001B4E60 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 4C90438F1AABBFC5001B4E60 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 4C9043911AABBFC5001B4E60 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4C9043921AABBFC5001B4E60 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4CA12FB01C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = ReleaseTest; - }; - 4CA12FB11C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SKIP_INSTALL = YES; - }; - name = ReleaseTest; - }; - 4CA12FB21C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = ReleaseTest; - }; - 4CA12FB31C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = ReleaseTest; - }; - 4CA12FB41C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = ReleaseTest; - }; - 4CA12FB51C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AlamofireImage; - PRODUCT_NAME = AlamofireImage; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4CA12FB61C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4CA12FB71C2266AC00543972 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AlamofireImage-watchOS"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = ReleaseTest; - }; - 4CE611301AABC24E00D35044 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 4CE611311AABC24E00D35044 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AlamofireImage; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 4CE611511AABC5C900D35044 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Debug; - }; - 4CE611521AABC5C900D35044 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4C16B39A1BA9399500A66EF0 /* Build configuration list for PBXNativeTarget "AlamofireImage tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C16B38E1BA9399500A66EF0 /* Debug */, - 4C16B38F1BA9399500A66EF0 /* Release */, - 4CA12FB51C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4C16B39B1BA9399500A66EF0 /* Build configuration list for PBXNativeTarget "AlamofireImage tvOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C16B3901BA9399500A66EF0 /* Debug */, - 4C16B3911BA9399500A66EF0 /* Release */, - 4CA12FB61C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4C4D4EC61B92976900C96855 /* Build configuration list for PBXNativeTarget "AlamofireImage watchOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C4D4EC71B92976900C96855 /* Debug */, - 4C4D4EC81B92976900C96855 /* Release */, - 4CA12FB71C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4C9043711AABBFC5001B4E60 /* Build configuration list for PBXProject "AlamofireImage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C90438B1AABBFC5001B4E60 /* Debug */, - 4C90438C1AABBFC5001B4E60 /* Release */, - 4CA12FB01C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4C90438D1AABBFC5001B4E60 /* Build configuration list for PBXNativeTarget "AlamofireImage iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C90438E1AABBFC5001B4E60 /* Debug */, - 4C90438F1AABBFC5001B4E60 /* Release */, - 4CA12FB11C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4C9043901AABBFC5001B4E60 /* Build configuration list for PBXNativeTarget "AlamofireImage iOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4C9043911AABBFC5001B4E60 /* Debug */, - 4C9043921AABBFC5001B4E60 /* Release */, - 4CA12FB21C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4CE6112F1AABC24E00D35044 /* Build configuration list for PBXNativeTarget "AlamofireImage OSX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CE611301AABC24E00D35044 /* Debug */, - 4CE611311AABC24E00D35044 /* Release */, - 4CA12FB31C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4CE611501AABC5C900D35044 /* Build configuration list for PBXNativeTarget "AlamofireImage OSX Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CE611511AABC5C900D35044 /* Debug */, - 4CE611521AABC5C900D35044 /* Release */, - 4CA12FB41C2266AC00543972 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 4C90436E1AABBFC5001B4E60 /* Project object */; -} diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1f410d4..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage OSX.xcscheme b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage OSX.xcscheme deleted file mode 100644 index 4972f59..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage OSX.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage iOS.xcscheme b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage iOS.xcscheme deleted file mode 100644 index ca05cdb..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage iOS.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage tvOS.xcscheme b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage tvOS.xcscheme deleted file mode 100644 index 7911e82..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage tvOS.xcscheme +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage watchOS.xcscheme b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage watchOS.xcscheme deleted file mode 100644 index 893a893..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcodeproj/xcshareddata/xcschemes/AlamofireImage watchOS.xcscheme +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3dddd75..0000000 --- a/Carthage/Checkouts/AlamofireImage/AlamofireImage.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/CHANGELOG.md b/Carthage/Checkouts/AlamofireImage/CHANGELOG.md deleted file mode 100644 index b4b3e51..0000000 --- a/Carthage/Checkouts/AlamofireImage/CHANGELOG.md +++ /dev/null @@ -1,341 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -`AlamofireImage` adheres to [Semantic Versioning](http://semver.org/). - -#### 2.x Releases -- `2.3.x` Releases - [2.3.0](#230) | [2.3.1](#231) -- `2.2.x` Releases - [2.2.0](#220) -- `2.1.x` Releases - [2.1.0](#210) | [2.1.1](#211) -- `2.0.x` Releases - [2.0.0](#200) -- `2.0.0` Betas - [2.0.0-beta.1](#200-beta1) | [2.0.0-beta.2](#200-beta2) - -#### 1.x Releases - -- `1.1.x` Releases - [1.1.0](#110) | [1.1.1](#111) | [1.1.2](#112) -- `1.0.x` Releases - [1.0.0](#100) -- `1.0.0` Betas - [1.0.0-beta.1](#100-beta1) - ---- - -## [2.3.1](https://github.com/Alamofire/AlamofireImage/releases/tag/2.3.1) -Released on 2016-02-07. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.3.1). - -#### Added -- Default value to `completion` parameter in `downloadImage` API in `ImageDownloader. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The Alamofire submodule to the 3.2.0 release. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- Superfluous APIs on `ImageDownloader`, `UIButton` and `UIImageView` extensions and replaced - with default parameter values. - - Removed by [Anthony Miller](https://github.com/AnthonyMDev) in Pull Request - [#81](https://github.com/Alamofire/AlamofireImage/pull/81). - -#### Fixed -- Issue in `UIImage` extension where CoreImage filters were using the incorrect output frame. - - Fixed by [Felipe](https://github.com/fsaint) in Pull Request - [#78](https://github.com/Alamofire/AlamofireImage/pull/78). -- All blur filter tests across all devices and OS's. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Issue where image response serializer was not thread-safe by switching over to - thread-safe UIImage initializer. - - Fixed by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#75](https://github.com/Alamofire/AlamofireImage/pull/75). -- Build warnings in Xcode 7.3 beta 2 for Swift 2.2. - - Fixed by [James Barrow](https://github.com/Baza207) in Regards to Issue - [#77](https://github.com/Alamofire/AlamofireImage/pull/77). - -## [2.3.0](https://github.com/Alamofire/AlamofireImage/releases/tag/2.3.0) -Released on 2016-01-17. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.3.0). - -#### Added -- Alpha properties to `UIImage` extension along with unit tests. - - Added by [Christian Noon](https://github.com/cnoon). -- Condition to `UIImageView` test to verify active request receipt is reset. - - Added by [Jorge Mario Orjuela Gutierrez](https://github.com/jorjuela33) in Pull Request - [#62](https://github.com/Alamofire/AlamofireImage/pull/62). -- `UIButton` extension supporting remote image downloads. - - Added by [Jorge Mario Orjuela Gutierrez](https://github.com/jorjuela33) in Pull Request - [#63](https://github.com/Alamofire/AlamofireImage/pull/63). -- Tests verifying `Accept` header is set properly for button image downloads. - - Added by [Christian Noon](https://github.com/cnoon). -- `UIButton` extension tests around cancelling and restarting image downloads. - - Added by [Christian Noon](https://github.com/cnoon). -- iOS 9.2 devices to the travis yaml device matrix. - - Added by [Christian Noon](https://github.com/cnoon). -- `Carthage/Build` ignore flag to the `.gitignore` file to match Alamofire. - - Added by [Lars Anderson](https://github.com/larsacus) in Pull Request - [#71](https://github.com/Alamofire/AlamofireImage/pull/71). -- `Package.swift` file to support Swift Package Manager (SPM). - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- `UIImage` scaling now uses `af_isOpaque` property where applicable. - - Updated by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#65](https://github.com/Alamofire/AlamofireImage/issues/65). -- Refactored `UIButton` extension and tests to more closely follow coding standards. - - Updated by [Christian Noon](https://github.com/cnoon). -- Simplified `UIImageView` tests replacing KVO by overriding the image property. - - Updated by [Christian Noon](https://github.com/cnoon). -- Excluded the `UIButton` extension from osx and watchOS targets in podspec. - - Updated by [Christian Noon](https://github.com/cnoon). -- Copyright headers to include 2016! 🎉🎉🎉 - - Updated by [Christian Noon](https://github.com/cnoon). -- The default parameters in `AutoPurgingImageCache` initializer with correct MB values. - - Updated by [Christian Noon](https://github.com/cnoon). -- Several `UIImageView` APIs to public ACL to allow for better reuse. - - Updated by [Christian Noon](https://github.com/cnoon). -- Alamofire submodule to 3.1.5 release. - - Updated by [Christian Noon](https://github.com/cnoon). - ---- - -## [2.2.0](https://github.com/Alamofire/AlamofireImage/releases/tag/2.2.0) -Released on 2015-12-16. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.2.0). - -#### Added -- Ability for `ImageDownloader` to enqueue multiple image downloads at once. - - Added by [Jeff Kelley](https://github.com/SlaunchaMan) in Pull Request - [#51](https://github.com/Alamofire/AlamofireImage/pull/51). -- Tests to verify image view can cancel and restart the same request. - - Added by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#55](https://github.com/Alamofire/AlamofireImage/pull/55). -- Precondition to `ImageCache` ensuring memory capacity is GTE preferred usage after purge. - - Added by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#56](https://github.com/Alamofire/AlamofireImage/pull/56). -- Ability for image transitions to run when image is cached if specified. - - Added by [Jarrod Robins](https://github.com/jarrodrobins) in Pull Request - [#50](https://github.com/Alamofire/AlamofireImage/pull/50). -- Test to verify Accept header is set correctly on `UIImageView` extension. - - Added by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#60](https://github.com/Alamofire/AlamofireImage/pull/60). -- Added `ReleaseTest` configuration to allow running tests against optimized build. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Project to disable testability on release and to only build tests on when testing. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Travis-CI configuration to Xcode 7.2, iOS 9.2, tvOS 9.1 and watchOS 2.1. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Issue where image was not downloaded when cancelled and restarted. - - Fixed by [Christian Noon](https://github.com/cnoon) in Regards to Issue - [#55](https://github.com/Alamofire/AlamofireImage/pull/55). -- Issue where `af_setImageWithURL` was not using acceptable content types. - - Fixed by [Branden Russell](https://github.com/brandenr) in Pull Request - [#61](https://github.com/Alamofire/AlamofireImage/pull/61). - ---- - -## [2.1.1](https://github.com/Alamofire/AlamofireImage/releases/tag/2.1.1) -Released on 2015-11-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.1.1). - -#### Added -- Note to the README about storing a strong ref to image downloaders. - - Added by [Muhammad Ishaq](https://github.com/ishaq) in Pull Request - [#45](https://github.com/Alamofire/AlamofireImage/pull/45). -- Custom `Info.plist` for tvOS setting the `UIRequiredDeviceCapabilities` to `arm64`. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The `sessionManager` ACL in the `ImageDownloader` to allow access to the underlying - session and configuration. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Alamofire submodule to the Alamofire 3.1.3 release. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [2.1.0](https://github.com/Alamofire/AlamofireImage/releases/tag/2.1.0) -Released on 2015-10-24. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.1.0). - -#### Added -- New tvOS framework and test targets to the project. - - Added by [Christian Noon](https://github.com/cnoon). -- The tvOS deployment target to the podspec. - - Added by [Christian Noon](https://github.com/cnoon). -- The `BITCODE_GENERATION_MODE` user defined setting to tvOS framework target. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The README to include tvOS and bumped the required version of Xcode. - - Updated by [Christian Noon](https://github.com/cnoon). -- The default tvOS and watchOS deployment targets in the Xcode project. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Cartfile and Alamofire submodule to the 3.1.0 release. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Travis-CI yaml file to run watchOS and tvOS builds and tests on xcode7.1 osx_image. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Several typos in the `AutoPurgingImageCache` section of the README. - - Fixed by [Nate Cook](https://github.com/natecook1000) in Pull Request - [#39](https://github.com/Alamofire/AlamofireImage/pull/39). - ---- - -## [2.0.0](https://github.com/Alamofire/AlamofireImage/releases/tag/2.0.0) -Released on 2015-10-17. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.0.0). - -#### Updated -- The cocoapods and carthage instructions in the README. - - Updated by [Christian Noon](https://github.com/cnoon). - ---- - -## [2.0.0-beta.2](https://github.com/Alamofire/AlamofireImage/releases/tag/2.0.0-beta.2) -Released on 2015-10-14. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.0.0-beta.2). - -#### Added -- Ability to use a custom `ImageDownloader` per `UIImageView` instance. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#31](https://github.com/Alamofire/AlamofireImage/pull/31). -- New `ImageDownloader` initializer accepting a custom `Manager` instance using dependency injection. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#32](https://github.com/Alamofire/AlamofireImage/pull/32). -- Ability to add additional acceptable image content types for `Request` validation. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#33](https://github.com/Alamofire/AlamofireImage/pull/33) to address Issues - [#28](https://github.com/Alamofire/AlamofireImage/issues/28) and - [#29](https://github.com/Alamofire/AlamofireImage/issues/29). - -#### Fixed -- Cancelled request completion closures are now called on the main queue. - - Fixed by [Christian Noon](https://github.com/cnoon). - -## [2.0.0-beta.1](https://github.com/Alamofire/AlamofireImage/releases/tag/2.0.0-beta.1) -Released on 2015-09-27. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A2.0.0-beta.1). - -#### Added -- The AlamofireImage 2.0 Migration Guide and also added to the README. - - Added by [Christian Noon](https://github.com/cnoon). -- A new `RequestReceipt` struct to the `ImageDownloader` to improve cancellation reasoning. - - Added by [Kevin Harwood](https://github.com/kcharwood). -- Cancellation tests to the `ImageDownloader` to validate new cancellation behavior. - - Added by [Christian Noon](https://github.com/cnoon). -- Section to the README documenting the `RequestReceipt` usage. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Cartfile to pick up latest changes from the `master` branch of Alamofire 3.0. - - Updated by [Christian Noon](https://github.com/cnoon). -- All source logic to use the Alamofire 3.0 APIs. - - Updated by [Christian Noon](https://github.com/cnoon). -- All tests to compile and run against the Alamofire 3.0 APIs. - - Updated by [Christian Noon](https://github.com/cnoon). -- All the sample code examples in the README to use all the new APIs. - - Updated by [Christian Noon](https://github.com/cnoon). - ---- - -## [1.1.2](https://github.com/Alamofire/AlamofireImage/releases/tag/1.1.2) -Released on 2015-09-26. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A1.1.2). - -#### Added -- Tests verifying response image serializers support file URLs. - - Added by [Alexander Edge](https://github.com/alexanderedge) in regards to Pull Request - [#19](https://github.com/Alamofire/AlamofireImage/pull/19). -- Tests verifying cached image is set on `UIImageView` if completion closure is set. - - Added by [Kevin Harwood](https://github.com/kcharwood) in Pull Request - [#20](https://github.com/Alamofire/AlamofireImage/pull/20). - -#### Updated -- The `Request` extension to validate file URLs making test mocking easier. - - Updated by [Alexander Edge](https://github.com/alexanderedge) in Pull Request - [#19](https://github.com/Alamofire/AlamofireImage/pull/19). - -#### Fixed -- Issue where cached image was not set on a `UIImageView` if completion closure was set. - - Fixed by [Kevin Harwood](https://github.com/kcharwood) in Pull Request - [#20](https://github.com/Alamofire/AlamofireImage/pull/20). - -## [1.1.1](https://github.com/Alamofire/AlamofireImage/releases/tag/1.1.1) -Released on 2015-09-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A1.1.1). - -#### Added -- Tests around the UIImageView extension usage with redirect URLs. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#15](https://github.com/Alamofire/AlamofireImage/pull/15). -- Tests around the UIImageView extension usage with duplicate image requests. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#17](https://github.com/Alamofire/AlamofireImage/pull/17). - -#### Fixed -- Issue where `UIImageView` extension did not support redirect URLs. - - Fixed by [Robert Payne](https://github.com/robertjpayne) in Pull Request - [#16](https://github.com/Alamofire/AlamofireImage/pull/16). -- Issue where duplicate image requests were cancelling the active image download -in the `UIImageView` extension. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#17](https://github.com/Alamofire/AlamofireImage/pull/17). - -## [1.1.0](https://github.com/Alamofire/AlamofireImage/releases/tag/1.1.0) -Released on 2015-09-19. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A1.1.0). - -#### Added -- Custom image transition to the `UIImageView` extension. - - Added by [Kevin Harwood](https://github.com/kcharwood) in Pull Request - [#9](https://github.com/Alamofire/AlamofireImage/pull/9). -- CompositeImageFilter protocol to construct composite image filters. - - Added by [Damien Rambout](https://github.com/damienrambout) in Pull Request - [#8](https://github.com/Alamofire/AlamofireImage/pull/8). -- `DynamicImageFilter` and `DynamicCompositeImageFilter` structs to make it easy -to create custom image filters. - - Added by [Damien Rambout](https://github.com/damienrambout) in Pull Request - [#14](https://github.com/Alamofire/AlamofireImage/pull/14). - -#### Updated -- `ImageDownloader` download image completion closures to be optional. - - Updated by [Christian Noon](https://github.com/cnoon). -- Completion callback behavior of the `UIImageView` extension methods to be called before -the image transition occurs. - - Updated by [Kevin Harwood](https://github.com/kcharwood) in Pull Request - [#9](https://github.com/Alamofire/AlamofireImage/pull/9). -- Rounded corner radius image filter can now be adjusted by the image scale. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#10](https://github.com/Alamofire/AlamofireImage/pull/10). -- Enabled APPLICATION_EXTENSION_API_ONLY in watchOS framework. - - Updated by [James Barrow](https://github.com/Baza207) in Pull Request - [#11](https://github.com/Alamofire/AlamofireImage/pull/11). -- The podspec file to allow all Alamofire 2.x versions. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [1.0.0](https://github.com/Alamofire/AlamofireImage/releases/tag/1.0.0) -Released on 2015-09-09. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/AlamofireImage/issues?utf8=✓&q=milestone%3A1.0.0). - -#### Updated -- Alamofire dependency to `~> 2.0` for CocoaPods and Carthage. - - Updated by [Christian Noon](https://github.com/cnoon). -- Alamofire submodule to 2.0.0 release commit. - - Updated by [Christian Noon](https://github.com/cnoon). -- Xcode `APPLICATION_EXTENSION_API_ONLY` to `YES` for iOS and OSX frameworks. - - Updated by [Matt Delves](https://github.com/mattdelves) in Pull Request - [#4](https://github.com/Alamofire/AlamofireImage/pull/4). - -#### Fixed -- Issue in `ImageDownloader` where the wrong image was being stored in the image cache. - - Fixed by [Robin Eggenkamp](https://github.com/Edubits) in Pull Request - [#3](https://github.com/Alamofire/AlamofireImage/pull/3). - ---- - -## [1.0.0-beta.1](https://github.com/Alamofire/AlamofireImage/releases/tag/1.0.0-beta.1) -Released on 2015-09-05. - -#### Added -- Initial release of AlamofireImage. - - Added by [Christian Noon](https://github.com/cnoon). diff --git a/Carthage/Checkouts/AlamofireImage/CONTRIBUTING.md b/Carthage/Checkouts/AlamofireImage/CONTRIBUTING.md deleted file mode 100644 index 5de3be7..0000000 --- a/Carthage/Checkouts/AlamofireImage/CONTRIBUTING.md +++ /dev/null @@ -1,91 +0,0 @@ -# Contributing Guidelines - -This document contains information and guidelines about contributing to this project. -Please read it before you start participating. - -**Topics** - -* [Asking Questions](#asking-questions) -* [Reporting Security Issues](#reporting-security-issues) -* [Reporting Issues](#reporting-other-issues) -* [Developers Certificate of Origin](#developers-certificate-of-origin) -* [Code of Conduct](#code-of-conduct) - -## Asking Questions - -We don't use GitHub as a support forum. -For any usage questions that are not specific to the project itself, -please ask on [Stack Overflow](https://stackoverflow.com) instead. -By doing so, you'll be more likely to quickly solve your problem, -and you'll allow anyone else with the same question to find the answer. -This also allows maintainers to focus on improving the project for others. - -## Reporting Security Issues - -The Alamofire Software Foundation takes security seriously. -If you discover a security issue, please bring it to our attention right away! - -Please **DO NOT** file a public issue, -instead send your report privately to . -This will help ensure that any vulnerabilities that _are_ found -can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure) -to any affected parties. - -## Reporting Other Issues - -A great way to contribute to the project -is to send a detailed issue when you encounter an problem. -We always appreciate a well-written, thorough bug report. - -Check that the project issues database -doesn't already include that problem or suggestion before submitting an issue. -If you find a match, add a quick "+1" or "I have this problem too." -Doing this helps prioritize the most common problems and requests. - -When reporting issues, please include the following: - -* The version of Xcode you're using -* The version of iOS or OS X you're targeting -* The full output of any stack trace or compiler error -* A code snippet that reproduces the described behavior, if applicable -* Any other details that would be useful in understanding the problem - -This information will help us review and fix your issue faster. - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -- (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. - -## Code of Conduct - -The Code of Conduct governs how we behave in public or in private -whenever the project will be judged by our actions. -We expect it to be honored by everyone who contributes to this project. - -See [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md) for details. - ---- - -*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](http://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.* diff --git a/Carthage/Checkouts/AlamofireImage/Cartfile b/Carthage/Checkouts/AlamofireImage/Cartfile deleted file mode 100644 index ed40326..0000000 --- a/Carthage/Checkouts/AlamofireImage/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 3.1 diff --git a/Carthage/Checkouts/AlamofireImage/Cartfile.resolved b/Carthage/Checkouts/AlamofireImage/Cartfile.resolved deleted file mode 100644 index defe82a..0000000 --- a/Carthage/Checkouts/AlamofireImage/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" "3.2.0" diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.gitignore b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.gitignore deleted file mode 100644 index 222e8ec..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Mac OS X -.DS_Store - -# Xcode - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -.build/ - -# Carthage -Carthage/Build diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.travis.yml b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.travis.yml deleted file mode 100644 index 637cda6..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -language: objective-c -osx_image: xcode7.2 -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - WORKSPACE=Alamofire.xcworkspace - - IOS_FRAMEWORK_SCHEME="Alamofire iOS" - - OSX_FRAMEWORK_SCHEME="Alamofire OSX" - - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS" - - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS" - - IOS_SDK=iphonesimulator9.2 - - OSX_SDK=macosx10.11 - - TVOS_SDK=appletvsimulator9.1 - - WATCHOS_SDK=watchsimulator2.1 - - EXAMPLE_SCHEME="iOS Example" - matrix: - - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" - - DESTINATION="OS=8.2,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.4,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.2,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" SDK="$OSX_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=9.1,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=2.1,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" -script: - - set -o pipefail - - xcodebuild -version - - xcodebuild -showsdks - - # Build Framework in Debug and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Framework in ReleaseTest and Run Tests if specified - - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO test | xcpretty -c; - else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration ReleaseTest ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Debug if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Release if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Run `pod lib lint` if specified - - if [ $POD_LINT == "YES" ]; then - pod lib lint; - fi diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.podspec b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.podspec deleted file mode 100644 index 9690c3e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.podspec +++ /dev/null @@ -1,17 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'Alamofire' - s.version = '3.2.0' - s.license = 'MIT' - s.summary = 'Elegant HTTP Networking in Swift' - s.homepage = 'https://github.com/Alamofire/Alamofire' - s.social_media_url = 'http://twitter.com/AlamofireSF' - s.authors = { 'Alamofire Software Foundation' => 'info@alamofire.org' } - s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version } - - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '2.0' - - s.source_files = 'Source/*.swift' -end diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj deleted file mode 100644 index ccf8e9e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1852 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4C0B62511BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0B62521BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0B62531BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4C256A541B096C770065714F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4C3238E71B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4C3238E81B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4C33A1391B5207DB00873DFF /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4C33A13A1B5207DB00873DFF /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4C33A13B1B5207DB00873DFF /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4C33A13C1B5207DB00873DFF /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; - 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743CF81C22772D00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D041C22772D00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D091C22772D00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D0A1C22772D00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D0B1C22772D00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743D121C22772E00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D1F1C22772E00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D201C22772E00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D211C22772E00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C743D221C22772F00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - 4C743D231C22772F00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - 4C743D241C22772F00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - 4C743D281C22772F00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C743D301C22772F00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C743D351C22772F00BCB23E /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C743D361C22772F00BCB23E /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C743D371C22772F00BCB23E /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; - 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4CEC605C1B745C9B00E684F4 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; - 4CF626F91BA7CB3E0011A099 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */; }; - 4CF627061BA7CBE30011A099 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; - 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - 4CF627171BA7CC240011A099 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; - 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; - 4CF6271F1BA7CC240011A099 /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; - 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; - 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; - 4CF627351BA7CC300011A099 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; - 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - 8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; }; - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - E4202FD11B667AA100C997FB /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - E4202FD31B667AA100C997FB /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; - E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - E4202FD71B667AA100C997FB /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - E4202FD81B667AA100C997FB /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; - F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; }; - F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; - F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; - F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; - F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; - F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; }; - F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; - F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; - F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4CF626FA1BA7CB3E0011A099 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4CF626EE1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - F8111E6519A967880040E7D1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F8111E2A19A95C8B0040E7D1 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4DD67C0A1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerializationTests.swift; sourceTree = ""; }; - 4C0B62501BB1001C009302D3 /* Response.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = ""; }; - 4C0E02681BF99A18004E7F18 /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-tvOS.plist"; path = "Source/Info-tvOS.plist"; sourceTree = SOURCE_ROOT; }; - 4C0E5BF71B673D3400816CCC /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; - 4C1DC8531B68908E00476DE3 /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; - 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormData.swift; sourceTree = ""; }; - 4C256A501B096C2C0065714F /* BaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTestCase.swift; sourceTree = ""; }; - 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormDataTests.swift; sourceTree = ""; }; - 4C33A1231B5207DB00873DFF /* rainbow.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rainbow.jpg; sourceTree = ""; }; - 4C33A1241B5207DB00873DFF /* unicorn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unicorn.png; sourceTree = ""; }; - 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicyTests.swift; sourceTree = ""; }; - 4C341BB91B1A865A00C1B34D /* CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheTests.swift; sourceTree = ""; }; - 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManager.swift; sourceTree = ""; }; - 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManagerTests.swift; sourceTree = ""; }; - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+AlamofireTests.swift"; sourceTree = ""; }; - 4C574E691C67D207000B3128 /* Timeline.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Timeline.swift; sourceTree = ""; }; - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSURLSessionConfiguration+AlamofireTests.swift"; sourceTree = ""; }; - 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicy.swift; sourceTree = ""; }; - 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-root-ca.cer"; path = "alamofire.org/alamofire-root-ca.cer"; sourceTree = ""; }; - 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-signing-ca1.cer"; path = "alamofire.org/alamofire-signing-ca1.cer"; sourceTree = ""; }; - 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-signing-ca2.cer"; path = "alamofire.org/alamofire-signing-ca2.cer"; sourceTree = ""; }; - 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = wildcard.alamofire.org.cer; path = alamofire.org/wildcard.alamofire.org.cer; sourceTree = ""; }; - 4C812C441B535F400017E0BF /* multiple-dns-names.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "multiple-dns-names.cer"; path = "alamofire.org/multiple-dns-names.cer"; sourceTree = ""; }; - 4C812C451B535F400017E0BF /* signed-by-ca1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "signed-by-ca1.cer"; path = "alamofire.org/signed-by-ca1.cer"; sourceTree = ""; }; - 4C812C461B535F400017E0BF /* test.alamofire.org.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = test.alamofire.org.cer; path = alamofire.org/test.alamofire.org.cer; sourceTree = ""; }; - 4C812C4F1B535F540017E0BF /* expired.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = expired.cer; path = alamofire.org/expired.cer; sourceTree = ""; }; - 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "missing-dns-name-and-uri.cer"; path = "alamofire.org/missing-dns-name-and-uri.cer"; sourceTree = ""; }; - 4C812C511B535F540017E0BF /* signed-by-ca2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "signed-by-ca2.cer"; path = "alamofire.org/signed-by-ca2.cer"; sourceTree = ""; }; - 4C812C521B535F540017E0BF /* valid-dns-name.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-dns-name.cer"; path = "alamofire.org/valid-dns-name.cer"; sourceTree = ""; }; - 4C812C531B535F540017E0BF /* valid-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-uri.cer"; path = "alamofire.org/valid-uri.cer"; sourceTree = ""; }; - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "intermediate-ca-disig.cer"; path = "disig.sk/intermediate-ca-disig.cer"; sourceTree = ""; }; - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "root-ca-disig.cer"; path = "disig.sk/root-ca-disig.cer"; sourceTree = ""; }; - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "testssl-expire.disig.sk.cer"; path = "disig.sk/testssl-expire.disig.sk.cer"; sourceTree = ""; }; - 4C83F41A1B749E0E00203445 /* Stream.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stream.swift; sourceTree = ""; }; - 4CA028C41B7466C500C84163 /* ResultTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; - 4CB928281C66BFBC00CE5F08 /* Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = ""; }; - 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLProtocolTests.swift; sourceTree = ""; }; - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = ""; }; - 4CDE2C391AF899EC00BABAE5 /* Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Download.swift; sourceTree = ""; }; - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Upload.swift; sourceTree = ""; }; - 4CDE2C421AF89F0900BABAE5 /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; - 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerialization.swift; sourceTree = ""; }; - 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncoding.swift; sourceTree = ""; }; - 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 72998D721BF26173006D3F69 /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; - B39E2F831C1A72F8002DA1A9 /* certDER.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.cer; path = selfSignedAndMalformedCerts/certDER.cer; sourceTree = ""; }; - B39E2F841C1A72F8002DA1A9 /* certDER.crt */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.crt; path = selfSignedAndMalformedCerts/certDER.crt; sourceTree = ""; }; - B39E2F851C1A72F8002DA1A9 /* certDER.der */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.der; path = selfSignedAndMalformedCerts/certDER.der; sourceTree = ""; }; - B39E2F861C1A72F8002DA1A9 /* certPEM.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = certPEM.cer; path = selfSignedAndMalformedCerts/certPEM.cer; sourceTree = ""; }; - B39E2F871C1A72F8002DA1A9 /* certPEM.crt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = certPEM.crt; path = selfSignedAndMalformedCerts/certPEM.crt; sourceTree = ""; }; - B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */ = {isa = PBXFileReference; lastKnownFileType = file; name = randomGibberish.crt; path = selfSignedAndMalformedCerts/randomGibberish.crt; sourceTree = ""; }; - B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */ = {isa = PBXFileReference; lastKnownFileType = file; name = keyDER.der; path = selfSignedAndMalformedCerts/keyDER.der; sourceTree = ""; }; - E4202FE01B667AA100C997FB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E3319A95C8B0040E7D1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E3719A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F8111E3819A95C8B0040E7D1 /* Alamofire.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Alamofire.h; sourceTree = ""; }; - F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - F8111E4119A95C8B0040E7D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadTests.swift; sourceTree = ""; }; - F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncodingTests.swift; sourceTree = ""; }; - F8111E5D19A9674D0040E7D1 /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; - F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseTests.swift; sourceTree = ""; }; - F8111E5F19A9674D0040E7D1 /* UploadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSEvaluationTests.swift; sourceTree = ""; }; - F897FF4019AA800700AB5182 /* Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alamofire.swift; sourceTree = ""; }; - F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = ""; }; - F8D1C6F419D52968002E74FE /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = ""; }; - F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationTests.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 4CF626EB1BA7CB3E0011A099 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F51BA7CB3E0011A099 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF626F91BA7CB3E0011A099 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C071A5C55C900ED2280 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FD91B667AA100C997FB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E2F19A95C8B0040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3B19A95C8B0040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6AF1A7A94F100A2CD59 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4C256A4E1B09656A0065714F /* Core */ = { - isa = PBXGroup; - children = ( - F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */, - F8D1C6F419D52968002E74FE /* ManagerTests.swift */, - F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */, - F8111E5D19A9674D0040E7D1 /* RequestTests.swift */, - F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */, - 4CA028C41B7466C500C84163 /* ResultTests.swift */, - ); - name = Core; - sourceTree = ""; - }; - 4C256A4F1B09656E0065714F /* Features */ = { - isa = PBXGroup; - children = ( - 4C341BB91B1A865A00C1B34D /* CacheTests.swift */, - F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */, - 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */, - 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */, - 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */, - 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */, - F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */, - F8111E5F19A9674D0040E7D1 /* UploadTests.swift */, - 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */, - F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */, - ); - name = Features; - sourceTree = ""; - }; - 4C3238E91B3617A600FE04AE /* Resources */ = { - isa = PBXGroup; - children = ( - 4C33A1171B5207DB00873DFF /* Certificates */, - 4C33A1221B5207DB00873DFF /* Images */, - ); - name = Resources; - sourceTree = ""; - }; - 4C33A1171B5207DB00873DFF /* Certificates */ = { - isa = PBXGroup; - children = ( - B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */, - 4C812C391B535F060017E0BF /* alamofire.org */, - 4C812C381B535F000017E0BF /* disig.sk */, - ); - name = Certificates; - path = Resources/Certificates; - sourceTree = ""; - }; - 4C33A1221B5207DB00873DFF /* Images */ = { - isa = PBXGroup; - children = ( - 4C33A1231B5207DB00873DFF /* rainbow.jpg */, - 4C33A1241B5207DB00873DFF /* unicorn.png */, - ); - name = Images; - path = Resources/Images; - sourceTree = ""; - }; - 4C33A13D1B52080800873DFF /* Root */ = { - isa = PBXGroup; - children = ( - 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */, - ); - name = Root; - sourceTree = ""; - }; - 4C33A13E1B52081100873DFF /* Intermediate */ = { - isa = PBXGroup; - children = ( - 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */, - 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */, - ); - name = Intermediate; - sourceTree = ""; - }; - 4C33A13F1B52081A00873DFF /* Leaf */ = { - isa = PBXGroup; - children = ( - 4C33A1401B52084400873DFF /* Signed by CA1 */, - 4C33A1411B52084E00873DFF /* Signed by CA2 */, - ); - name = Leaf; - sourceTree = ""; - }; - 4C33A1401B52084400873DFF /* Signed by CA1 */ = { - isa = PBXGroup; - children = ( - 4C812C441B535F400017E0BF /* multiple-dns-names.cer */, - 4C812C451B535F400017E0BF /* signed-by-ca1.cer */, - 4C812C461B535F400017E0BF /* test.alamofire.org.cer */, - 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */, - ); - name = "Signed by CA1"; - sourceTree = ""; - }; - 4C33A1411B52084E00873DFF /* Signed by CA2 */ = { - isa = PBXGroup; - children = ( - 4C812C4F1B535F540017E0BF /* expired.cer */, - 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */, - 4C812C511B535F540017E0BF /* signed-by-ca2.cer */, - 4C812C521B535F540017E0BF /* valid-dns-name.cer */, - 4C812C531B535F540017E0BF /* valid-uri.cer */, - ); - name = "Signed by CA2"; - sourceTree = ""; - }; - 4C7C8D201B9D0D7300948136 /* Extensions */ = { - isa = PBXGroup; - children = ( - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */, - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */, - ); - name = Extensions; - sourceTree = ""; - }; - 4C812C381B535F000017E0BF /* disig.sk */ = { - isa = PBXGroup; - children = ( - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */, - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */, - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */, - ); - name = disig.sk; - sourceTree = ""; - }; - 4C812C391B535F060017E0BF /* alamofire.org */ = { - isa = PBXGroup; - children = ( - 4C33A13D1B52080800873DFF /* Root */, - 4C33A13E1B52081100873DFF /* Intermediate */, - 4C33A13F1B52081A00873DFF /* Leaf */, - ); - name = alamofire.org; - sourceTree = ""; - }; - 4CDE2C481AF8A14A00BABAE5 /* Core */ = { - isa = PBXGroup; - children = ( - 4C1DC8531B68908E00476DE3 /* Error.swift */, - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */, - 4CB928281C66BFBC00CE5F08 /* Notifications.swift */, - 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */, - 4CDE2C391AF899EC00BABAE5 /* Request.swift */, - 4C0B62501BB1001C009302D3 /* Response.swift */, - 4C0E5BF71B673D3400816CCC /* Result.swift */, - ); - name = Core; - sourceTree = ""; - }; - 4CDE2C491AF8A14E00BABAE5 /* Features */ = { - isa = PBXGroup; - children = ( - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */, - 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */, - 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */, - 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */, - 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */, - 4C83F41A1B749E0E00203445 /* Stream.swift */, - 4C574E691C67D207000B3128 /* Timeline.swift */, - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */, - 4CDE2C421AF89F0900BABAE5 /* Validation.swift */, - ); - name = Features; - sourceTree = ""; - }; - B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */ = { - isa = PBXGroup; - children = ( - B39E2F831C1A72F8002DA1A9 /* certDER.cer */, - B39E2F841C1A72F8002DA1A9 /* certDER.crt */, - B39E2F851C1A72F8002DA1A9 /* certDER.der */, - B39E2F861C1A72F8002DA1A9 /* certPEM.cer */, - B39E2F871C1A72F8002DA1A9 /* certPEM.crt */, - B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */, - B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */, - ); - name = "Varying Encoding Types and Extensions"; - sourceTree = ""; - }; - F8111E2919A95C8B0040E7D1 = { - isa = PBXGroup; - children = ( - F8111E3519A95C8B0040E7D1 /* Source */, - F8111E3F19A95C8B0040E7D1 /* Tests */, - F8111E3419A95C8B0040E7D1 /* Products */, - ); - sourceTree = ""; - }; - F8111E3419A95C8B0040E7D1 /* Products */ = { - isa = PBXGroup; - children = ( - F8111E3319A95C8B0040E7D1 /* Alamofire.framework */, - F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */, - 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */, - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */, - E4202FE01B667AA100C997FB /* Alamofire.framework */, - 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */, - 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - F8111E3519A95C8B0040E7D1 /* Source */ = { - isa = PBXGroup; - children = ( - F897FF4019AA800700AB5182 /* Alamofire.swift */, - 4CDE2C481AF8A14A00BABAE5 /* Core */, - 4CDE2C491AF8A14E00BABAE5 /* Features */, - F8111E3619A95C8B0040E7D1 /* Supporting Files */, - ); - path = Source; - sourceTree = ""; - }; - F8111E3619A95C8B0040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - F8111E3819A95C8B0040E7D1 /* Alamofire.h */, - F8111E3719A95C8B0040E7D1 /* Info.plist */, - 72998D721BF26173006D3F69 /* Info-tvOS.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - F8111E3F19A95C8B0040E7D1 /* Tests */ = { - isa = PBXGroup; - children = ( - 4C256A501B096C2C0065714F /* BaseTestCase.swift */, - 4C256A4E1B09656A0065714F /* Core */, - 4C7C8D201B9D0D7300948136 /* Extensions */, - 4C256A4F1B09656E0065714F /* Features */, - 4C3238E91B3617A600FE04AE /* Resources */, - F8111E4019A95C8B0040E7D1 /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - F8111E4019A95C8B0040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - F8111E4119A95C8B0040E7D1 /* Info.plist */, - 4C0E02681BF99A18004E7F18 /* Info-tvOS.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 4CF626EC1BA7CB3E0011A099 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF627061BA7CBE30011A099 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C081A5C55C900ED2280 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FDA1B667AA100C997FB /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CEC605C1B745C9B00E684F4 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3019A95C8B0040E7D1 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CF627041BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS" */; - buildPhases = ( - 4CF626EA1BA7CB3E0011A099 /* Sources */, - 4CF626EB1BA7CB3E0011A099 /* Frameworks */, - 4CF626EC1BA7CB3E0011A099 /* Headers */, - 4CF626ED1BA7CB3E0011A099 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire tvOS"; - productName = "Alamofire tvOS"; - productReference = 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - 4CF626F71BA7CB3E0011A099 /* Alamofire tvOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CF627051BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS Tests" */; - buildPhases = ( - 4CF626F41BA7CB3E0011A099 /* Sources */, - 4CF626F51BA7CB3E0011A099 /* Frameworks */, - 4CF626F61BA7CB3E0011A099 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4CF626FB1BA7CB3E0011A099 /* PBXTargetDependency */, - ); - name = "Alamofire tvOS Tests"; - productName = "Alamofire tvOSTests"; - productReference = 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */; - buildPhases = ( - 4DD67C061A5C55C900ED2280 /* Sources */, - 4DD67C071A5C55C900ED2280 /* Frameworks */, - 4DD67C081A5C55C900ED2280 /* Headers */, - 4DD67C091A5C55C900ED2280 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire OSX"; - productName = AlamofireOSX; - productReference = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - E4202FCD1B667AA100C997FB /* Alamofire watchOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = E4202FDD1B667AA100C997FB /* Build configuration list for PBXNativeTarget "Alamofire watchOS" */; - buildPhases = ( - E4202FCE1B667AA100C997FB /* Sources */, - E4202FD91B667AA100C997FB /* Frameworks */, - E4202FDA1B667AA100C997FB /* Headers */, - E4202FDC1B667AA100C997FB /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire watchOS"; - productName = Alamofire; - productReference = E4202FE01B667AA100C997FB /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - F8111E3219A95C8B0040E7D1 /* Alamofire iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */; - buildPhases = ( - F8111E2E19A95C8B0040E7D1 /* Sources */, - F8111E2F19A95C8B0040E7D1 /* Frameworks */, - F8111E3019A95C8B0040E7D1 /* Headers */, - F8111E3119A95C8B0040E7D1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Alamofire iOS"; - productName = Alamofire; - productReference = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */; - buildPhases = ( - F8111E3A19A95C8B0040E7D1 /* Sources */, - F8111E3B19A95C8B0040E7D1 /* Frameworks */, - F8111E3C19A95C8B0040E7D1 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F8111E6619A967880040E7D1 /* PBXTargetDependency */, - ); - name = "Alamofire iOS Tests"; - productName = AlamofireTests; - productReference = F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */; - buildPhases = ( - F829C6AE1A7A94F100A2CD59 /* Sources */, - F829C6AF1A7A94F100A2CD59 /* Frameworks */, - F829C6B01A7A94F100A2CD59 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */, - ); - name = "Alamofire OSX Tests"; - productName = "Alamofire OSX Tests"; - productReference = F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F8111E2A19A95C8B0040E7D1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - 4CF626EE1BA7CB3E0011A099 = { - CreatedOnToolsVersion = 7.1; - }; - 4CF626F71BA7CB3E0011A099 = { - CreatedOnToolsVersion = 7.1; - }; - 4DD67C0A1A5C55C900ED2280 = { - CreatedOnToolsVersion = 6.1.1; - }; - F8111E3219A95C8B0040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - F8111E3D19A95C8B0040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - F829C6B11A7A94F100A2CD59 = { - CreatedOnToolsVersion = 6.1.1; - }; - }; - }; - buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = F8111E2919A95C8B0040E7D1; - productRefGroup = F8111E3419A95C8B0040E7D1 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F8111E3219A95C8B0040E7D1 /* Alamofire iOS */, - F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */, - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */, - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */, - 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */, - 4CF626F71BA7CB3E0011A099 /* Alamofire tvOS Tests */, - E4202FCD1B667AA100C997FB /* Alamofire watchOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 4CF626ED1BA7CB3E0011A099 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F61BA7CB3E0011A099 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */, - 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */, - 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */, - 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */, - 4C743CF81C22772D00BCB23E /* certDER.der in Resources */, - 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */, - 4C743D0B1C22772D00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */, - 4C743D0A1C22772D00BCB23E /* root-ca-disig.cer in Resources */, - 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */, - 4CF627351BA7CC300011A099 /* unicorn.png in Resources */, - 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */, - 4C743D091C22772D00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */, - 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D041C22772D00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C091A5C55C900ED2280 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FDC1B667AA100C997FB /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3119A95C8B0040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3C19A95C8B0040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */, - 4C33A13B1B5207DB00873DFF /* unicorn.png in Resources */, - 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */, - 4C743D281C22772F00BCB23E /* keyDER.der in Resources */, - 4C743D241C22772F00BCB23E /* certDER.der in Resources */, - 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */, - 4C743D371C22772F00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743D221C22772F00BCB23E /* certDER.cer in Resources */, - 4C743D361C22772F00BCB23E /* root-ca-disig.cer in Resources */, - 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */, - 4C33A1391B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */, - 4C743D351C22772F00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743D231C22772F00BCB23E /* certDER.crt in Resources */, - 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D301C22772F00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6B01A7A94F100A2CD59 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */, - 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */, - 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */, - 4C33A13C1B5207DB00873DFF /* unicorn.png in Resources */, - 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */, - 4C743D121C22772E00BCB23E /* keyDER.der in Resources */, - 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */, - 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */, - 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */, - 4C743D211C22772E00BCB23E /* testssl-expire.disig.sk.cer in Resources */, - 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */, - 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */, - 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */, - 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */, - 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */, - 4C743D201C22772E00BCB23E /* root-ca-disig.cer in Resources */, - 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */, - 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */, - 4C33A13A1B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */, - 4C743D1F1C22772E00BCB23E /* intermediate-ca-disig.cer in Resources */, - 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */, - 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */, - 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 4CF626EA1BA7CB3E0011A099 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */, - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */, - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */, - 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */, - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */, - 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */, - 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */, - 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */, - 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */, - 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */, - 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */, - 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */, - 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */, - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */, - 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4CF626F41BA7CB3E0011A099 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */, - 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */, - 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */, - 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */, - 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */, - 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */, - 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */, - 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */, - 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */, - 4CF627171BA7CC240011A099 /* ParameterEncodingTests.swift in Sources */, - 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */, - 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */, - 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */, - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */, - 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */, - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - 4CF6271F1BA7CC240011A099 /* ResponseSerializationTests.swift in Sources */, - 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4DD67C061A5C55C900ED2280 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */, - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */, - 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, - 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */, - 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */, - 4C0B62521BB1001C009302D3 /* Response.swift in Sources */, - 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */, - 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */, - 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */, - 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */, - 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4202FCE1B667AA100C997FB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */, - 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */, - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */, - E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */, - E4202FD11B667AA100C997FB /* Request.swift in Sources */, - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */, - E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */, - E4202FD31B667AA100C997FB /* Manager.swift in Sources */, - 4C0B62531BB1001C009302D3 /* Response.swift in Sources */, - 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */, - E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */, - E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */, - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */, - E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */, - E4202FD71B667AA100C997FB /* Download.swift in Sources */, - E4202FD81B667AA100C997FB /* Validation.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E2E19A95C8B0040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */, - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */, - 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, - 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */, - 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */, - 4C0B62511BB1001C009302D3 /* Response.swift in Sources */, - F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */, - 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */, - 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */, - 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */, - 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */, - 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F8111E3A19A95C8B0040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C3238E71B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, - 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, - 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */, - 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, - 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */, - 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, - F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */, - 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, - F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */, - 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */, - F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */, - F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */, - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */, - F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */, - F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */, - F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */, - 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */, - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F829C6AE1A7A94F100A2CD59 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C3238E81B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, - 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, - 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */, - 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, - 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */, - 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, - F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */, - 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, - F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */, - 4C256A541B096C770065714F /* BaseTestCase.swift in Sources */, - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */, - F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */, - F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */, - F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */, - F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */, - F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */, - 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, - F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */, - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4CF626FB1BA7CB3E0011A099 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */; - targetProxy = 4CF626FA1BA7CB3E0011A099 /* PBXContainerItemProxy */; - }; - F8111E6619A967880040E7D1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F8111E3219A95C8B0040E7D1 /* Alamofire iOS */; - targetProxy = F8111E6519A967880040E7D1 /* PBXContainerItemProxy */; - }; - F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */; - targetProxy = F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 4C0FFAF81C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = ReleaseTest; - }; - 4C0FFAF91C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - }; - name = ReleaseTest; - }; - 4C0FFAFA1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = ReleaseTest; - }; - 4C0FFAFB1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = ReleaseTest; - }; - 4C0FFAFC1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = ReleaseTest; - }; - 4C0FFAFD1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4C0FFAFE1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = ReleaseTest; - }; - 4C0FFAFF1C212C71009085A1 /* ReleaseTest */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = ReleaseTest; - }; - 4CF627001BA7CB3E0011A099 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4CF627011BA7CB3E0011A099 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Source/Info-tvOS.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = appletvos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4CF627021BA7CB3E0011A099 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Debug; - }; - 4CF627031BA7CB3E0011A099 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; - }; - name = Release; - }; - 4DD67C1F1A5C55C900ED2280 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 4DD67C201A5C55C900ED2280 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - FRAMEWORK_VERSION = A; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SDKROOT = macosx; - SKIP_INSTALL = YES; - }; - name = Release; - }; - E4202FDE1B667AA100C997FB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Debug; - }; - E4202FDF1B667AA100C997FB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = Source/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = watchos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = 4; - }; - name = Release; - }; - F8111E4419A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Debug; - }; - F8111E4519A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - WATCHOS_DEPLOYMENT_TARGET = 2.0; - }; - name = Release; - }; - F8111E4719A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - F8111E4819A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = NO; - INFOPLIST_FILE = Source/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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = Alamofire; - SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - }; - name = Release; - }; - F8111E4A19A95C8B0040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - F8111E4B19A95C8B0040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - 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.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - F829C6BC1A7A94F100A2CD59 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Debug; - }; - F829C6BD1A7A94F100A2CD59 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4CF627041BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CF627001BA7CB3E0011A099 /* Debug */, - 4CF627011BA7CB3E0011A099 /* Release */, - 4C0FFAFD1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4CF627051BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CF627021BA7CB3E0011A099 /* Debug */, - 4CF627031BA7CB3E0011A099 /* Release */, - 4C0FFAFE1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4DD67C1F1A5C55C900ED2280 /* Debug */, - 4DD67C201A5C55C900ED2280 /* Release */, - 4C0FFAFB1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E4202FDD1B667AA100C997FB /* Build configuration list for PBXNativeTarget "Alamofire watchOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E4202FDE1B667AA100C997FB /* Debug */, - E4202FDF1B667AA100C997FB /* Release */, - 4C0FFAFF1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4419A95C8B0040E7D1 /* Debug */, - F8111E4519A95C8B0040E7D1 /* Release */, - 4C0FFAF81C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E4619A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4719A95C8B0040E7D1 /* Debug */, - F8111E4819A95C8B0040E7D1 /* Release */, - 4C0FFAF91C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E4919A95C8B0040E7D1 /* Build configuration list for PBXNativeTarget "Alamofire iOS Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E4A19A95C8B0040E7D1 /* Debug */, - F8111E4B19A95C8B0040E7D1 /* Release */, - 4C0FFAFA1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F829C6BC1A7A94F100A2CD59 /* Debug */, - F829C6BD1A7A94F100A2CD59 /* Release */, - 4C0FFAFC1C212C71009085A1 /* ReleaseTest */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F8111E2A19A95C8B0040E7D1 /* Project object */; -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7d39b0e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme deleted file mode 100644 index 2052c92..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme deleted file mode 100644 index b5f528e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme deleted file mode 100644 index bdf82c7..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme deleted file mode 100644 index 9f7c434..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 748f4a0..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CHANGELOG.md b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CHANGELOG.md deleted file mode 100644 index 4c77692..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CHANGELOG.md +++ /dev/null @@ -1,1193 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -`Alamofire` adheres to [Semantic Versioning](http://semver.org/). - -#### 3.x Releases -- `3.2.x` Releases - [3.2.0](#320) -- `3.1.x` Releases - [3.1.0](#310) | [3.1.1](#311) | [3.1.2](#312) | [3.1.3](#313) | [3.1.4](#314) | [3.1.5](#315) -- `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301) -- `3.0.0` Betas - [3.0.0-beta.1](#300-beta1) | [3.0.0-beta.2](#300-beta2) | [3.0.0-beta.3](#300-beta3) - -#### 2.x Releases -- `2.0.x` Releases - [2.0.0](#200) | [2.0.1](#201) | [2.0.2](#202) -- `2.0.0` Betas - [2.0.0-beta.1](#200-beta1) | [2.0.0-beta.2](#200-beta2) | [2.0.0-beta.3](#200-beta3) | [2.0.0-beta.4](#200-beta4) - -#### 1.x Releases -- `1.3.x` Releases - [1.3.0](#130) | [1.3.1](#131) -- `1.2.x` Releases - [1.2.0](#120) | [1.2.1](#121) | [1.2.2](#122) | [1.2.3](#123) -- `1.1.x` Releases - [1.1.0](#110) | [1.1.1](#111) | [1.1.2](#112) | [1.1.3](#113) | [1.1.4](#114) | [1.1.5](#115) -- `1.0.x` Releases - [1.0.0](#100) | [1.0.1](#101) - ---- - -## [3.2.0](https://github.com/Alamofire/Alamofire/releases/tag/3.2.0) -Released on 2016-02-07. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.2.0). - -#### Added -- Notifications that post when an `NSURLSessionTask` changes state to allow support for the - network activity indicator. - - Added by [Christian Noon](https://github.com/cnoon). -- `Timeline` struct to capture timings throughout the lifecycle of a `Request`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1054](https://github.com/Alamofire/Alamofire/issues/1054). -- A new `Timeline` section to the README. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1054](https://github.com/Alamofire/Alamofire/issues/1054). -- `NetworkReachabilityManager` to listen for reachability status changes. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). -- Unit tests for all the testable network reachability manager APIs. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). -- A new `Network Reachability` section to the README. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#1053](https://github.com/Alamofire/Alamofire/issues/1053). - -#### Updated -- The `NSURLSessionStream` APIs to support `tvOS`. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `ParameterEncoding` encode method to allow empty parameters to still be encoded. - - Updated by [Christian Noon](https://github.com/cnoon) in Regards to Issues - [#1032](https://github.com/Alamofire/Alamofire/issues/1032) and - [#1049](https://github.com/Alamofire/Alamofire/issues/1049). - -#### Fixed -- Broken CocoaDocs generation by moving iOS Example project into Examples folder. - - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request - [#1027](https://github.com/Alamofire/Alamofire/issues/1027) in Regards to Issue - [#1025](https://github.com/Alamofire/Alamofire/issues/1025). - ---- - -## [3.1.5](https://github.com/Alamofire/Alamofire/releases/tag/3.1.5) -Released on 2016-01-17. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.5). - -#### Added -- `Package.swift` to the project to support Swift Package Manager (SPM). - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#979](https://github.com/Alamofire/Alamofire/pull/979). -- Safeguards to the `Request` class's `debugDescription` property. - - Added by [tokorom](https://github.com/tokorom) in Pull Request - [#983](https://github.com/Alamofire/Alamofire/pull/983). - -#### Updated -- `Accept-Language` header generation to use functional style. - - Updated by [Dapeng Gao](https://github.com/dapenggao) in Pull Request - [#982](https://github.com/Alamofire/Alamofire/pull/982). -- `Accept-Encoding` and `Accept-Language` header values to have separator spaces between values. - - Updated by [Christian Noon](https://github.com/cnoon). -- Copyright headers to include 2016! 🎉🎉🎉 - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.1.4](https://github.com/Alamofire/Alamofire/releases/tag/3.1.4) -Released on 2015-12-16. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.4). - -#### Added -- `NSTemporaryExceptionMinimumTLSVersion` documentation to the ATS section in the README. - - Added by [Marandon Antoine](https://github.com/ntnmrndn) in Pull Request - [#952](https://github.com/Alamofire/Alamofire/pull/952). -- Added `ReleaseTest` configuration to allow running tests against optimized build. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Carthage instructions in the README to clearly callout the `carthage update` command. - - Updated by [vlad](https://github.com/vlastachu) in Pull Request - [#955](https://github.com/Alamofire/Alamofire/pull/955). -- `ParameterEncoding` to early out when passed an empty parameters dictionary. - - Updated by [Anthony Miller](https://github.com/AnthonyMDev) in Pull Request - [#954](https://github.com/Alamofire/Alamofire/pull/954). -- The `certificatesInBundle` to support `cer`, `crt` and `der` extensions. - - Updated by [Jacob Jennings](https://github.com/jacobjennings) in Pull Request - [#956](https://github.com/Alamofire/Alamofire/pull/956). -- The `ENABLE_TESTABILITY` flag to `NO` for Release configuration and disabled tests for - non-test builds to better support Carthage. - - Updated by [Jed Lewison](https://github.com/jedlewison) in Pull Request - [#953](https://github.com/Alamofire/Alamofire/pull/953). -- The server certificates for the TLS tests and added all certificates to all test targets. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Travis-CI configuration to Xcode 7.2, iOS 9.2, tvOS 9.1 and watchOS 2.1. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- `SecCertificate` array Swift workaround in `ServerTrustPolicy` for Xcode 7.2. - - Removed by [Christian Noon](https://github.com/cnoon). - -## [3.1.3](https://github.com/Alamofire/Alamofire/releases/tag/3.1.3) -Released on 2015-11-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.3). - -#### Added -- Custom `Info.plist` for tvOS setting the `UIRequiredDeviceCapabilities` to `arm64`. - - Added by [Simon Støvring](https://github.com/simonbs) in Pull Request - [#913](https://github.com/Alamofire/Alamofire/pull/913). - -#### Updated -- All code samples in the README to use `https` instead of `http`. - - Updated by [Tomonobu Sato](https://github.com/tmnb) in Pull Request - [#912](https://github.com/Alamofire/Alamofire/pull/912). - -## [3.1.2](https://github.com/Alamofire/Alamofire/releases/tag/3.1.2) -Released on 2015-11-06. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.2). - -#### Updated -- Code signing on iOS simulator builds to not sign simulator builds. - - Updated by [John Heaton](https://github.com/JRHeaton) in Pull Request - [#903](https://github.com/Alamofire/Alamofire/pull/903). -- Code signing on watchOS and tvOS simulators builds to not sign simulator builds. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.1.1](https://github.com/Alamofire/Alamofire/releases/tag/3.1.1) -Released on 2015-10-31. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.1). - -#### Added -- Support for 204 response status codes in the response serializers. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#889](https://github.com/Alamofire/Alamofire/pull/889). -- ATS section to the README explaining how to configure the settings. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#876](https://github.com/Alamofire/Alamofire/issues/876). - -#### Updated -- Several unnecessary uses of `NSString` with `String`. - - Updated by [Nicholas Maccharoli](https://github.com/Nirma) in Pull Request - [#885](https://github.com/Alamofire/Alamofire/pull/885). -- Content type validation to always succeeds when server data is `nil` or zero length. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#890](https://github.com/Alamofire/Alamofire/pull/890). - -#### Removed -- The mention of rdar://22307360 from the README since Xcode 7.1 has been released. - - Removed by [Elvis Nuñez](https://github.com/3lvis) in Pull Request - [#891](https://github.com/Alamofire/Alamofire/pull/891). -- An unnecessary availability check now that Xcode 7.1 is out of beta. - - Removed by [Christian Noon](https://github.com/cnoon). -- The playground from the project due to instability reasons. - - Removed by [Christian Noon](https://github.com/cnoon). -- The data length checks in the `responseData` and `responseString` serializers. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#889](https://github.com/Alamofire/Alamofire/pull/889). - -## [3.1.0](https://github.com/Alamofire/Alamofire/releases/tag/3.1.0) -Released on 2015-10-22. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.0). - -#### Added -- New tvOS framework and test targets to the project. - - Added by [Bob Scarano](https://github.com/bscarano) in Pull Request - [#767](https://github.com/Alamofire/Alamofire/pull/767). -- The tvOS deployment target to the podspec. - - Added by [Christian Noon](https://github.com/cnoon). -- The `BITCODE_GENERATION_MODE` user defined setting to tvOS framework target. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The README to include tvOS and bumped the required version of Xcode. - - Updated by [Christian Noon](https://github.com/cnoon). -- The default tvOS and watchOS deployment targets in the Xcode project. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `APPLICATION_EXTENSION_API_ONLY` enabled flag to `YES` in the tvOS framework target. - - Updated by [James Barrow](https://github.com/Baza207) in Pull Request - [#771](https://github.com/Alamofire/Alamofire/pull/771). -- The Travis-CI yaml file to run watchOS and tvOS builds and tests on xcode7.1 osx_image. - - Updated by [Christian Noon](https://github.com/cnoon). - ---- - -## [3.0.1](https://github.com/Alamofire/Alamofire/releases/tag/3.0.1) -Released on 2015-10-19. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.1). - -#### Added -- Tests around content type validation with accept parameters. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Content type validation issue where parameter parsing on `;` was incorrect. - - Fixed by [Christian Noon](https://github.com/cnoon). - -## [3.0.0](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0) -Released on 2015-10-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0). - -#### Updated -- `Downloading a File` code sample in the README to compile against Swift 2.0. - - Updated by [Screon](https://github.com/Screon) in Pull Request - [#827](https://github.com/Alamofire/Alamofire/pull/827). -- Download code samples in the README to use `response` serializer. - - Updated by [Christian Noon](https://github.com/cnoon). -- CocoaPods and Carthage installation instructions for 3.0. - - Updated by [Christian Noon](https://github.com/cnoon). -- Carthage description and installation instructions in the README. - - Updated by [Ashton Williams](https://github.com/Ashton-W) in Pull Request - [#843](https://github.com/Alamofire/Alamofire/pull/843). -- URL encoding internals to leverage the dictionary keys lazy evaluation. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Small typo in the Alamofire 3.0 Migration Guide `Response` section. - - Fixed by [neugartf](https://github.com/neugartf) in Pull Request - [#826](https://github.com/Alamofire/Alamofire/pull/826). -- User defined `BITCODE_GENERATION_MODE` setting for Carthage builds. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#835](https://github.com/Alamofire/Alamofire/issues/835). - ---- - -## [3.0.0-beta.3](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.3) -Released on 2015-09-27. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.3). - -#### Updated -- The `Response` initializer to have a `public` ACL instead of `internal`. - - Updated by [Christian Noon](https://github.com/cnoon). - -## [3.0.0-beta.2](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.2) -Released on 2015-09-26. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.2). - -#### Added -- Tests around the header behavior for redirected requests. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#798](https://github.com/Alamofire/Alamofire/issues/798). -- A migration guide for Alamofire 3.0 documenting all API changes. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- `Response` initializer to have `internal` ACL. - - Updated by [Christian Noon](https://github.com/cnoon). -- All sample code in the README to conform to the Alamofire 3.0 APIs. - - Updated by [Christian Noon](https://github.com/cnoon). -- URL percent escaping to only batch on OS's where required improving -overall performance. - - Updated by [Christian Noon](https://github.com/cnoon). -- Basic auth example in the README to compile on Swift 2.0. - - Updated by [David F. Muir V](https://github.com/dfmuir) in Pull Request - [#810](https://github.com/Alamofire/Alamofire/issues/810). - -#### Fixed -- Compiler errors in the playground due to the new response serializer APIs. - - Fixed by [Christian Noon](https://github.com/cnoon). - -## [3.0.0-beta.1](https://github.com/Alamofire/Alamofire/releases/tag/3.0.0-beta.1) -Released on 2015-09-21. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.0.0-beta.1). - -#### Added -- A new `Response` struct to simplify response serialization. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#792](https://github.com/Alamofire/Alamofire/pull/792). -- A new initializer to the `Manager` allowing dependency injection of the -underlying `NSURLSession`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#795](https://github.com/Alamofire/Alamofire/pull/795). -- Tests around the new `Manager` initialization methods. - -#### Updated -- Result type to take two generic parameters (`Value` and `Error`) where `Error` -conforms to `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All response serializers to now return the original server data as `NSData?`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- The `TaskDelegate` to store an error as an `NSError` instead of `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- The `ValidationResult` failure case to require an `NSError` instead of `ErrorType`. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All tests around response serialization and `Result` type usage. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#791](https://github.com/Alamofire/Alamofire/pull/791). -- All response serializers to use the new `Response` type. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - - [#792](https://github.com/Alamofire/Alamofire/pull/792). -- The designated initializer for a `Manager` to accept a `SessionDelegate` parameter -allowing dependency injection for better background session support. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#795](https://github.com/Alamofire/Alamofire/pull/795). - ---- - -## [2.0.2](https://github.com/Alamofire/Alamofire/releases/tag/2.0.2) -Released on 2015-09-20. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.2). - -#### Updated -- The Embedded Framework documentation to include `git init` info. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#782](https://github.com/Alamofire/Alamofire/issues/782). - -#### Fixed -- Alamofire iOS framework target by adding Alamofire iOS Tests as Target Dependency. - - Fixed by [Nicky Gerritsen](https://github.com/nickygerritsen) in Pull Request - [#780](https://github.com/Alamofire/Alamofire/pull/780). -- Percent encoding issue for long Chinese strings using URL parameter encoding. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#206](https://github.com/Alamofire/Alamofire/issues/206). - -## [2.0.1](https://github.com/Alamofire/Alamofire/releases/tag/2.0.1) -Released on 2015-09-16. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.1). - -#### Updated -- The CocoaPods installation instructions in the README. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Carthage installation instructions in the README. - - Updated by [Gustavo Barbosa](https://github.com/barbosa) in Pull Request - [#759](https://github.com/Alamofire/Alamofire/pull/759). - -#### Fixed -- The link to the 2.0 migration guide in the README. - - Fixed by [Dwight Watson](https://github.com/dwightwatson) in Pull Request - [#750](https://github.com/Alamofire/Alamofire/pull/750). -- Issue where NTLM authentication credentials were not used for authentication challenges. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#721](https://github.com/Alamofire/Alamofire/pull/721). - -## [2.0.0](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0) -Released on 2015-09-09. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0). - -#### Added -- A new `URLEncodedInURL` case to the `ParameterEncoding` for encoding in the URL. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#742](https://github.com/Alamofire/Alamofire/pull/742). - ---- - -## [2.0.0-beta.4](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.4) -Released on 2015-09-06. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.4). - -#### Added -- The `parameters` and `encoding` parameters to download APIs. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#719](https://github.com/Alamofire/Alamofire/issues/719). -- Section to the README about wildcard domain matching with server trust policies. - - Added by [Sai](https://github.com/sai-prasanna) in Pull Request - [#718](https://github.com/Alamofire/Alamofire/pull/718). -- A UTF-8 charset to Content-Type header for a URL encoded body. - - Added by [Cheolhee Han](https://github.com/cheolhee) in Pull Request - [#731](https://github.com/Alamofire/Alamofire/pull/731). -- Tests around posting unicode parameters with URL encoding. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Pull Request - [#731](https://github.com/Alamofire/Alamofire/pull/731). -- Tests for uploading base 64 encoded image data inside JSON. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#738](https://github.com/Alamofire/Alamofire/issues/738). -- An Alamofire 2.0 migration guide document to the new Documentation folder. - - Added by [Christian Noon](https://github.com/cnoon). -- A Migration Guides section to the README with link to 2.0 guide. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- Response serialization to prevent unnecessary call to response serializer. - - Updated by [Julien Ducret](https://github.com/brocoo) in Pull Request - [#716](https://github.com/Alamofire/Alamofire/pull/716). -- Travis-CI yaml file to support iOS 9, OSX 10.11 and Xcode 7. - - Updated by [Christian Noon](https://github.com/cnoon). -- Result types to store an `ErrorType` instead of `NSError`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#732](https://github.com/Alamofire/Alamofire/issues/732). -- Docstrings on the download method to be more accurate. - - Updated by [Christian Noon](https://github.com/cnoon). -- The README to require Xcode 7 beta 6. - - Updated by [Christian Noon](https://github.com/cnoon). -- The background session section of the README to use non-deprecated API. - - Updated by [David F. Muir V](https://github.com/dfmuir) in Pull Request - [#724](https://github.com/Alamofire/Alamofire/pull/724). -- The playground to use the `Result` type. - - Updated by [Jonas Schmid](https://github.com/jschmid) in Pull Request - [#726](https://github.com/Alamofire/Alamofire/pull/726). -- Updated progress code samples in the README to show how to call onto the main queue. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- The AFNetworking sections from the FAQ in the README. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Issue on Windows where the wildcarded cert name in the test suite included asterisk. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#723](https://github.com/Alamofire/Alamofire/issues/723). -- Crash when multipart form data was uploaded from in-memory data on background session. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#740](https://github.com/Alamofire/Alamofire/issues/740). -- Issue where the background session completion handler was not called on the main queue. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#728](https://github.com/Alamofire/Alamofire/issues/728). - -## [2.0.0-beta.3](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.3) -Released on 2015-08-25. - -#### Removed -- The override for `NSMutableURLRequest` for the `URLRequestConvertible` protocol -conformance that could cause unwanted URL request referencing. - - Removed by [Christian Noon](https://github.com/cnoon). - -## [2.0.0-beta.2](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.2) -Released on 2015-08-24. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.2). - -#### Added -- Host and certificate chain validation section to the README. - - Added by [Christian Noon](https://github.com/cnoon). -- Tests verifying configuration headers are sent with all configuration types. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#692](https://github.com/Alamofire/Alamofire/issues/692). -- New rdar to the list in the README about the #available check issue. - - Added by [Christian Noon](https://github.com/cnoon). -- Override for `NSMutableURLRequest` for the `URLRequestConvertible` protocol. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- The README to note that CocoaPods 0.38.2 is required. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#682](https://github.com/Alamofire/Alamofire/issues/682). -- The README to include note about keeping a reference to the `Manager`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#681](https://github.com/Alamofire/Alamofire/issues/681). -- Server trust host validation over to use SSL policy evaluation. - - Updated by [Christian Noon](https://github.com/cnoon). -- The documentation for the `URLRequestConvertible` section in the README. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `ServerTrustPolicyManager` to be more flexible by using `public` ACL. - - Updated by [Jan Riehn](https://github.com/jriehn) in Pull Request - [#696](https://github.com/Alamofire/Alamofire/pull/696). -- The `ServerTrustPolicyManager` policies property to use `public` ACL and -added docstrings. - - Updated by [Christian Noon](https://github.com/cnoon). -- The Ono response serializer example for Swift 2.0 in the README. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#700](https://github.com/Alamofire/Alamofire/issues/700). -- `Result` failure case to store an `ErrorType` instead of `NSError`. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#703](https://github.com/Alamofire/Alamofire/issues/703). -- All source code to compile with Xcode 7 beta 6. - - Updated by [Michael Gray](https://github.com/mishagray) in Pull Request - [#707](https://github.com/Alamofire/Alamofire/pull/707). - -#### Removed -- The `required` declaration on the `Manager` init method. - - Removed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#672](https://github.com/Alamofire/Alamofire/issues/672). - -#### Fixed -- Issue where the `TaskDelegate` operation queue would leak if the task was -never started. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Compiler issue on OS X target when creating background configurations -in the test suite. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#693](https://github.com/Alamofire/Alamofire/issues/693). - -## [2.0.0-beta.1](https://github.com/Alamofire/Alamofire/releases/tag/2.0.0-beta.1) -Released on 2015-08-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A2.0.0-beta.1). - -#### Added -- A `watchOS` deployment target to the podspec. - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#574](https://github.com/Alamofire/Alamofire/pull/574). -- Full screen support in the iOS Example App. - - Added by [Corinne Krych](https://github.com/corinnekrych) in Pull Request - [#612](https://github.com/Alamofire/Alamofire/pull/612). -- Temporary workaround for `SecCertificate` array compiler crash. - - Added by [Robert Rasmussen](https://github.com/robrasmussen) in Issue - [#610](https://github.com/Alamofire/Alamofire/issues/610). -- `Result` and `Error` types to refactor response validation and serialization. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#627](https://github.com/Alamofire/Alamofire/pull/627). -- Tests around response data, string and json serialization result behavior. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#627](https://github.com/Alamofire/Alamofire/pull/627). -- `CustomStringConvertible` and `CustomDebugStringConvertible` conformance -to the `Result` enumeration. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- A Resume Data section to the README inside the Downloads section. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- A `watchOS` framework target to the project. - - Added by [Tobias Ottenweller](https://github.com/tomco) in Pull Request - [#616](https://github.com/Alamofire/Alamofire/pull/616). -- `Result` tests pushing code coverage for `Result` enum to 100%. - - Added by [Christian Noon](https://github.com/cnoon). -- Tests around all response serializer usage. - - Added by [Christian Noon](https://github.com/cnoon). -- Public docstrings for all public `SessionDelegate` methods. - - Added by [Christian Noon](https://github.com/cnoon). -- A section to the README that calls out all open rdars affecting Alamofire. - - Added by [Christian Noon](https://github.com/cnoon). -- Test for wildcard validation that contains response with nil MIME type. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#662](https://github.com/Alamofire/Alamofire/pull/662). -- Support for stream tasks in iOS 9+ and OSX 10.11+. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#659](https://github.com/Alamofire/Alamofire/pull/659). - -#### Updated -- All logic to compile against Swift 2.0. - - Updated by [Christian Noon](https://github.com/cnoon). -- All logic to use the latest Swift 2.0 conventions. - - Updated by [Christian Noon](https://github.com/cnoon). -- All public docstrings to the latest Swift 2.0 syntax. - - Updated by [Christian Noon](https://github.com/cnoon). -- `URLRequestConvertible` to return an `NSMutableURLRequest`. - - Updated by [Christian Noon](https://github.com/cnoon). -- All HTTP requests to HTTPS to better align with ATS. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `escape` method in `ParameterEncoding` to use non-deprecated methods. - - Updated by [Christian Noon](https://github.com/cnoon). -- All source code and docstrings to fit roughly within 120 characters. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `MultipartFormData` encoding to leverage Swift 2.0 error handling. - - Updated by [Christian Noon](https://github.com/cnoon). -- All README code samples to match the latest Swift 2.0 API changes. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#648](https://github.com/Alamofire/Alamofire/pull/648). -- All frameworks to enable code coverage generation. - - Updated by [Christian Noon](https://github.com/cnoon). -- All frameworks to set the enable testability flag to YES for release builds. - - Updated by [Christian Noon](https://github.com/cnoon) in regard to Issue - [#652](https://github.com/Alamofire/Alamofire/issues/652). -- `ParameterEncoding` to leverage guard for parameters to increase safety. - - Updated by [Christian Noon](https://github.com/cnoon). -- iOS Example App to use optional bind around response to safely extract headers. - - Updated by [John Pope](https://github.com/johndpope) in Pull Request - [#665](https://github.com/Alamofire/Alamofire/pull/665). -- The `queryComponents` and `escape` methods in `ParameterEncoding` to `public` to -better support `.Custom` encoding. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#660](https://github.com/Alamofire/Alamofire/pull/660). -- The static error convenience functions to a public ACL. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#668](https://github.com/Alamofire/Alamofire/issues/668). - -#### Removed -- Explicit string values in `ParameterEncoding` since they are now implied. - - Removed by [Christian Noon](https://github.com/cnoon). -- An OSX cookie check in the `CustomDebugStringConvertible` conformance of a `Request`. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Issue in automatic validation tests where mutable URL request was not used. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Potential crash cases in Validation MIME type logic exposed by chaining. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Compiler issue in the iOS Example App around `Result` type usage. - - Fixed by [Jan Kase](https://github.com/jankase) in Pull Request - [#639](https://github.com/Alamofire/Alamofire/pull/639). -- The error code in the custom response serializers section of the README. - - Fixed by [Christian Noon](https://github.com/cnoon). - ---- - -## [1.3.1](https://github.com/Alamofire/Alamofire/releases/tag/1.3.1) -Released on 2015-08-10. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.3.1). - -#### Fixed -- Issue where a completed task was not released by the `SessionDelegate` if the -task override closure was set. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#622](https://github.com/Alamofire/Alamofire/issues/622). - -## [1.3.0](https://github.com/Alamofire/Alamofire/releases/tag/1.3.0) -Released on 2015-07-24. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.3.0). - -#### Added -- Test case around `NSURLProtocol` checking header passthrough behaviors. - - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#473](https://github.com/Alamofire/Alamofire/issues/473). -- Stream method on `Request` to receive data incrementally from data responses. - - Added by [Peter Sobot](https://github.com/psobot) in Pull Request - [#512](https://github.com/Alamofire/Alamofire/pull/512). -- Example to the README demonstrating how to use the `responseCollection` serializer. - - Added by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#532](https://github.com/Alamofire/Alamofire/pull/532). -- Link to the README to the CocoaDocs documentation for Alamofire. - - Added by [Robert](https://github.com/rojotek) in Pull Request - [#541](https://github.com/Alamofire/Alamofire/pull/541). -- Support for uploading `MultipartFormData` in-memory and streaming from disk. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#539](https://github.com/Alamofire/Alamofire/pull/539). -- Tests for uploading `MultipartFormData` with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#539](https://github.com/Alamofire/Alamofire/pull/539). -- The iOS 8.4 simulator to the Travis CI builds by switching to the Xcode 6.4 build. - - Added by [Syo Ikeda](https://github.com/ikesyo) in Pull Request - [#568](https://github.com/Alamofire/Alamofire/pull/568). -- Tests for the custom header support with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- Section to the README about new HTTP header support in the global functions. - - Added by [Christian Noon](https://github.com/cnoon). -- Basic auth `Authorization` header example to the README. - - Added by [Christian Noon](https://github.com/cnoon). -- TLS certificate and public key pinning support through the `ServerTrustPolicy`. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- Tests for TLS certificate and public key pinning with complete code coverage. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- Security section to the README detailing various server trust policies. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#581](https://github.com/Alamofire/Alamofire/pull/581). -- The `resumeData` property to `Request` to expose outside data response serializer. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#595](https://github.com/Alamofire/Alamofire/pull/595). -- Download request sample to iOS example app. - - Added by [Kengo Yokoyama](https://github.com/kentya6) in Pull Request - [#579](https://github.com/Alamofire/Alamofire/pull/579). - -#### Updated -- The INFOPLIST_FILE Xcode project setting to be a relative path. - - Updated by [Christian Noon](https://github.com/cnoon). -- Exposed persistence parameter for basic auth credentials. - - Updated by [Christian Noon](https://github.com/cnoon) in regard to Issue - [#537](https://github.com/Alamofire/Alamofire/issues/537). -- The Travis CI builds to run a full `pod lib lint` pass on the source. - - Updated by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#542](https://github.com/Alamofire/Alamofire/pull/542). -- All cases of force unwrapping with optional binding and where clause when applicable. - - Updated by [Syo Ikeda](https://github.com/ikesyo) in Pull Request - [#557](https://github.com/Alamofire/Alamofire/pull/557). -- The `ParameterEncoding` encode return tuple to return a mutable URL request. - - Updated by [Petr Korolev](https://github.com/skywinder) in Pull Request - [#478](https://github.com/Alamofire/Alamofire/pull/478). -- The `URLRequest` convenience method to return a mutable `NSURLRequest`. - - Updated by [Christian Noon](https://github.com/cnoon). -- The `request` / `download` / `upload` methods to support custom headers. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- The global `request` / `download` / `upload` method external parameters convention. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#586](https://github.com/Alamofire/Alamofire/pull/586). -- Response serialization to use generics and a `ResponseSerializer` protocol. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#593](https://github.com/Alamofire/Alamofire/pull/593). -- Download task delegate to store resume data for a failed download if available. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#595](https://github.com/Alamofire/Alamofire/pull/595). -- The `TaskDelegate.queue` to public to allow custom request extension operations. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#590](https://github.com/Alamofire/Alamofire/pull/590). -- The README code samples for Advanced Response Serialization. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- An unnecessary `NSURLSessionConfiguration` type declaration that can be inferred. - - Removed by [Avismara](https://github.com/avismarahl) in Pull Request - [#576](https://github.com/Alamofire/Alamofire/pull/576). -- Unnecessary `respondsToSelector` overrides for `SessionDelegate` methods. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#590](https://github.com/Alamofire/Alamofire/pull/590). -- Unnecessary calls to `self` throughout source, test and example logic. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- Random test suite basic auth failures by clearing credentials in `setUp` method. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Error where wildcard was failing due to missing response MIME type. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#598](https://github.com/Alamofire/Alamofire/pull/598). -- Typo in the basic auth headers example code in the README. - - Fixed by [蒲公英の生活](https://github.com/fewspider) in Pull Request - [#605](https://github.com/Alamofire/Alamofire/pull/605). -- Issue where the example app was printing elapsed time in optional form. - - Fixed by [Christian Noon](https://github.com/cnoon). - -#### Upgrade Notes -There are a couple changes in the 1.3.0 release that are not fully backwards -compatible and need to be called out. - -* The global `request` / `download` / `upload` external parameter naming conventions -were not consistent nor did they match the `Manager` equivalents. By making them -consistent across the board, this introduced the possibility that you "may" need to -make slight modifications to your global function calls. -* In order to support generic response serializers, the lowest level -`Request.response` method had to be converted to a generic method leveraging the new -`ResponseSerializer` protocol. This has many advantages, the most obvious being that -the `response` convenience method now returns an `NSData?` optional instead of an -`AnyObject?` optional. Nice! - - > Please note that every effort is taken to maintain proper semantic versioning. In -these two rare cases, it was deemed to be in the best interest of the community to -slightly break semantic versioning to unify naming conventions as well as expose a -much more powerful form of response serialization. - - > If you have any issues, please don't hesitate to reach out through -[GitHub](https://github.com/Alamofire/Alamofire/issues) or -[Twitter](https://twitter.com/AlamofireSF). - ---- - -## [1.2.3](https://github.com/Alamofire/Alamofire/releases/tag/1.2.3) -Released on 2015-06-12. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.2.3). - -#### Added -- Tests for data task progress closure and NSProgress updates. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#494](https://github.com/Alamofire/Alamofire/pull/494). -- More robust tests around download and upload progress. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#494](https://github.com/Alamofire/Alamofire/pull/494). -- More robust redirect tests around default behavior and task override closures. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#507](https://github.com/Alamofire/Alamofire/pull/507). -- The "[" and "]" to the legal escape characters and added more documentation. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#504](https://github.com/Alamofire/Alamofire/pull/504). -- Percent escaping tests around reserved / unreserved / illegal characters. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#504](https://github.com/Alamofire/Alamofire/pull/504). -- Tests for various Cache-Control headers with different request cache policies. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#505](https://github.com/Alamofire/Alamofire/pull/505). -- Link to Carthage in the README. - - Added by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#520](https://github.com/Alamofire/Alamofire/pull/520). - -#### Updated -- iOS 7 instructions to cover multiple Swift files in the README. - - Updated by [Sébastien Michoy](https://github.com/SebastienMichoy) in regards - to Issue [#479](https://github.com/Alamofire/Alamofire/pull/479). -- All tests to follow the Given / When / Then structure. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- All tests to be crash safe. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- The OS X tests so that they are all passing again. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#489](https://github.com/Alamofire/Alamofire/pull/489). -- Re-enabled Travis-CI tests for both iOS and Mac OS X. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run all tests in both debug and release. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run all tests on iOS 8.1, 8.2 and 8.3 as well as Mac OS X 10.10. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). -- Travis-CI test suite to run `pod lib lint` against the latest version of CocoaPods. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#506](https://github.com/Alamofire/Alamofire/pull/506). - -#### Fixed -- Random deinitialization test failure by handling task state race condition. - - Fixed by [Christian Noon](https://github.com/cnoon). -- Typo in the API Parameter Abstraction in the README. - - Fixed by [Josh Brown](https://github.com/joshuatbrown) in Pull Request - [#500](https://github.com/Alamofire/Alamofire/pull/500). -- Cookies are now only applied in the DebugPrintable API when appropriate. - - Fixed by [Alex Plescan](https://github.com/alexpls) in Pull Request - [#516](https://github.com/Alamofire/Alamofire/pull/516). - -## [1.2.2](https://github.com/Alamofire/Alamofire/releases/tag/1.2.2) -Released on 2015-05-13. All issues associated with this milestone can be found using this -[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A1.2.2). - -#### Added -- Contributing Guidelines document to the project. - - Added by [Mattt Thompson](https://github.com/mattt). -- Documentation to the `URLStringConvertible` protocol around RFC specs. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#464](https://github.com/Alamofire/Alamofire/pull/464). -- The `Carthage/Build` ignore flag to the `.gitignore` file. - - Added by [Tomáš Slíž](https://github.com/tomassliz) in Pull Request - [#451](https://github.com/Alamofire/Alamofire/pull/451). -- The `.DS_Store` ignore flag to the `.gitignore` file. - - Added by [Christian Noon](https://github.com/cnoon). -- Response status code asserts for redirect tests. - - Added by [Christian Noon](https://github.com/cnoon). -- A CHANGELOG to the project documenting each official release. - - Added by [Christian Noon](https://github.com/cnoon). - -#### Updated -- `SessionDelegate` override closure properties to match the method signatures. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#456](https://github.com/Alamofire/Alamofire/pull/456). -- Documentation for the `Printable` protocol on `Request` to reference output stream -rather than the specific `OutputStreamType`. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Deployment targets to iOS 8.0 and OS X 10.9 for the respective frameworks. - - Updated by [Christian Noon](https://github.com/cnoon). -- `SessionDelegate` willPerformHTTPRedirection method to accept optional return type -from override closure. - - Updated by [Chungsub Kim](https://github.com/subicura) in Pull Request - [#469](https://github.com/Alamofire/Alamofire/pull/469). -- Embedded Framework and Source File documentation in the README. - - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#427](https://github.com/Alamofire/Alamofire/pull/427). -- Alamofire source to be split into multiple core files and feature files. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#471](https://github.com/Alamofire/Alamofire/pull/471). -- `TaskDelegate` override closure signatures and delegate method implementations. - - Updated by [Christian Noon](https://github.com/cnoon). - -#### Removed -- Travis-CI build status from the README until Xcode 6.3 is supported. - - Removed by [Mattt Thompson](https://github.com/mattt). -- Unnecessary parentheses from closure parameters and typealiases. - - Removed by [Christian Noon](https://github.com/cnoon). - -#### Fixed -- `SessionDelegate` override closure documentation. - - Fixed by [Siemen Sikkema](https://github.com/siemensikkema) in Pull Request - [#448](https://github.com/Alamofire/Alamofire/pull/448). -- Some inaccurate documentation on several of the public `SessionDelegate` closures. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#456](https://github.com/Alamofire/Alamofire/pull/456). -- A deinit race condition where the task delegate queue could fail to `dispatch_release`. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#379](https://github.com/Alamofire/Alamofire/pull/379). -- `TaskDelegate` to only set `qualityOfService` for `NSOperationQueue` on iOS 8+. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#472](https://github.com/Alamofire/Alamofire/pull/472). -- Expectation order issue in the redirect tests. - - Fixed by [Christian Noon](https://github.com/cnoon). -- `DataTaskDelegate` behavior ensuring `NSProgress` values and `progress` override -closures are always updated and executed. - - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue - [#407](https://github.com/Alamofire/Alamofire/pull/407). - -## [1.2.1](https://github.com/Alamofire/Alamofire/releases/tag/1.2.1) -Released on 2015-04-21. - -#### Added -- Redirect tests for the `SessionDelegate`. - - Added by [Jonathan Hersh](https://github.com/jhersh) in Pull Request - [#424](https://github.com/Alamofire/Alamofire/pull/424). -- TLS evaluation test case. - - Added by [Mattt Thompson](https://github.com/mattt). -- Additional guards to ensure unique task identifiers for upload and download tasks. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#393](https://github.com/Alamofire/Alamofire/pull/393). - -#### Updated -- Required Xcode version to Xcode to 6.3 in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- SSL validation to use default system validation by default. - - Updated by [Michael Thole](https://github.com/mthole) in Pull Request - [#394](https://github.com/Alamofire/Alamofire/pull/394). - -## [1.2.0](https://github.com/Alamofire/Alamofire/releases/tag/1.2.0) -Released on 2015-04-09. - -#### Added -- New `testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter` -test. - - Added by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#370](https://github.com/Alamofire/Alamofire/pull/370). -- New `backgroundCompletionHandler` property to the `Manager` called when the -session background tasks finish. - - Added by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). - -#### Updated -- `Request` computed property `progress` to no longer be an optional type. - - Updated by [Pitiphong Phongpattranont](https://github.com/pitiphong-p) in - Pull Request - [#404](https://github.com/Alamofire/Alamofire/pull/404). -- All logic to Swift 1.2. - - Updated by [Aron Cedercrantz](https://github.com/rastersize) and - [Mattt Thompson](https://github.com/mattt). -- The `responseString` serializer to respect server provided character encoding with -overrideable configuration, default string response serialization to ISO-8859-1, as -per the HTTP/1.1 specification. - - Updated by [Kyle Fuller](https://github.com/kylef) and - [Mattt Thompson](https://github.com/mattt) in Pull Request - [#359](https://github.com/Alamofire/Alamofire/pull/359) which also resolved Issue - [#358](https://github.com/Alamofire/Alamofire/pull/358). -- `SessionDelegate` methods to first call the override closures if set. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- `SessionDelegate` and all override closures to a public ACL allowing for customization. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- `SessionDelegate` class to `final`. - - Updated by [Mattt Thompson](https://github.com/mattt). -- `SessionDelegate` header documentation for method override properties. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Xcode project to set `APPLICATION_EXTENSION_API_ONLY` to `YES` for OS X target. - - Updated by [Mattt Thompson](https://github.com/mattt). - -#### Removed -- Ambiguous response serializer methods that collided with default parameters. - - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#408](https://github.com/Alamofire/Alamofire/pull/408). -- `SessionDelegate` initializer and replaced with default property value. - - Removed by [Mattt Thompson](https://github.com/mattt). - -#### Fixed -- Async tests where asserts were potentially not being run by by moving -`expectation.fullfill()` to end of closures. - - Fixed by [Nate Cook](https://github.com/natecook1000) in Pull Request - [#420](https://github.com/Alamofire/Alamofire/pull/420). -- Small grammatical error in the ParameterEncoding section of the README. - - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request - [#416](https://github.com/Alamofire/Alamofire/pull/416). -- Typo in a download test comment. - - Fixed by [Aaron Brager](https://github.com/getaaron) in Pull Request - [#413](https://github.com/Alamofire/Alamofire/pull/413). -- Signature mismatch in the `dataTaskDidBecomeDownloadTask` override closure. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). -- Issue in the `SessionDelegate` where the `DataTaskDelegate` was not being called. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#317](https://github.com/Alamofire/Alamofire/pull/317). - ---- - -## [1.1.5](https://github.com/Alamofire/Alamofire/releases/tag/1.1.5) -Released on 2015-03-26. - -#### Added -- Convenience upload functions to the `Manager`. - - Added by [Olivier Bohrer](https://github.com/obohrer) in Pull Request - [#334](https://github.com/Alamofire/Alamofire/pull/334). -- Info to the README about Swift 1.2 support. - - Added by [Mattt Thompson](https://github.com/mattt). - -#### Updated -- All request / upload / download methods on `Manager` to match the top-level functions. - - Updated by [Mattt Thompson](https://github.com/mattt). -- The `testDownloadRequest` to no longer remove the downloaded file. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Ono XML response serializer example in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI settings to only build the master branch. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Code signing identities for the frameworks and targets to better support Carthage. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#400](https://github.com/Alamofire/Alamofire/pull/400). -- iOS deployment target to iOS 8.0 for iOS target and tests. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#401](https://github.com/Alamofire/Alamofire/pull/401). -- Legal characters to be escaped according to RFC 3986 Section 3.4. - - Updated by [Stephane Lizeray](https://github.com/slizeray) in Pull Request - [#370](https://github.com/Alamofire/Alamofire/pull/370). - -#### Fixed -- Travis-CI scheme issue, added podspec linting and added ENV variables. - - Fixed by [Jonathan Hersh](https://github.com/jhersh) in Pull Request - [#351](https://github.com/Alamofire/Alamofire/pull/351). -- Code sample in the README in the Manual Parameter Encoding section. - - Fixed by [Petr Korolev](https://github.com/skywinder) in Pull Request - [#381](https://github.com/Alamofire/Alamofire/pull/381). - -## [1.1.4](https://github.com/Alamofire/Alamofire/releases/tag/1.1.4) -Released on 2015-01-30. - -#### Added -- Podspec argument `requires_arc` to the podspec file. - - Added by [Mattt Thompson](https://github.com/mattt). -- Support for Travis-CI for automated testing purposes. - - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request - [#279](https://github.com/Alamofire/Alamofire/pull/279). - -#### Updated -- Installation instructions in the README to include CocoaPods, Carthage and -Embedded Frameworks. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI to use Xcode 6.1.1. - - Updated by [Mattt Thompson](https://github.com/mattt). -- The `download` method on `Manager` to use `Request.DownloadFileDestination` typealias. - - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request - [#318](https://github.com/Alamofire/Alamofire/pull/318). -- `RequestTests` to no longer delete all cookies in default session configuration. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Travis-CI yaml file to only build the active architecture. - - Updated by [Mattt Thompson](https://github.com/mattt). -- Deployment targets to iOS 7.0 and Mac OS X 10.9. - - Updated by [Mattt Thompson](https://github.com/mattt). - -#### Removed -- The `tearDown` method in the `AlamofireDownloadResponseTestCase`. - - Removed by [Mattt Thompson](https://github.com/mattt). - -#### Fixed -- Small formatting issue in the CocoaPods Podfile example in the README. - - Fixed by [rborkow](https://github.com/rborkow) in Pull Request - [#313](https://github.com/Alamofire/Alamofire/pull/313). -- Several issues with the iOS and OSX targets in the Xcode project. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- The `testDownloadRequest` in `DownloadTests` by adding `.json` file extension. - - Fixed by [Martin Kavalar](https://github.com/mk) in Pull Request - [#302](https://github.com/Alamofire/Alamofire/pull/302). -- The `AlamofireRequestDebugDescriptionTestCase` on OSX. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Spec validation error with CocoaPods 0.36.0.beta-1 by disabling -b flags in `cURL` -debug on OSX. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Travis-CI build issue by adding suppport for an `iOS Example` scheme. - - Fixed by [Yasuharu Ozaki](https://github.com/yasuoza) in Pull Request - [#322](https://github.com/Alamofire/Alamofire/pull/322). - -## [1.1.3](https://github.com/Alamofire/Alamofire/releases/tag/1.1.3) -Released on 2015-01-09. - -#### Added -- Podspec file to support CocoaPods deployment. - - Added by [Marius Rackwitz](https://github.com/mrackwitz) in Pull Request - [#218](https://github.com/Alamofire/Alamofire/pull/218). -- Shared scheme to support Carthage deployments. - - Added by [Yosuke Ishikawa](https://github.com/ishkawa) in Pull Request - [#228](https://github.com/Alamofire/Alamofire/pull/228). -- New target for Alamofire OSX framework. - - Added by [Martin Kavalar](https://github.com/mk) in Pull Request - [#293](https://github.com/Alamofire/Alamofire/pull/293). - -#### Updated -- Upload and Download progress state to be updated before calling progress closure. - - Updated by [Alexander Strakovich](https://github.com/astrabot) in Pull Request - [#278](https://github.com/Alamofire/Alamofire/pull/278). - -#### Fixed -- Some casting code logic in the Generic Response Object Serialization example in -the README. - - Fixed by [Philip Heinser](https://github.com/philipheinser) in Pull Request - [#258](https://github.com/Alamofire/Alamofire/pull/258). -- Indentation formatting of the `responseString` parameter documentation. - - Fixed by [Ah.Miao](https://github.com/mrahmiao) in Pull Request - [#291](https://github.com/Alamofire/Alamofire/pull/291). - -## [1.1.2](https://github.com/Alamofire/Alamofire/releases/tag/1.1.2) -Released on 2014-12-21. - -#### Added -- POST request JSON response test. - - Added by [Mattt Thompson](https://github.com/mattt). - -#### Updated -- The response object example to use a failable initializer in the README. - - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#230](https://github.com/Alamofire/Alamofire/pull/230). -- Router example in the README by removing extraneous force unwrap. - - Updated by [Arnaud Mesureur](https://github.com/nsarno) in Pull Request - [#247](https://github.com/Alamofire/Alamofire/pull/247). -- Xcode project `APPLICATION_EXTENSION_API_ONLY` flag to `YES`. - - Updated by [Michael Latta](https://github.com/technomage) in Pull Request - [#273](https://github.com/Alamofire/Alamofire/pull/273). -- Default HTTP header creation by moving it into a public class method. - - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request - [#261](https://github.com/Alamofire/Alamofire/pull/261). - -#### Fixed -- Upload stream method to set `HTTPBodyStream` for streamed request. - - Fixed by [Florent Vilmart](https://github.com/flovilmart) and - [Mattt Thompson](https://github.com/mattt) in Pull Request - [#241](https://github.com/Alamofire/Alamofire/pull/241). -- ParameterEncoding to compose percent-encoded query strings from -percent-encoded components. - - Fixed by [Oleh Sannikov](https://github.com/sunnycows) in Pull Request - [#249](https://github.com/Alamofire/Alamofire/pull/249). -- Serialization handling of NSData with 0 bytes. - - Fixed by [Mike Owens](https://github.com/mowens) in Pull Request - [#254](https://github.com/Alamofire/Alamofire/pull/254). -- Issue where `suggestedDownloadDestination` parameters were being ignored. - - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request - [#257](https://github.com/Alamofire/Alamofire/pull/257). -- Crash caused by `Manager` deinitialization and added documentation. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#269](https://github.com/Alamofire/Alamofire/pull/269). - -## [1.1.1](https://github.com/Alamofire/Alamofire/releases/tag/1.1.1) -Released on 2014-11-20. - -#### Updated -- Dispatch-based synchronized access to subdelegates. - - Updated by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request - [#175](https://github.com/Alamofire/Alamofire/pull/175). -- iOS 7 instructions in the README. - - Updated by [Mattt Thompson](https://github.com/mattt). -- CRUD example in the README to work on Xcode 6.1. - - Updated by [John Beynon](https://github.com/johnbeynon) in Pull Request - [#187](https://github.com/Alamofire/Alamofire/pull/187). -- The `cURL` example annotation in the README to pick up `bash` syntax highlighting. - - Updated by [Samuel E. Giddins](https://github.com/segiddins) in Pull Request - [#208](https://github.com/Alamofire/Alamofire/pull/208). - -#### Fixed -- Out-of-memory exception by replacing `stringByAddingPercentEncodingWithAllowedCharacters` -with `CFURLCreateStringByAddingPercentEscapes`. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#206](https://github.com/Alamofire/Alamofire/pull/206). -- Several issues in the README examples where an NSURL initializer needs to be unwrapped. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Pull Request - [#213](https://github.com/Alamofire/Alamofire/pull/213). -- Possible exception when force unwrapping optional header properties. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Optional cookie entry in `cURL` output. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issue - [#226](https://github.com/Alamofire/Alamofire/pull/226). -- Optional `textLabel` property on cells in the example app. - - Fixed by [Mattt Thompson](https://github.com/mattt). - -## [1.1.0](https://github.com/Alamofire/Alamofire/releases/tag/1.1.0) -Released on 2014-10-20. - -#### Updated -- Project to support Swift 1.1 and Xcode 6.1. - - Updated by [Aral Balkan](https://github.com/aral), - [Ross Kimes](https://github.com/rosskimes), - [Orta Therox](https://github.com/orta), - [Nico du Plessis](https://github.com/nduplessis) - and [Mattt Thompson](https://github.com/mattt). - ---- - -## [1.0.1](https://github.com/Alamofire/Alamofire/releases/tag/1.0.1) -Released on 2014-10-20. - -#### Added -- Tests for upload and download with progress. - - Added by [Mattt Thompson](https://github.com/mattt). -- Test for question marks in url encoded query. - - Added by [Mattt Thompson](https://github.com/mattt). -- The `NSURLSessionConfiguration` headers to `cURL` representation. - - Added by [Matthias Ryne Cheow](https://github.com/rynecheow) in Pull Request - [#140](https://github.com/Alamofire/Alamofire/pull/140). -- Parameter encoding tests for key/value pairs containing spaces. - - Added by [Mattt Thompson](https://github.com/mattt). -- Percent character encoding for the `+` character. - - Added by [Niels van Hoorn](https://github.com/nvh) in Pull Request - [#167](https://github.com/Alamofire/Alamofire/pull/167). -- Escaping for quotes to support JSON in `cURL` commands. - - Added by [John Gibb](https://github.com/johngibb) in Pull Request - [#178](https://github.com/Alamofire/Alamofire/pull/178). -- The `request` method to the `Manager` bringing it more inline with the top-level methods. - - Added by Brian Smith. - -#### Fixed -- Parameter encoding of ampersands and escaping of characters. - - Fixed by [Mattt Thompson](https://github.com/mattt) in regards to Issues - [#146](https://github.com/Alamofire/Alamofire/pull/146) and - [#162](https://github.com/Alamofire/Alamofire/pull/162). -- Parameter encoding of `HTTPBody` from occurring twice. - - Fixed by Yuri in Pull Request - [#153](https://github.com/Alamofire/Alamofire/pull/153). -- Extraneous dispatch to background by using weak reference for delegate in response. - - Fixed by [Mattt Thompson](https://github.com/mattt). -- Response handler threading issue by adding a `subdelegateQueue` to the `SessionDelegate`. - - Fixed by [Essan Parto](https://github.com/parto) in Pull Request - [#171](https://github.com/Alamofire/Alamofire/pull/171). -- Challenge issue where basic auth credentials were not being unwrapped. - - Fixed by [Mattt Thompson](https://github.com/mattt). - -## [1.0.0](https://github.com/Alamofire/Alamofire/releases/tag/1.0.0) -Released on 2014-09-25. - -#### Added -- Initial release of Alamofire. - - Added by [Mattt Thompson](https://github.com/mattt). diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CONTRIBUTING.md b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CONTRIBUTING.md deleted file mode 100644 index 5de3be7..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/CONTRIBUTING.md +++ /dev/null @@ -1,91 +0,0 @@ -# Contributing Guidelines - -This document contains information and guidelines about contributing to this project. -Please read it before you start participating. - -**Topics** - -* [Asking Questions](#asking-questions) -* [Reporting Security Issues](#reporting-security-issues) -* [Reporting Issues](#reporting-other-issues) -* [Developers Certificate of Origin](#developers-certificate-of-origin) -* [Code of Conduct](#code-of-conduct) - -## Asking Questions - -We don't use GitHub as a support forum. -For any usage questions that are not specific to the project itself, -please ask on [Stack Overflow](https://stackoverflow.com) instead. -By doing so, you'll be more likely to quickly solve your problem, -and you'll allow anyone else with the same question to find the answer. -This also allows maintainers to focus on improving the project for others. - -## Reporting Security Issues - -The Alamofire Software Foundation takes security seriously. -If you discover a security issue, please bring it to our attention right away! - -Please **DO NOT** file a public issue, -instead send your report privately to . -This will help ensure that any vulnerabilities that _are_ found -can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure) -to any affected parties. - -## Reporting Other Issues - -A great way to contribute to the project -is to send a detailed issue when you encounter an problem. -We always appreciate a well-written, thorough bug report. - -Check that the project issues database -doesn't already include that problem or suggestion before submitting an issue. -If you find a match, add a quick "+1" or "I have this problem too." -Doing this helps prioritize the most common problems and requests. - -When reporting issues, please include the following: - -* The version of Xcode you're using -* The version of iOS or OS X you're targeting -* The full output of any stack trace or compiler error -* A code snippet that reproduces the described behavior, if applicable -* Any other details that would be useful in understanding the problem - -This information will help us review and fix your issue faster. - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -- (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. - -## Code of Conduct - -The Code of Conduct governs how we behave in public or in private -whenever the project will be judged by our actions. -We expect it to be honored by everyone who contributes to this project. - -See [CONDUCT.md](https://github.com/Alamofire/Foundation/blob/master/CONDUCT.md) for details. - ---- - -*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](http://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.* diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md deleted file mode 100644 index 5716906..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 2.0 Migration Guide.md +++ /dev/null @@ -1,202 +0,0 @@ -# Alamofire 2.0 Migration Guide - -Alamofire 2.0 is the latest major release of Alamofire, an HTTP networking library for iOS, Mac OS X and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 2.0 introduces several API-breaking changes that one should be aware of. - -This guide is provided in order to ease the transition of existing applications using Alamofire 1.x to the latest APIs, as well as explain the design and structure of new and changed functionality. - -## New Requirements - -Alamofire 2.0 officially supports iOS 8+, Mac OS X 10.9+, Xcode 7 and Swift 2.0. If you'd like to use Alamofire in a project targeting iOS 7 and Swift 1.x, use the latest tagged 1.x release. - ---- - -## Breaking API Changes - -### Swift 2.0 - -The biggest change between Alamofire 1.x and Alamofire 2.0 is Swift 2.0. Swift 2 brought many new features to take advantage of such as error handling, protocol extensions and availability checking. Other new features such as `guard` and `defer` do not affect the public APIs, but allowed us to create much cleaner implementations of the same logic. All of the source files, test logic and example code has been updated to reflect the latest Swift 2.0 paradigms. - -> It is not possible to use Alamofire 2.0 without Swift 2.0. - -### Response Serializers - -The most significant logic change made to Alamofire 2.0 is its new response serialization system leveraging `Result` types. Previously in Alamofire 1.x, each response serializer used the same completion handler signature: - -```swift -public func response(completionHandler: (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void) -> Self { - return response(serializer: Request.responseDataSerializer(), completionHandler: completionHandler) -} -``` - -Alamofire 2.0 has redesigned the entire response serialization process to make it much easier to access the original server data without serialization, or serialize the response into a non-optional `Result` type defining whether the `Request` was successful. - -#### No Response Serialization - -The first `response` serializer is non-generic and does not process the server data in any way. It merely forwards on the accumulated information from the `NSURLSessionDelegate` callbacks. - -```swift -public func response( - queue queue: dispatch_queue_t? = nil, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, ErrorType?) -> Void) - -> Self -{ - delegate.queue.addOperationWithBlock { - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, self.delegate.data, self.delegate.error) - } - } - - return self -} -``` - -Another important note of this change is the return type of `data` is now an `NSData` type. You no longer need to cast the `data` parameter from an `AnyObject?` to an `NSData?`. - -#### Generic Response Serializers - -The second, more powerful response serializer leverages generics along with a `Result` type to eliminate the case of the dreaded double optional. - -```swift -public func response( - queue queue: dispatch_queue_t? = nil, - responseSerializer: T, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, Result) -> Void) - -> Self -{ - delegate.queue.addOperationWithBlock { - let result: Result = { - if let error = self.delegate.error { - return .Failure(self.delegate.data, error) - } else { - return responseSerializer.serializeResponse(self.request, self.response, self.delegate.data) - } - }() - - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, result) - } - } - - return self -} -``` - -##### Response Data - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseData { _, _, result in - print("Success: \(result.isSuccess)") - print("Response: \(result)") - } -``` - -##### Response String - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseString { _, _, result in - print("Success: \(result.isSuccess)") - print("Response String: \(result.value)") - } -``` - -##### Response JSON - -```swift -Alamofire.request(.GET, "http://httpbin.org/get") - .responseJSON { _, _, result in - print(result) - debugPrint(result) - } -``` - -#### Result Types - -The `Result` enumeration was added to handle the case of the double optional return type. Previously, the return value and error were both optionals. Checking if one was `nil` did not ensure the other was also not `nil`. This case has been blogged about many times and can be solved by a `Result` type. Alamofire 2.0 brings a `Result` type to the response serializers to make it much easier to handle success and failure cases. - -```swift -public enum Result { - case Success(Value) - case Failure(NSData?, ErrorType) -} -``` - -There are also many other convenience computed properties to make accessing the data inside easy. The `Result` type also conforms to the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to make it easier to debug. - -#### Error Types - -While Alamofire still only generates `NSError` objects, all `Result` types have been converted to store `ErrorType` objects to allow custom response serializer implementations to use any `ErrorType` they wish. This also includes the `ValidationResult` and `MultipartFormDataEncodingResult` types as well. - -### URLRequestConvertible - -In order to make it easier to deal with non-common scenarios, the `URLRequestConvertible` protocol now returns an `NSMutableURLRequest`. Alamofire 2.0 makes it much easier to customize the URL request after is has been encoded. This should only affect a small amount of users. - -```swift -public protocol URLRequestConvertible { - var URLRequest: NSMutableURLRequest { get } -} -``` - -### Multipart Form Data - -Encoding `MultipartFormData` previous returned an `EncodingResult` to encapsulate any possible errors that occurred during encoding. Alamofire 2.0 uses the new Swift 2.0 error handling instead making it easier to use. This change is mostly encapsulated internally and should only affect a very small subset of users. - ---- - -## Updated ACLs and New Features - -### Parameter Encoding - -#### ACL Updates - -The `ParameterEncoding` enumeration implementation was previously hidden behind `internal` and `private` ACLs. Alamofire 2.0 opens up the `queryComponents` and `escape` methods to make it much easier to implement `.Custom` cases. - -#### Encoding in the URL - -In the previous versions of Alamofire, `.URL` encoding would automatically append the query string to either the URL or HTTP body depending on which HTTP method was set in the `NSURLRequest`. While this satisfies the majority of common use cases, it made it quite difficult to append query string parameter to a URL for HTTP methods such as `PUT` and `POST`. In Alamofire 2.0, we've added a second URL encoding case, `.URLEncodedInURL`, that always appends the query string to the URL regardless of HTTP method. - -### Server Trust Policies - -In Alamofire 1.x, the `ServerTrustPolicyManager` methods were internal making it impossible to implement any custom domain matching behavior. Alamofire 2.0 opens up the internals with a `public` ACL allowing more flexible server trust policy matching behavior (i.e. wildcarded domains) through subclassing. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -### Download Requests - -The global and `Manager` download APIs now support `parameters` and `encoding` parameters to better support dynamic payloads used in background sessions. Constructing a `download` request is now the same as constructing a `data` request with the addition of a `destination` parameter. - -```swift -public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request -{ - return Manager.sharedInstance.download( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers, - destination: destination - ) -} -``` - -### Stream Tasks - -Alamofire 2.0 adds support for creating `NSURLSessionStreamTask` tasks for iOS 9 and OS X 10.11. It also extends the `SessionDelegate` to support all the new `NSURLSessionStreamDelegate` APIs. diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md deleted file mode 100644 index 38736fc..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Documentation/Alamofire 3.0 Migration Guide.md +++ /dev/null @@ -1,186 +0,0 @@ -# Alamofire 3.0 Migration Guide - -Alamofire 3.0 is the latest major release of Alamofire, an HTTP networking library for iOS, Mac OS X and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 3.0 introduces several API-breaking changes that one should be aware of. - -This guide is provided in order to ease the transition of existing applications using Alamofire 2.x to the latest APIs, as well as explain the design and structure of new and changed functionality. - -## Requirements - -Alamofire 3.0 officially supports iOS 8+, Mac OS X 10.9+, watchOS 2.0, Xcode 7 and Swift 2.0. If you'd like to use Alamofire in a project targeting iOS 7 and Swift 1.x, use the latest tagged 1.x release. - -## Reasons for Bumping to 3.0 - -The [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) (ASF) tries to do everything possible to avoid MAJOR version bumps. We realize the challenges involved with migrating large projects from one MAJOR version to another. With that said, we also want to make sure we're always producing the highest quality APIs and features possible. - -After releasing Alamofire 2.0, it became clear that the response serialization system still had some room for improvement. After much debate, we decided to strictly follow semver and move forward with all the core logic changes becoming Alamofire 3.0. We've also made some fairly significant changes that should give us more flexibility moving forward to help avoid the need for MAJOR version bumps to maintain backwards compatibility. - -## Benefits of Upgrading - -The benefits of upgrading can be summarized as follows: - -* No more casting a response serializer `error` from an `ErrorType` to an `NSError`. -* Original server data is now ALWAYS returned in all response serializers regardless of whether the result was a `.Success` or `.Failure`. -* Custom response serializers are now ALWAYS called regardless of whether an `error` occurred. -* Custom response serializers are now passed in the `error` allowing you to switch between different parsing schemes if necessary. -* Custom response serializers can now wrap up any Alamofire `NSError` into a `CustomError` type of your choosing. -* `Manager` initialization can now accept custom `NSURLSession` or `SessionDelegate` objects using dependency injection. - ---- - -## Breaking API Changes - -Alamofire 3.0 contains some breaking API changes to the foundational classes supporting the response serialization system. It is important to understand how these changes affect the common usage patterns. - -### Result Type - -The `Result` type was introduced in Alamofire 2.0 as a single generic parameter with the following signature: - -```swift -public enum Result { - case Success(Value) - case Failure(NSData?, ErrorType) -} -``` - -While this was a significant improvement on the behavior of Alamofire 1.0, there was still room for improvement. By defining the `.Failure` case to take an `ErrorType`, all consumers needed to cast the `ErrorType` to some concrete object such as an `NSError` before being able to interact with it. This was certainly not ideal. Additionally, by only allowing the `NSData?` from the server to be appended in a `.Failure` case, it was not possible to access the original server data in a `.Success` case. - -In Alamofire 3.0, the `Result` type has been redesigned to be a double generic type that does not store the `NSData?` in the `.Failure` case. - -```swift -public enum Result { - case Success(Value) - case Failure(Error) -} -``` - -These changes allow Alamofire to return the original server data in both cases. It also removes the requirement of having to cast the `ErrorType` when working with the `.Failure` case error object. - -### Response - -In order to avoid constantly having to change the response serializer completion closure signatures, Alamofire 3.0 introduces a `Response` struct. All response serializers (with the exception of `response`) return a generic `Response` struct. - -```swift -public struct Response { - /// The URL request sent to the server. - public let request: NSURLRequest? - - /// The server's response to the URL request. - public let response: NSHTTPURLResponse? - - /// The data returned by the server. - public let data: NSData? - - /// The result of response serialization. - public let result: Result -} -``` - -This unifies the signature of all response serializer completion closures by only needing to specify a single parameter rather than three or four. If another major release of Alamofire needs to modify the signature, thankfully the number of parameters in all response serializers will NOT need to change. Given the fact that the Swift compiler can present some fairly misleading compiler errors when the arguments are not correct, this should help alleviate some painful updates between MAJOR version bumps of Alamofire. - -### Response Serializers - -The biggest change in Alamofire 3.0 are the response serializers. They are now powered by the new `Response` struct and updated `Result` type. These two generic classes make it VERY easy to interact with the response serializers in a consistent, type-safe manner. - -```swift -Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) - .responseJSON { response in - debugPrint(response) // prints detailed description of all response properties - - print(response.request) // original URL request - print(response.response) // URL response - print(response.data) // server data - print(response.result) // result of response serialization - - if let JSON = response.result.value { - print("JSON: \(JSON)") - } - } -``` - -Besides the single response parameter in the completion closure, the other major callouts are that the original server data is always available whether the `Result` was a `.Success` or `.Failure`. Additionally, both the `value` and `error` of the `Result` type are strongly typed objects thanks to the power of generics. All default response serializer errors will be an `NSError` type. Custom response serializers can specify any custom `ErrorType`. - -#### Response Serializer Type - -For those wishing to create custom response serializer types, you'll need to familiarize yourself with the new `ResponseSerializerType` protocol and generic `ResponseSerializer` struct. - -```swift -public protocol ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializerType`. - typealias SerializedObject - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - typealias ErrorObject: ErrorType - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get } -} -``` - -All the possible information about the `Request` is now passed into the `serializeResponse` closure. In Alamofire 3.0, the `serializeResponse` closure is ALWAYS called whether an error occurred or not. This is for several reasons. - -1. Passing the error into the response serializer allows the implementation to switch parsing schemes based on what error occurred. For example, some APIs will return different payload schemas when certain errors occur. The new design allows you to switch on the error type and use different parsing logic. -2. Any error produced by Alamofire will always be an `NSError`. If your custom response serializer returns `CustomError` types, then the `NSError` returned by Alamofire must be converted into a `CustomError` type. This makes it MUCH easier to wrap Alamofire errors in your own `CustomError` type objects. - > This is also required for all the generics logic to work properly. - -### Validation Result - -The `ValidationResult` enumeration in Alamofire 3.0 has been updated to take an `NSError` in the `.Failure` case. The reasoning for this change is that all Alamofire errors generated need to be `NSError` types. If not, it introduces the need to cast all error objects coming from Alamofire at the response serializer level. - -```swift -public enum ValidationResult { - case Success - case Failure(NSError) -} -``` - -> If you are extending the `Request` type in any way that can produce an error, that error always needs to be of type `NSError`. If you'd like to wrap the error into a `CustomError` type, it should be wrapped in a custom response serializer implementation. - ---- - -## New Features - -### Dependency Injection - -Alamofire 3.0 leverages [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) to allow some powerful new customizations to take place for the URL session and delegate. - -#### Session Delegate - -In previous versions of Alamofire, the `SessionDelegate` was automatically created by the `Manager` instance. While this is convenient, it can be problematic for background sessions. One may need to hook up the task override closures before instantiating the URL session. Otherwise the URL session delegate could be called before the task override closures are able to be set. - -In Alamofire 3.0, the `Manager` initializer adds the ability to provide a custom `SessionDelegate` object with the task override closures already set using dependency injection. This greatly increases the flexibility of Alamofire in regards to background sessions. - -```swift -public init( - configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) -{ - self.delegate = delegate - self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) -} -``` - -#### URL Session - -Alamofire 3.0 also adds the ability to use dependency injection to provide a custom `NSURLSession` to the `Manager` instance. This provides complete control over the URL session initialization if you need it allowing `NSURLSession` subclasses for various kinds of testing and DVR implementations. - -```swift -public init?( - session: NSURLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) -{ - self.delegate = delegate - self.session = session - - guard delegate === session.delegate else { return nil } - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) -} -``` - -> We're very excited to see what the community comes up with given these new possibilities with Alamofire 3.0. diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard deleted file mode 100644 index 6f3cd58..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Base.lproj/Main.storyboard +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/AppIcon.appiconset/Contents.json b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index eeea76c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 6f870a4..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json deleted file mode 100644 index bd086a5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "Logo.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "Logo@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png deleted file mode 100644 index 4060979..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png deleted file mode 100644 index adbb083..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/Logo.imageset/Logo@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist deleted file mode 100644 index 9f0225e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Resources/Info.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Alamofire - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIMainStoryboardFile - Main - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift deleted file mode 100644 index 4690d4b..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift +++ /dev/null @@ -1,61 +0,0 @@ -// AppDelegate.swift -// -// Copyright (c) 2014–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 UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { - - var window: UIWindow? - - // MARK: - UIApplicationDelegate - - func application( - application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) - -> Bool - { - let splitViewController = window!.rootViewController as! UISplitViewController - let navigationController = splitViewController.viewControllers.last as! UINavigationController - navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() - splitViewController.delegate = self - - return true - } - - // MARK: - UISplitViewControllerDelegate - - func splitViewController( - splitViewController: UISplitViewController, - collapseSecondaryViewController secondaryViewController: UIViewController, - ontoPrimaryViewController primaryViewController: UIViewController) - -> Bool - { - if let secondaryAsNavController = secondaryViewController as? UINavigationController { - if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { - return topAsDetailController.request == nil - } - } - - return false - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift deleted file mode 100644 index 47bf0b3..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/DetailViewController.swift +++ /dev/null @@ -1,204 +0,0 @@ -// DetailViewController.swift -// -// Copyright (c) 2014–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 Alamofire -import UIKit - -class DetailViewController: UITableViewController { - enum Sections: Int { - case Headers, Body - } - - var request: Alamofire.Request? { - didSet { - oldValue?.cancel() - - title = request?.description - refreshControl?.endRefreshing() - headers.removeAll() - body = nil - elapsedTime = nil - } - } - - var headers: [String: String] = [:] - var body: String? - var elapsedTime: NSTimeInterval? - var segueIdentifier: String? - - static let numberFormatter: NSNumberFormatter = { - let formatter = NSNumberFormatter() - formatter.numberStyle = .DecimalStyle - return formatter - }() - - // MARK: View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - refreshControl?.addTarget(self, action: "refresh", forControlEvents: .ValueChanged) - - } - - override func viewDidAppear(animated: Bool) { - super.viewDidAppear(animated) - - refresh() - } - - // MARK: IBActions - - @IBAction func refresh() { - guard let request = request else { - return - } - - refreshControl?.beginRefreshing() - - let start = CACurrentMediaTime() - request.responseString { response in - let end = CACurrentMediaTime() - self.elapsedTime = end - start - - if let response = response.response { - for (field, value) in response.allHeaderFields { - self.headers["\(field)"] = "\(value)" - } - } - - if let segueIdentifier = self.segueIdentifier { - switch segueIdentifier { - case "GET", "POST", "PUT", "DELETE": - self.body = response.result.value - case "DOWNLOAD": - self.body = self.downloadedBodyString() - default: - break - } - } - - self.tableView.reloadData() - self.refreshControl?.endRefreshing() - } - } - - private func downloadedBodyString() -> String { - let fileManager = NSFileManager.defaultManager() - let cachesDirectory = fileManager.URLsForDirectory(.CachesDirectory, inDomains: .UserDomainMask)[0] - - do { - let contents = try fileManager.contentsOfDirectoryAtURL( - cachesDirectory, - includingPropertiesForKeys: nil, - options: .SkipsHiddenFiles - ) - - if let - fileURL = contents.first, - data = NSData(contentsOfURL: fileURL) - { - let json = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions()) - let prettyData = try NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted) - - if let prettyString = NSString(data: prettyData, encoding: NSUTF8StringEncoding) as? String { - try fileManager.removeItemAtURL(fileURL) - return prettyString - } - } - } catch { - // No-op - } - - return "" - } -} - -// MARK: - UITableViewDataSource - -extension DetailViewController { - override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - switch Sections(rawValue: section)! { - case .Headers: - return headers.count - case .Body: - return body == nil ? 0 : 1 - } - } - - override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { - switch Sections(rawValue: indexPath.section)! { - case .Headers: - let cell = tableView.dequeueReusableCellWithIdentifier("Header")! - let field = headers.keys.sort(<)[indexPath.row] - let value = headers[field] - - cell.textLabel?.text = field - cell.detailTextLabel?.text = value - - return cell - case .Body: - let cell = tableView.dequeueReusableCellWithIdentifier("Body")! - cell.textLabel?.text = body - - return cell - } - } -} - -// MARK: - UITableViewDelegate - -extension DetailViewController { - override func numberOfSectionsInTableView(tableView: UITableView) -> Int { - return 2 - } - - override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if self.tableView(tableView, numberOfRowsInSection: section) == 0 { - return "" - } - - switch Sections(rawValue: section)! { - case .Headers: - return "Headers" - case .Body: - return "Body" - } - } - - override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { - switch Sections(rawValue: indexPath.section)! { - case .Body: - return 300 - default: - return tableView.rowHeight - } - } - - override func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? { - if Sections(rawValue: section) == .Body, let elapsedTime = elapsedTime { - let elapsedTimeText = DetailViewController.numberFormatter.stringFromNumber(elapsedTime) ?? "???" - return "Elapsed Time: \(elapsedTimeText) sec" - } - - return "" - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift deleted file mode 100644 index 5a69799..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/Source/MasterViewController.swift +++ /dev/null @@ -1,95 +0,0 @@ -// MasterViewController.swift -// -// Copyright (c) 2014–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 Alamofire -import UIKit - -class MasterViewController: UITableViewController { - - @IBOutlet weak var titleImageView: UIImageView! - - var detailViewController: DetailViewController? = nil - var objects = NSMutableArray() - - // MARK: - View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - - navigationItem.titleView = titleImageView - } - - override func viewDidLoad() { - super.viewDidLoad() - - if let split = splitViewController { - let controllers = split.viewControllers - - if let - navigationController = controllers.last as? UINavigationController, - topViewController = navigationController.topViewController as? DetailViewController - { - detailViewController = topViewController - } - } - } - - // MARK: - UIStoryboardSegue - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - if let - navigationController = segue.destinationViewController as? UINavigationController, - detailViewController = navigationController.topViewController as? DetailViewController - { - func requestForSegue(segue: UIStoryboardSegue) -> Request? { - switch segue.identifier! { - case "GET": - detailViewController.segueIdentifier = "GET" - return Alamofire.request(.GET, "https://httpbin.org/get") - case "POST": - detailViewController.segueIdentifier = "POST" - return Alamofire.request(.POST, "https://httpbin.org/post") - case "PUT": - detailViewController.segueIdentifier = "PUT" - return Alamofire.request(.PUT, "https://httpbin.org/put") - case "DELETE": - detailViewController.segueIdentifier = "DELETE" - return Alamofire.request(.DELETE, "https://httpbin.org/delete") - case "DOWNLOAD": - detailViewController.segueIdentifier = "DOWNLOAD" - let destination = Alamofire.Request.suggestedDownloadDestination( - directory: .CachesDirectory, - domain: .UserDomainMask - ) - return Alamofire.download(.GET, "https://httpbin.org/stream/1", destination: destination) - default: - return nil - } - } - - if let request = requestForSegue(segue) { - detailViewController.request = request - } - } - } -} - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj deleted file mode 100644 index 083ae51..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.pbxproj +++ /dev/null @@ -1,468 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 31E476821C55DE6D00968569 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31E4766A1C55DD5900968569 /* Alamofire.framework */; }; - 31E476831C55DE6D00968569 /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 31E4766A1C55DD5900968569 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4C6D2C801C67EFE100846168 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */; }; - 4C6D2C811C67EFE100846168 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */; }; - 4C6D2C821C67EFE100846168 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */; }; - 4C6D2C8F1C67EFEC00846168 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */; }; - 4C6D2C981C67F03B00846168 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D2C961C67F03B00846168 /* Main.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 31E476691C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 31E4766B1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = "Alamofire iOS Tests"; - }; - 31E4766D1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 31E4766F1C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 31E476711C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - 31E476731C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - 31E476751C55DD5900968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 31E476841C55DE6D00968569 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - F818D0E519CA8D15006034B1 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 31E476831C55DE6D00968569 /* Alamofire.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = ../Alamofire.xcodeproj; sourceTree = ""; }; - 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Source/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DetailViewController.swift; path = Source/DetailViewController.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MasterViewController.swift; path = Source/MasterViewController.swift; sourceTree = SOURCE_ROOT; }; - 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Resources/Images.xcassets; sourceTree = SOURCE_ROOT; }; - 4C6D2C8D1C67EFEC00846168 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = SOURCE_ROOT; }; - 4C6D2C971C67F03B00846168 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = ""; }; - F8111E0519A951050040E7D1 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F8111E0219A951050040E7D1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 31E476821C55DE6D00968569 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 31E476601C55DD5900968569 /* Products */ = { - isa = PBXGroup; - children = ( - 31E4766A1C55DD5900968569 /* Alamofire.framework */, - 31E4766C1C55DD5900968569 /* Alamofire iOS Tests.xctest */, - 31E4766E1C55DD5900968569 /* Alamofire.framework */, - 31E476701C55DD5900968569 /* Alamofire OSX Tests.xctest */, - 31E476721C55DD5900968569 /* Alamofire.framework */, - 31E476741C55DD5900968569 /* Alamofire tvOS Tests.xctest */, - 31E476761C55DD5900968569 /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; - 4C6D2C951C67F03B00846168 /* Base.lproj */ = { - isa = PBXGroup; - children = ( - 4C6D2C961C67F03B00846168 /* Main.storyboard */, - ); - name = Base.lproj; - path = Resources/Base.lproj; - sourceTree = SOURCE_ROOT; - }; - F8111DFC19A951050040E7D1 = { - isa = PBXGroup; - children = ( - F8111E0719A951050040E7D1 /* Source */, - F8111E0619A951050040E7D1 /* Products */, - 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */, - ); - sourceTree = ""; - }; - F8111E0619A951050040E7D1 /* Products */ = { - isa = PBXGroup; - children = ( - F8111E0519A951050040E7D1 /* iOS Example.app */, - ); - name = Products; - sourceTree = ""; - }; - F8111E0719A951050040E7D1 /* Source */ = { - isa = PBXGroup; - children = ( - 4C6D2C7D1C67EFE100846168 /* AppDelegate.swift */, - 4C6D2C7E1C67EFE100846168 /* DetailViewController.swift */, - 4C6D2C7F1C67EFE100846168 /* MasterViewController.swift */, - F8111E0819A951050040E7D1 /* Supporting Files */, - ); - name = Source; - path = Example; - sourceTree = ""; - }; - F8111E0819A951050040E7D1 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 4C6D2C8D1C67EFEC00846168 /* Info.plist */, - 4C6D2C8C1C67EFEC00846168 /* Images.xcassets */, - 4C6D2C951C67F03B00846168 /* Base.lproj */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - F8111E0419A951050040E7D1 /* iOS Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */; - buildPhases = ( - F8111E0119A951050040E7D1 /* Sources */, - F8111E0219A951050040E7D1 /* Frameworks */, - F8111E0319A951050040E7D1 /* Resources */, - F818D0E519CA8D15006034B1 /* Copy Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 31E476851C55DE6D00968569 /* PBXTargetDependency */, - ); - name = "iOS Example"; - productName = Alamofire; - productReference = F8111E0519A951050040E7D1 /* iOS Example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F8111DFD19A951050040E7D1 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - F8111E0419A951050040E7D1 = { - CreatedOnToolsVersion = 6.0; - }; - }; - }; - buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = F8111DFC19A951050040E7D1; - productRefGroup = F8111E0619A951050040E7D1 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 31E476601C55DD5900968569 /* Products */; - ProjectRef = 31E4765F1C55DD5900968569 /* Alamofire.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - F8111E0419A951050040E7D1 /* iOS Example */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 31E4766A1C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476691C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E4766C1C55DD5900968569 /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = 31E4766B1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E4766E1C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E4766D1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476701C55DD5900968569 /* Alamofire OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire OSX Tests.xctest"; - remoteRef = 31E4766F1C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476721C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476711C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476741C55DD5900968569 /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = 31E476731C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 31E476761C55DD5900968569 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 31E476751C55DD5900968569 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - F8111E0319A951050040E7D1 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C6D2C8F1C67EFEC00846168 /* Images.xcassets in Resources */, - 4C6D2C981C67F03B00846168 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F8111E0119A951050040E7D1 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C6D2C801C67EFE100846168 /* AppDelegate.swift in Sources */, - 4C6D2C821C67EFE100846168 /* MasterViewController.swift in Sources */, - 4C6D2C811C67EFE100846168 /* DetailViewController.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 31E476851C55DE6D00968569 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire iOS"; - targetProxy = 31E476841C55DE6D00968569 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 4C6D2C961C67F03B00846168 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 4C6D2C971C67F03B00846168 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - F8111E2119A951050040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - F8111E2219A951050040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F8111E2419A951050040E7D1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = Resources/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "iOS Example"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - F8111E2519A951050040E7D1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = Resources/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "iOS Example"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E2119A951050040E7D1 /* Debug */, - F8111E2219A951050040E7D1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F8111E2319A951050040E7D1 /* Build configuration list for PBXNativeTarget "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F8111E2419A951050040E7D1 /* Debug */, - F8111E2519A951050040E7D1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = F8111DFD19A951050040E7D1 /* Project object */; -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bfe77a2..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme deleted file mode 100644 index ea36dc5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/LICENSE b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/LICENSE deleted file mode 100644 index bf300e4..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014–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. diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Package.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Package.swift deleted file mode 100644 index c6088ba..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Package.swift -// -// Copyright (c) 2014–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 PackageDescription - -let package = Package( - name: "Alamofire" -) diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/README.md b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/README.md deleted file mode 100644 index 0905d05..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/README.md +++ /dev/null @@ -1,1195 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg)](https://travis-ci.org/Alamofire/Alamofire) -[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) - -Alamofire is an HTTP networking library written in Swift. - -## Features - -- [x] Chainable Request / Response methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download using Request or Resume data -- [x] Authentication with NSURLCredential -- [x] HTTP Response Validation -- [x] TLS Certificate and Public Key Pinning -- [x] Progress Closure & NSProgress -- [x] cURL Debug Output -- [x] Comprehensive Unit Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Requirements - -- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 7.2+ - -## Migration Guides - -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).** -> -> Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Alamofire ecosystem. - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -use_frameworks! - -pod 'Alamofire', '~> 3.0' -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### 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 Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 3.0 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Manually - -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - -```bash -$ git init -``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - -```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`. - -- And that's it! - -> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -### Response Handling - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .responseJSON { response in - print(response.request) // original URL request - print(response.response) // URL response - print(response.data) // server data - print(response.result) // result of response serialization - - if let JSON = response.result.value { - print("JSON: \(JSON)") - } - } -``` - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler. - -### Response Serialization - -**Built-in Response Methods** - -- `response()` -- `responseData()` -- `responseString(encoding: NSStringEncoding)` -- `responseJSON(options: NSJSONReadingOptions)` -- `responsePropertyList(options: NSPropertyListReadOptions)` - -#### Response Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .response { request, response, data, error in - print(request) - print(response) - print(data) - print(error) - } -``` - -> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .responseData { response in - print(response.request) - print(response.response) - print(response.result) - } -``` - -#### Response String Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") - } -``` - -#### Response JSON Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseJSON { response in - debugPrint(response) - } -``` - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -### HTTP Methods - -`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} -``` - -These values can be passed as the first argument of the `Alamofire.request` method: - -```swift -Alamofire.request(.POST, "https://httpbin.org/post") - -Alamofire.request(.PUT, "https://httpbin.org/put") - -Alamofire.request(.DELETE, "https://httpbin.org/delete") -``` - -### Parameters - -#### GET Request With URL-Encoded Parameters - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) -// https://httpbin.org/get?foo=bar -``` - -#### POST Request With URL-Encoded Parameters - -```swift -let parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters) -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -### Parameter Encoding - -Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum: - -```swift -enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(format: NSPropertyListFormat, options: NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - func encode(request: NSURLRequest, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?) - { ... } -} -``` - -- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._ -- `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same implementation as the `.URL` case, but always applies the encoded result to the URL. -- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. -- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters. - -#### Manual Parameter Encoding of an NSURLRequest - -```swift -let URL = NSURL(string: "https://httpbin.org/get")! -var request = NSMutableURLRequest(URL: URL) - -let parameters = ["foo": "bar"] -let encoding = Alamofire.ParameterEncoding.URL -(request, _) = encoding.encode(request, parameters: parameters) -``` - -#### POST Request with JSON-encoded Parameters - -```swift -let parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON) -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -> For HTTP headers that do not change, it is recommended to set them on the `NSURLSessionConfiguration` so they are automatically applied to any `NSURLSessionTask` created by the underlying `NSURLSession`. - -```swift -let headers = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Content-Type": "application/x-www-form-urlencoded" -] - -Alamofire.request(.GET, "https://httpbin.org/get", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -### Caching - -Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache). - -### Uploading - -**Supported Upload Types** - -- File -- Data -- Stream -- MultipartFormData - -#### Uploading a File - -```swift -let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png") -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) -``` - -#### Uploading with Progress - -```swift -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) - .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in - print(totalBytesWritten) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes written on main queue: \(totalBytesWritten)") - } - } - .responseJSON { response in - debugPrint(response) - } -``` - -#### Uploading MultipartFormData - -```swift -Alamofire.upload( - .POST, - "https://httpbin.org/post", - multipartFormData: { multipartFormData in - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - }, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .Failure(let encodingError): - print(encodingError) - } - } -) -``` - -### Downloading - -**Supported Download Types** - -- Request -- Resume Data - -#### Downloading a File - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100") { temporaryURL, response in - let fileManager = NSFileManager.defaultManager() - let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] - let pathComponent = response.suggestedFilename - - return directoryURL.URLByAppendingPathComponent(pathComponent!) -} -``` - -#### Using the Default Download Destination - -```swift -let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask) -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -``` - -#### Downloading a File w/Progress - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - print(totalBytesRead) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes read on main queue: \(totalBytesRead)") - } - } - .response { _, _, _, error in - if let error = error { - print("Failed with error: \(error)") - } else { - print("Downloaded file successfully") - } - } -``` - -#### Accessing Resume Data for Failed Downloads - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .response { _, _, data, _ in - if let - data = data, - resumeDataString = NSString(data: data, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } - } -``` - -> The `data` parameter is automatically populated with the `resumeData` if available. - -```swift -let download = Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -download.response { _, _, _, _ in - if let - resumeData = download.resumeData, - resumeDataString = NSString(data: resumeData, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } -} -``` - -### Authentication - -Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide an `NSURLCredential` to an `NSURLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)! -let base64Credentials = credentialData.base64EncodedStringWithOptions([]) - -let headers = ["Authorization": "Basic \(base64Credentials)"] - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with NSURLCredential - -```swift -let user = "user" -let password = "password" - -let credential = NSURLCredential(user: user, password: password, persistence: .ForSession) - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -### Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .response { response in - print(response) - } -``` - -#### Automatic Validation - -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - switch response.result { - case .Success: - print("Validation Successful") - case .Failure(let error): - print(error) - } - } -``` - -### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - print(response.timeline) - } -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -### Printable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -### DebugPrintable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - -debugPrint(request) -``` - -#### Output (cURL) - -```bash -$ curl -i \ - -H "User-Agent: Alamofire" \ - -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of -this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession) -- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache) -- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html) - -### Manager - -Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -```swift -let manager = Alamofire.Manager.sharedInstance -manager.request(NSURLRequest(URL: NSURL(string: "https://httpbin.org/get")!)) -``` - -Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Manager with Default Configuration - -```swift -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Background Configuration - -```swift -let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.example.app.background") -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Ephemeral Configuration - -```swift -let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Modifying Session Configuration - -```swift -var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:] -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -configuration.HTTPAdditionalHeaders = defaultHeaders - -let manager = Alamofire.Manager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Request - -The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly. - -Methods like `authenticate`, `validate` and `responseData` return the caller in order to facilitate chaining. - -Requests can be suspended, resumed, and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Response Serialization - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension Request { - public static func XMLResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - guard let validData = data else { - let failureReason = "Data could not be serialized. Input data was nil." - let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let XML = try ONOXMLDocument(data: validData) - return .Success(XML) - } catch { - return .Failure(error as NSError) - } - } - } - - public func responseXMLDocument(completionHandler: Response -> Void) -> Self { - return response(responseSerializer: Request.XMLResponseSerializer(), completionHandler: completionHandler) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -public protocol ResponseObjectSerializable { - init?(response: NSHTTPURLResponse, representation: AnyObject) -} - -extension Request { - public func responseObject(completionHandler: Response -> Void) -> Self { - let responseSerializer = ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONResponseSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let - response = response, - responseObject = T(response: response, representation: value) - { - return .Success(responseObject) - } else { - let failureReason = "JSON could not be serialized into response object: \(value)" - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - case .Failure(let error): - return .Failure(error) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } -} -``` - -```swift -Alamofire.request(.GET, "https://example.com/users/mattt") - .responseObject { (response: Response) in - debugPrint(response) - } -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -public protocol ResponseCollectionSerializable { - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] -} - -extension Alamofire.Request { - public func responseCollection(completionHandler: Response<[T], NSError> -> Void) -> Self { - let responseSerializer = ResponseSerializer<[T], NSError> { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let response = response { - return .Success(T.collection(response: response, representation: value)) - } else { - let failureReason = "Response collection could not be serialized due to nil response" - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - case .Failure(let error): - return .Failure(error) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable, ResponseCollectionSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } - - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [User] { - var users: [User] = [] - - if let representation = representation as? [[String: AnyObject]] { - for userRepresentation in representation { - if let user = User(response: response, representation: userRepresentation) { - users.append(user) - } - } - } - - return users - } -} -``` - -```swift -Alamofire.request(.GET, "http://example.com/users") - .responseCollection { (response: Response<[User], NSError>) in - debugPrint(response) - } -``` - -### URLStringConvertible - -Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods: - -```swift -let string = NSString(string: "https://httpbin.org/post") -Alamofire.request(.POST, string) - -let URL = NSURL(string: string)! -Alamofire.request(.POST, URL) - -let URLRequest = NSURLRequest(URL: URL) -Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest` - -let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true) -Alamofire.request(.POST, URLComponents) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources. - -#### Type-Safe Routing - -```swift -extension User: URLStringConvertible { - static let baseURLString = "http://example.com" - - var URLString: String { - return User.baseURLString + "/users/\(username)/" - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(.GET, user) // http://example.com/users/mattt -``` - -### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let URL = NSURL(string: "https://httpbin.org/post")! -let mutableURLRequest = NSMutableURLRequest(URL: URL) -mutableURLRequest.HTTPMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - mutableURLRequest.HTTPBody = try NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions()) -} catch { - // No-op -} - -mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(mutableURLRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -#### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static let perPage = 50 - - case Search(query: String, page: Int) - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let result: (path: String, parameters: [String: AnyObject]) = { - switch self { - case .Search(let query, let page) where page > 1: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case .Search(let query, _): - return ("/search", ["q": query]) - } - }() - - let URL = NSURL(string: Router.baseURLString)! - let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(result.path)) - let encoding = Alamofire.ParameterEncoding.URL - - return encoding.encode(URLRequest, parameters: result.parameters).0 - } -} -``` - -```swift -Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo%20bar&offset=50 -``` - -#### CRUD & Authorization - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static var OAuthToken: String? - - case CreateUser([String: AnyObject]) - case ReadUser(String) - case UpdateUser(String, [String: AnyObject]) - case DestroyUser(String) - - var method: Alamofire.Method { - switch self { - case .CreateUser: - return .POST - case .ReadUser: - return .GET - case .UpdateUser: - return .PUT - case .DestroyUser: - return .DELETE - } - } - - var path: String { - switch self { - case .CreateUser: - return "/users" - case .ReadUser(let username): - return "/users/\(username)" - case .UpdateUser(let username, _): - return "/users/\(username)" - case .DestroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let URL = NSURL(string: Router.baseURLString)! - let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path)) - mutableURLRequest.HTTPMethod = method.rawValue - - if let token = Router.OAuthToken { - mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") - } - - switch self { - case .CreateUser(let parameters): - return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0 - case .UpdateUser(_, let parameters): - return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 - default: - return mutableURLRequest - } - } -} -``` - -```swift -Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt -``` - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `PerformDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `PinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `PinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `DisableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `CustomEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .DisableEvaluation -] - -let manager = Manager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `Manager` instance, otherwise your requests will all get cancelled when your `manager` is deallocated. - -These server trust policies will result in the following behavior: - -* `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - * Certificate chain MUST be valid. - * Certificate chain MUST include one of the pinned certificates. - * Challenge host MUST match the host in the certificate chain's leaf certificate. -* `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -* All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.PerformDefaultEvaluation`, `.PinCertificates` and `.PinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certficates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. - -There are some important things to remember when using network reachability to determine what to do next. - -* **Do NOT** use Reachability to determine if a network request should be sent. - * You should **ALWAYS** send it. -* When Reachability is restored, use the event to retry failed network requests. - * Even though the network requests may still fail, this is a good moment to retry them. -* The network reachability status can be useful for determining why a network request may have failed. - * If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical errror, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -* [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. - -## Open Rdars - -The following rdars have some affect on the current implementation of Alamofire. - -* [rdar://21349340](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## License - -Alamofire is released under the MIT license. See LICENSE for details. diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.h b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.h deleted file mode 100644 index c27948a..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.h +++ /dev/null @@ -1,26 +0,0 @@ -// Alamofire.h -// -// Copyright (c) 2014–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 Foundation; - -FOUNDATION_EXPORT double AlamofireVersionNumber; -FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.swift deleted file mode 100644 index b866f42..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,368 +0,0 @@ -// Alamofire.swift -// -// Copyright (c) 2014–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 Foundation - -// MARK: - URLStringConvertible - -/** - Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to - construct URL requests. -*/ -public protocol URLStringConvertible { - /** - A URL that conforms to RFC 2396. - - Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808. - - See https://tools.ietf.org/html/rfc2396 - See https://tools.ietf.org/html/rfc1738 - See https://tools.ietf.org/html/rfc1808 - */ - var URLString: String { get } -} - -extension String: URLStringConvertible { - public var URLString: String { - return self - } -} - -extension NSURL: URLStringConvertible { - public var URLString: String { - return absoluteString - } -} - -extension NSURLComponents: URLStringConvertible { - public var URLString: String { - return URL!.URLString - } -} - -extension NSURLRequest: URLStringConvertible { - public var URLString: String { - return URL!.URLString - } -} - -// MARK: - URLRequestConvertible - -/** - Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -*/ -public protocol URLRequestConvertible { - /// The URL request. - var URLRequest: NSMutableURLRequest { get } -} - -extension NSURLRequest: URLRequestConvertible { - public var URLRequest: NSMutableURLRequest { - return self.mutableCopy() as! NSMutableURLRequest - } -} - -// MARK: - Convenience - -func URLRequest( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil) - -> NSMutableURLRequest -{ - let mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URLString.URLString)!) - mutableURLRequest.HTTPMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - mutableURLRequest.setValue(headerValue, forHTTPHeaderField: headerField) - } - } - - return mutableURLRequest -} - -// MARK: - Request Methods - -/** - Creates a request using the shared manager instance for the specified method, URL string, parameters, and - parameter encoding. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. -*/ -public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request -{ - return Manager.sharedInstance.request( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/** - Creates a request using the shared manager instance for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. -*/ -public func request(URLRequest: URLRequestConvertible) -> Request { - return Manager.sharedInstance.request(URLRequest.URLRequest) -} - -// MARK: - Upload Methods - -// MARK: File - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and file. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and file. - - - parameter URLRequest: The URL request. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return Manager.sharedInstance.upload(URLRequest, file: file) -} - -// MARK: Data - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and data. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and data. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return Manager.sharedInstance.upload(URLRequest, data: data) -} - -// MARK: Stream - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and stream. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request -{ - return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and stream. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return Manager.sharedInstance.upload(URLRequest, stream: stream) -} - -// MARK: MultipartFormData - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) -{ - return Manager.sharedInstance.upload( - method, - URLString, - headers: headers, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) -{ - return Manager.sharedInstance.upload( - URLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -// MARK: - Download Methods - -// MARK: URL Request - -/** - Creates a download request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request -{ - return Manager.sharedInstance.download( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers, - destination: destination - ) -} - -/** - Creates a download request using the shared manager instance for the specified URL request. - - - parameter URLRequest: The URL request. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(URLRequest, destination: destination) -} - -// MARK: Resume Data - -/** - Creates a request using the shared manager instance for downloading from the resume data produced from a - previous request cancellation. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional - information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(data, destination: destination) -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Download.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Download.swift deleted file mode 100644 index 2ebe40f..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Download.swift +++ /dev/null @@ -1,246 +0,0 @@ -// Download.swift -// -// Copyright (c) 2014–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 Foundation - -extension Manager { - private enum Downloadable { - case Request(NSURLRequest) - case ResumeData(NSData) - } - - private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request { - var downloadTask: NSURLSessionDownloadTask! - - switch downloadable { - case .Request(let request): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithRequest(request) - } - case .ResumeData(let resumeData): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithResumeData(resumeData) - } - } - - let request = Request(session: session, task: downloadTask) - - if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate { - downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in - return destination(URL, downloadTask.response as! NSHTTPURLResponse) - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: Request - - /** - Creates a download request for the specified method, URL string, parameters, parameter encoding, headers - and destination. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - - return download(encodedURLRequest, destination: destination) - } - - /** - Creates a request for downloading from the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return download(.Request(URLRequest.URLRequest), destination: destination) - } - - // MARK: Resume Data - - /** - Creates a request for downloading from the resume data produced from a previous request cancellation. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for - additional information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request { - return download(.ResumeData(resumeData), destination: destination) - } -} - -// MARK: - - -extension Request { - /** - A closure executed once a request has successfully completed in order to determine where to move the temporary - file written to during the download process. The closure takes two arguments: the temporary file URL and the URL - response, and returns a single argument: the file URL where the temporary file should be moved. - */ - public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL - - /** - Creates a download file destination closure which uses the default file manager to move the temporary file to a - file URL in the first available directory with the specified search path directory and search path domain mask. - - - parameter directory: The search path directory. `.DocumentDirectory` by default. - - parameter domain: The search path domain mask. `.UserDomainMask` by default. - - - returns: A download file destination closure. - */ - public class func suggestedDownloadDestination( - directory directory: NSSearchPathDirectory = .DocumentDirectory, - domain: NSSearchPathDomainMask = .UserDomainMask) - -> DownloadFileDestination - { - return { temporaryURL, response -> NSURL in - let directoryURLs = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain) - - if !directoryURLs.isEmpty { - return directoryURLs[0].URLByAppendingPathComponent(response.suggestedFilename!) - } - - return temporaryURL - } - } - - /// The resume data of the underlying download task if available after a failure. - public var resumeData: NSData? { - var data: NSData? - - if let delegate = delegate as? DownloadTaskDelegate { - data = delegate.resumeData - } - - return data - } - - // MARK: - DownloadTaskDelegate - - class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate { - var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask } - var downloadProgress: ((Int64, Int64, Int64) -> Void)? - - var resumeData: NSData? - override var data: NSData? { return resumeData } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)? - var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - do { - let destination = downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - try NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination) - } catch { - self.error = error as NSError - } - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Error.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Error.swift deleted file mode 100644 index 7a813f1..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Error.swift +++ /dev/null @@ -1,66 +0,0 @@ -// Error.swift -// -// Copyright (c) 2014–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 Foundation - -/// The `Error` struct provides a convenience for creating custom Alamofire NSErrors. -public struct Error { - /// The domain used for creating all Alamofire errors. - public static let Domain = "com.alamofire.error" - - /// The custom error codes generated by Alamofire. - public enum Code: Int { - case InputStreamReadFailed = -6000 - case OutputStreamWriteFailed = -6001 - case ContentTypeValidationFailed = -6002 - case StatusCodeValidationFailed = -6003 - case DataSerializationFailed = -6004 - case StringSerializationFailed = -6005 - case JSONSerializationFailed = -6006 - case PropertyListSerializationFailed = -6007 - } - - /** - Creates an `NSError` with the given error code and failure reason. - - - parameter code: The error code. - - parameter failureReason: The failure reason. - - - returns: An `NSError` with the given error code and failure reason. - */ - public static func errorWithCode(code: Code, failureReason: String) -> NSError { - return errorWithCode(code.rawValue, failureReason: failureReason) - } - - /** - Creates an `NSError` with the given error code and failure reason. - - - parameter code: The error code. - - parameter failureReason: The failure reason. - - - returns: An `NSError` with the given error code and failure reason. - */ - public static func errorWithCode(code: Int, failureReason: String) -> NSError { - let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] - return NSError(domain: Domain, code: code, userInfo: userInfo) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist deleted file mode 100644 index 07bfcd5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info-tvOS.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.2.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - UIRequiredDeviceCapabilities - - arm64 - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info.plist b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info.plist deleted file mode 100644 index 340121d..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.2.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Manager.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Manager.swift deleted file mode 100644 index b10045c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Manager.swift +++ /dev/null @@ -1,695 +0,0 @@ -// Manager.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -*/ -public class Manager { - - // MARK: - Properties - - /** - A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly - for any ad hoc requests. - */ - public static let sharedInstance: Manager = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders - - return Manager(configuration: configuration) - }() - - /** - Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - */ - public static let defaultHTTPHeaders: [String: String] = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - let acceptLanguage = NSLocale.preferredLanguages().prefix(6).enumerate().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joinWithSeparator(", ") - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - let userAgent: String = { - if let info = NSBundle.mainBundle().infoDictionary { - let executable: AnyObject = info[kCFBundleExecutableKey as String] ?? "Unknown" - let bundle: AnyObject = info[kCFBundleIdentifierKey as String] ?? "Unknown" - let version: AnyObject = info[kCFBundleVersionKey as String] ?? "Unknown" - let os: AnyObject = NSProcessInfo.processInfo().operatingSystemVersionString ?? "Unknown" - - var mutableUserAgent = NSMutableString(string: "\(executable)/\(bundle) (\(version); OS \(os))") as CFMutableString - let transform = NSString(string: "Any-Latin; Latin-ASCII; [:^ASCII:] Remove") as CFString - - if CFStringTransform(mutableUserAgent, UnsafeMutablePointer(nil), transform, false) { - return mutableUserAgent as String - } - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL) - - /// The underlying session. - public let session: NSURLSession - - /// The session delegate handling all the task and session delegate callbacks. - public let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - public var startRequestsImmediately: Bool = true - - /** - The background completion handler closure provided by the UIApplicationDelegate - `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - will automatically call the handler. - - If you need to handle your own events before the handler is called, then you need to override the - SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - - `nil` by default. - */ - public var backgroundCompletionHandler: (() -> Void)? - - // MARK: - Lifecycle - - /** - Initializes the `Manager` instance with the specified configuration, delegate and server trust policy. - - - parameter configuration: The configuration used to construct the managed session. - `NSURLSessionConfiguration.defaultSessionConfiguration()` by default. - - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - default. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance. - */ - public init( - configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /** - Initializes the `Manager` instance with the specified session, delegate and server trust policy. - - - parameter session: The URL session. - - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance if the URL session's delegate matches the delegate parameter. - */ - public init?( - session: NSURLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = session - - guard delegate === session.delegate else { return nil } - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - dispatch_async(dispatch_get_main_queue()) { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Request - - /** - Creates a request for the specified method, URL string, parameters, parameter encoding and headers. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. - */ - public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - return request(encodedURLRequest) - } - - /** - Creates a request for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. - */ - public func request(URLRequest: URLRequestConvertible) -> Request { - var dataTask: NSURLSessionDataTask! - dispatch_sync(queue) { dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) } - - let request = Request(session: session, task: dataTask) - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: - SessionDelegate - - /** - Responsible for handling all delegate callbacks for the underlying session. - */ - public final class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate { - private var subdelegates: [Int: Request.TaskDelegate] = [:] - private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT) - - subscript(task: NSURLSessionTask) -> Request.TaskDelegate? { - get { - var subdelegate: Request.TaskDelegate? - dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] } - - return subdelegate - } - - set { - dispatch_barrier_async(subdelegateQueue) { self.subdelegates[task.taskIdentifier] = newValue } - } - } - - /** - Initializes the `SessionDelegate` instance. - - - returns: The new `SessionDelegate` instance. - */ - public override init() { - super.init() - } - - // MARK: - NSURLSessionDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didBecomeInvalidWithError:`. - public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`. - public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`. - public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the session has been invalidated. - - - parameter session: The session object that was invalidated. - - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - */ - public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /** - Requests credentials from the delegate in response to a session-level authentication request from the remote server. - - - parameter session: The session containing the task that requested authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - - /** - Tells the delegate that all messages enqueued for a session have been delivered. - - - parameter session: The session that no longer has any outstanding requests. - */ - public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`. - public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`. - public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`. - public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream!)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. - public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`. - public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the remote server requested an HTTP redirect. - - - parameter session: The session containing the task whose request resulted in a redirect. - - parameter task: The task whose request resulted in a redirect. - - parameter response: An object containing the server’s response to the original request. - - parameter request: A URL request object filled out with the new location. - - parameter completionHandler: A closure that your handler should call with either the value of the request - parameter, a modified URL request object, or NULL to refuse the redirect and - return the body of the redirect response. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: ((NSURLRequest?) -> Void)) - { - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /** - Requests credentials from the delegate in response to an authentication request from the remote server. - - - parameter session: The session containing the task whose request requires authentication. - - parameter task: The task whose request requires authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - completionHandler(taskDidReceiveChallenge(session, task, challenge)) - } else if let delegate = self[task] { - delegate.URLSession( - session, - task: task, - didReceiveChallenge: challenge, - completionHandler: completionHandler - ) - } else { - URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler) - } - } - - /** - Tells the delegate when a task requires a new request body stream to send to the remote server. - - - parameter session: The session containing the task that needs a new body stream. - - parameter task: The task that needs a new body stream. - - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) - { - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /** - Periodically informs the delegate of the progress of sending body content to the server. - - - parameter session: The session containing the data task. - - parameter task: The data task. - - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - - parameter totalBytesSent: The total number of bytes sent so far. - - parameter totalBytesExpectedToSend: The expected length of the body data. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task] as? Request.UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - - /** - Tells the delegate that the task finished transferring data. - - - parameter session: The session containing the task whose request finished transferring data. - - parameter task: The task whose request finished transferring data. - - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - */ - public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidComplete = taskDidComplete { - taskDidComplete(session, task, error) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, didCompleteWithError: error) - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidComplete, object: task) - - self[task] = nil - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`. - public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`. - public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`. - public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`. - public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse!)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the data task received the initial reply (headers) from the server. - - - parameter session: The session containing the data task that received an initial reply. - - parameter dataTask: The data task that received an initial reply. - - parameter response: A URL response object populated with headers. - - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - constant to indicate whether the transfer should continue as a data task or - should become a download task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: ((NSURLSessionResponseDisposition) -> Void)) - { - var disposition: NSURLSessionResponseDisposition = .Allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /** - Tells the delegate that the data task was changed to a download task. - - - parameter session: The session containing the task that was replaced by a download task. - - parameter dataTask: The data task that was replaced by a download task. - - parameter downloadTask: The new download task that replaced the data task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) - { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask) - self[downloadTask] = downloadDelegate - } - } - - /** - Tells the delegate that the data task has received some of the expected data. - - - parameter session: The session containing the data task that provided data. - - parameter dataTask: The data task that provided data. - - parameter data: A data object containing the transferred data. - */ - public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession(session, dataTask: dataTask, didReceiveData: data) - } - } - - /** - Asks the delegate whether the data (or upload) task should store the response in the cache. - - - parameter session: The session containing the data (or upload) task. - - parameter dataTask: The data (or upload) task. - - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - caching policy and the values of certain received headers, such as the Pragma - and Cache-Control headers. - - parameter completionHandler: A block that your handler must call, providing either the original proposed - response, a modified version of that response, or NULL to prevent caching the - response. If your delegate implements this method, it must call this completion - handler; otherwise, your app leaks memory. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: ((NSCachedURLResponse?) -> Void)) - { - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`. - public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`. - public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. - public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that a download task has finished downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that finished. - - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - open the file for reading or move it to a permanent location in your app’s sandbox - container directory before returning from this delegate method. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location) - } - } - - /** - Periodically informs the delegate about the download’s progress. - - - parameter session: The session containing the download task. - - parameter downloadTask: The download task. - - parameter bytesWritten: The number of bytes transferred since the last time this delegate - method was called. - - parameter totalBytesWritten: The total number of bytes transferred so far. - - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - header. If this header was not provided, the value is - `NSURLSessionTransferSizeUnknown`. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /** - Tells the delegate that the download task has resumed downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that resumed. See explanation in the discussion. - - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - existing content, then this value is zero. Otherwise, this value is an - integer representing the number of bytes on disk that do not need to be - retrieved again. - - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } - - // MARK: - NSURLSessionStreamDelegate - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - - // MARK: - NSObject - - public override func respondsToSelector(selector: Selector) -> Bool { - switch selector { - case "URLSession:didBecomeInvalidWithError:": - return sessionDidBecomeInvalidWithError != nil - case "URLSession:didReceiveChallenge:completionHandler:": - return sessionDidReceiveChallenge != nil - case "URLSessionDidFinishEventsForBackgroundURLSession:": - return sessionDidFinishEventsForBackgroundURLSession != nil - case "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:": - return taskWillPerformHTTPRedirection != nil - case "URLSession:dataTask:didReceiveResponse:completionHandler:": - return dataTaskDidReceiveResponse != nil - default: - return self.dynamicType.instancesRespondToSelector(selector) - } - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index 8c37f16..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,669 +0,0 @@ -// MultipartFormData.swift -// -// Copyright (c) 2014–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 Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(OSX) -import CoreServices -#endif - -/** - Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode - multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead - to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the - data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for - larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. - - For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well - and the w3 form documentation. - - - https://www.ietf.org/rfc/rfc2388.txt - - https://www.ietf.org/rfc/rfc2045.txt - - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -*/ -public class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let CRLF = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case Initial, Encapsulated, Final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(boundaryType boundaryType: BoundaryType, boundary: String) -> NSData { - let boundaryText: String - - switch boundaryType { - case .Initial: - boundaryText = "--\(boundary)\(EncodingCharacters.CRLF)" - case .Encapsulated: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)\(EncodingCharacters.CRLF)" - case .Final: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)--\(EncodingCharacters.CRLF)" - } - - return boundaryText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: [String: String] - let bodyStream: NSInputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: [String: String], bodyStream: NSInputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - public var contentType: String { return "multipart/form-data; boundary=\(boundary)" } - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: NSError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /** - Creates a multipart form data object. - - - returns: The multipart form data object. - */ - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /** - * The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - * information, please refer to the following article: - * - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - */ - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String) { - let headers = contentHeaders(name: name) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, mimeType: String) { - let headers = contentHeaders(name: name, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - system associated MIME type. - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String) { - if let - fileName = fileURL.lastPathComponent, - pathExtension = fileURL.pathExtension - { - let mimeType = mimeTypeForPathExtension(pathExtension) - appendBodyPart(fileURL: fileURL, name: name, fileName: fileName, mimeType: mimeType) - } else { - let failureReason = "Failed to extract the fileName of the provided URL: \(fileURL)" - setBodyPartError(Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason)) - } - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - - Content-Type: #{mimeType} (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.fileURL else { - let failureReason = "The file URL does not point to a file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - var isReachable = true - - if #available(OSX 10.10, *) { - isReachable = fileURL.checkPromisedItemIsReachableAndReturnError(nil) - } - - guard isReachable else { - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: "The file URL is not reachable: \(fileURL)") - setBodyPartError(error) - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - - guard let - path = fileURL.path - where NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory) && !isDirectory else - { - let failureReason = "The file URL is a directory, not a file: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - var bodyContentLength: UInt64? - - do { - if let - path = fileURL.path, - fileSize = try NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize] as? NSNumber - { - bodyContentLength = fileSize.unsignedLongLongValue - } - } catch { - // No-op - } - - guard let length = bodyContentLength else { - let failureReason = "Could not fetch attributes from the file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - setBodyPartError(error) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = NSInputStream(URL: fileURL) else { - let failureReason = "Failed to create an input stream from the file URL: \(fileURL)" - let error = Error.errorWithCode(NSURLErrorCannotOpenFile, failureReason: failureReason) - setBodyPartError(error) - return - } - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the stream and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - */ - public func appendBodyPart( - stream stream: NSInputStream, - length: UInt64, - name: String, - fileName: String, - mimeType: String) - { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part with the headers, stream and length and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - HTTP headers - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter headers: The HTTP headers for the body part. - */ - public func appendBodyPart(stream stream: NSInputStream, length: UInt64, headers: [String: String]) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /** - Encodes all the appended body parts into a single `NSData` object. - - It is important to note that this method will load all the appended body parts into memory all at the same - time. This method should only be used when the encoded data will have a small memory footprint. For large data - cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - - - throws: An `NSError` if encoding encounters an error. - - - returns: The encoded `NSData` if encoding is successful. - */ - public func encode() throws -> NSData { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - let encoded = NSMutableData() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encodeBodyPart(bodyPart) - encoded.appendData(encodedData) - } - - return encoded - } - - /** - Writes the appended body parts into the given file URL. - - This process is facilitated by reading and writing with input and output streams, respectively. Thus, - this approach is very memory efficient and should be used for large body part data. - - - parameter fileURL: The file URL to write the multipart form data into. - - - throws: An `NSError` if encoding encounters an error. - */ - public func writeEncodedDataToDisk(fileURL: NSURL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if let path = fileURL.path where NSFileManager.defaultManager().fileExistsAtPath(path) { - let failureReason = "A file already exists at the given file URL: \(fileURL)" - throw Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - } else if !fileURL.fileURL { - let failureReason = "The URL does not point to a valid file: \(fileURL)" - throw Error.errorWithCode(NSURLErrorBadURL, failureReason: failureReason) - } - - let outputStream: NSOutputStream - - if let possibleOutputStream = NSOutputStream(URL: fileURL, append: false) { - outputStream = possibleOutputStream - } else { - let failureReason = "Failed to create an output stream with the given URL: \(fileURL)" - throw Error.errorWithCode(NSURLErrorCannotOpenFile, failureReason: failureReason) - } - - outputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - outputStream.open() - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try writeBodyPart(bodyPart, toOutputStream: outputStream) - } - - outputStream.close() - outputStream.removeFromRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - } - - // MARK: - Private - Body Part Encoding - - private func encodeBodyPart(bodyPart: BodyPart) throws -> NSData { - let encoded = NSMutableData() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.appendData(initialData) - - let headerData = encodeHeaderDataForBodyPart(bodyPart) - encoded.appendData(headerData) - - let bodyStreamData = try encodeBodyStreamDataForBodyPart(bodyPart) - encoded.appendData(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.appendData(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaderDataForBodyPart(bodyPart: BodyPart) -> NSData { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.CRLF)" - } - headerText += EncodingCharacters.CRLF - - return headerText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - - private func encodeBodyStreamDataForBodyPart(bodyPart: BodyPart) throws -> NSData { - let inputStream = bodyPart.bodyStream - inputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - inputStream.open() - - var error: NSError? - let encoded = NSMutableData() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if inputStream.streamError != nil { - error = inputStream.streamError - break - } - - if bytesRead > 0 { - encoded.appendBytes(buffer, length: bytesRead) - } else if bytesRead < 0 { - let failureReason = "Failed to read from input stream: \(inputStream)" - error = Error.errorWithCode(.InputStreamReadFailed, failureReason: failureReason) - break - } else { - break - } - } - - inputStream.close() - inputStream.removeFromRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - - if let error = error { - throw error - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func writeBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - try writeInitialBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeHeaderDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeBodyStreamForBodyPart(bodyPart, toOutputStream: outputStream) - try writeFinalBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - } - - private func writeInitialBoundaryDataForBodyPart( - bodyPart: BodyPart, - toOutputStream outputStream: NSOutputStream) - throws - { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try writeData(initialData, toOutputStream: outputStream) - } - - private func writeHeaderDataForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let headerData = encodeHeaderDataForBodyPart(bodyPart) - return try writeData(headerData, toOutputStream: outputStream) - } - - private func writeBodyStreamForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let inputStream = bodyPart.bodyStream - inputStream.scheduleInRunLoop(NSRunLoop.currentRunLoop(), forMode: NSDefaultRunLoopMode) - inputStream.open() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw streamError - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0 { - if outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let streamError = outputStream.streamError { - throw streamError - } - - if bytesWritten < 0 { - let failureReason = "Failed to write to output stream: \(outputStream)" - throw Error.errorWithCode(.OutputStreamWriteFailed, failureReason: failureReason) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if let - id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension, nil)?.takeRetainedValue(), - contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() - { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(name name: String) -> [String: String] { - return ["Content-Disposition": "form-data; name=\"\(name)\""] - } - - private func contentHeaders(name name: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"", - "Content-Type": "\(mimeType)" - ] - } - - private func contentHeaders(name name: String, fileName: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"; filename=\"\(fileName)\"", - "Content-Type": "\(mimeType)" - ] - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(error: NSError) { - if bodyPartError == nil { - bodyPartError = error - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 63f97b6..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,239 +0,0 @@ -// NetworkReachabilityManager.swift -// -// Copyright (c) 2014–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. - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/** - The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and - WiFi network interfaces. - - Reachability can be used to determine background information about why a network operation failed, or to retry - network requests 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. -*/ -public class NetworkReachabilityManager { - /** - Defines the various states of network reachability. - - - Unknown: It is unknown whether the network is reachable. - - NotReachable: The network is not reachable. - - ReachableOnWWAN: The network is reachable over the WWAN connection. - - ReachableOnWiFi: The network is reachable over the WiFi connection. - */ - public enum NetworkReachabilityStatus { - case Unknown - case NotReachable - case Reachable(ConnectionType) - } - - /** - Defines the various connection types detected by reachability flags. - - - EthernetOrWiFi: The connection type is either over Ethernet or WiFi. - - WWAN: The connection type is a WWAN connection. - */ - public enum ConnectionType { - case EthernetOrWiFi - case WWAN - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = NetworkReachabilityStatus -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .Reachable(.WWAN) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .Reachable(.EthernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .Unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: dispatch_queue_t = dispatch_get_main_queue() - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /** - Creates a `NetworkReachabilityManager` instance with the specified host. - - - parameter host: The host used to evaluate network reachability. - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /** - Creates a `NetworkReachabilityManager` instance with the default socket address (`sockaddr_in6`). - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?() { - var address = sockaddr_in6() - address.sin6_len = UInt8(sizeofValue(address)) - address.sin6_family = sa_family_t(AF_INET6) - - guard let reachability = withUnsafePointer(&address, { - SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /** - Starts listening for changes in network reachability status. - - - returns: `true` if listening was started successfully, `false` otherwise. - */ - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque()) - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, - { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(COpaquePointer(info)).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - dispatch_async(listenerQueue) { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /** - Stops listening for changes in network reachability status. - */ - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.Reachable) else { return .NotReachable } - - var networkStatus: NetworkReachabilityStatus = .NotReachable - - if !flags.contains(.ConnectionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - - if flags.contains(.ConnectionOnDemand) || flags.contains(.ConnectionOnTraffic) { - if !flags.contains(.InterventionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - } - - #if os(iOS) - if flags.contains(.IsWWAN) { networkStatus = .Reachable(.WWAN) } - #endif - - return networkStatus - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/** - Returns whether the two network reachability status values are equal. - - - parameter lhs: The left-hand side value to compare. - - parameter rhs: The right-hand side value to compare. - - - returns: `true` if the two values are equal, `false` otherwise. -*/ -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool -{ - switch (lhs, rhs) { - case (.Unknown, .Unknown): - return true - case (.NotReachable, .NotReachable): - return true - case let (.Reachable(lhsConnectionType), .Reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Notifications.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Notifications.swift deleted file mode 100644 index 1c23540..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,45 +0,0 @@ -// Notifications.swift -// -// Copyright (c) 2014–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 Foundation - -/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload. -public struct Notifications { - /// Used as a namespace for all `NSURLSessionTask` related notifications. - public struct Task { - /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed - /// `NSURLSessionTask`. - public static let DidResume = "com.alamofire.notifications.task.didResume" - - /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the - /// suspended `NSURLSessionTask`. - public static let DidSuspend = "com.alamofire.notifications.task.didSuspend" - - /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the - /// cancelled `NSURLSessionTask`. - public static let DidCancel = "com.alamofire.notifications.task.didCancel" - - /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the - /// completed `NSURLSessionTask`. - public static let DidComplete = "com.alamofire.notifications.task.didComplete" - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index adf61c5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,252 +0,0 @@ -// ParameterEncoding.swift -// -// Copyright (c) 2014–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 Foundation - -/** - HTTP method definitions. - - See https://tools.ietf.org/html/rfc7231#section-4.3 -*/ -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} - -// MARK: ParameterEncoding - -/** - Used to specify the way in which a set of parameters are applied to a URL request. - - - `URL`: Creates a query string to be set as or appended to any existing URL query for `GET`, `HEAD`, - and `DELETE` requests, or set as the body for requests with any other HTTP method. The - `Content-Type` HTTP header field of an encoded request with HTTP body is set to - `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification - for how to encode collection types, the convention of appending `[]` to the key for array - values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested - dictionary values (`foo[bar]=baz`). - - - `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same - implementation as the `.URL` case, but always applies the encoded result to the URL. - - - `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is - set as the body of the request. The `Content-Type` HTTP header field of an encoded request is - set to `application/json`. - - - `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, - according to the associated format and write options values, which is set as the body of the - request. The `Content-Type` HTTP header field of an encoded request is set to - `application/x-plist`. - - - `Custom`: Uses the associated closure value to construct a new request given an existing request and - parameters. -*/ -public enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - /** - Creates a URL request by encoding parameters and applying them onto an existing request. - - - parameter URLRequest: The request to have parameters applied - - parameter parameters: The parameters to apply - - - returns: A tuple containing the constructed request and the error that occurred during parameter encoding, - if any. - */ - public func encode( - URLRequest: URLRequestConvertible, - parameters: [String: AnyObject]?) - -> (NSMutableURLRequest, NSError?) - { - var mutableURLRequest = URLRequest.URLRequest - - guard let parameters = parameters else { return (mutableURLRequest, nil) } - - var encodingError: NSError? = nil - - switch self { - case .URL, .URLEncodedInURL: - func query(parameters: [String: AnyObject]) -> String { - var components: [(String, String)] = [] - - for key in parameters.keys.sort(<) { - let value = parameters[key]! - components += queryComponents(key, value) - } - - return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&") - } - - func encodesParametersInURL(method: Method) -> Bool { - switch self { - case .URLEncodedInURL: - return true - default: - break - } - - switch method { - case .GET, .HEAD, .DELETE: - return true - default: - return false - } - } - - if let method = Method(rawValue: mutableURLRequest.HTTPMethod) where encodesParametersInURL(method) { - if let - URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false) - where !parameters.isEmpty - { - let percentEncodedQuery = (URLComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - URLComponents.percentEncodedQuery = percentEncodedQuery - mutableURLRequest.URL = URLComponents.URL - } - } else { - if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { - mutableURLRequest.setValue( - "application/x-www-form-urlencoded; charset=utf-8", - forHTTPHeaderField: "Content-Type" - ) - } - - mutableURLRequest.HTTPBody = query(parameters).dataUsingEncoding( - NSUTF8StringEncoding, - allowLossyConversion: false - ) - } - case .JSON: - do { - let options = NSJSONWritingOptions() - let data = try NSJSONSerialization.dataWithJSONObject(parameters, options: options) - - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .PropertyList(let format, let options): - do { - let data = try NSPropertyListSerialization.dataWithPropertyList( - parameters, - format: format, - options: options - ) - mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .Custom(let closure): - (mutableURLRequest, encodingError) = closure(mutableURLRequest, parameters) - } - - return (mutableURLRequest, encodingError) - } - - /** - Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - - - parameter key: The key of the query component. - - parameter value: The value of the query component. - - - returns: The percent-escaped, URL encoded query string components. - */ - public func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: AnyObject] { - for (nestedKey, value) in dictionary { - components += queryComponents("\(key)[\(nestedKey)]", value) - } - } else if let array = value as? [AnyObject] { - for value in array { - components += queryComponents("\(key)[]", value) - } - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /** - 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. - - - parameter string: The string to be percent-escaped. - - - returns: The percent-escaped string. - */ - public func escape(string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet - allowedCharacterSet.removeCharactersInString(generalDelimitersToEncode + subDelimitersToEncode) - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinense characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, OSX 10.10, *) { - escaped = string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = index.advancedBy(batchSize, limit: string.endIndex) - let range = Range(start: startIndex, end: endIndex) - - let substring = string.substringWithRange(range) - - escaped += substring.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? substring - - index = endIndex - } - } - - return escaped - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Request.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Request.swift deleted file mode 100644 index fa196a2..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Request.swift +++ /dev/null @@ -1,552 +0,0 @@ -// Request.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Responsible for sending a request and receiving the response and associated data from the server, as well as - managing its underlying `NSURLSessionTask`. -*/ -public class Request { - - // MARK: - Properties - - /// The delegate for the underlying task. - public let delegate: TaskDelegate - - /// The underlying task. - public var task: NSURLSessionTask { return delegate.task } - - /// The session belonging to the underlying task. - public let session: NSURLSession - - /// The request sent or to be sent to the server. - public var request: NSURLRequest? { return task.originalRequest } - - /// The response received from the server, if any. - public var response: NSHTTPURLResponse? { return task.response as? NSHTTPURLResponse } - - /// The progress of the request lifecycle. - public var progress: NSProgress { return delegate.progress } - - var startTime: CFAbsoluteTime? - var endTime: CFAbsoluteTime? - - // MARK: - Lifecycle - - init(session: NSURLSession, task: NSURLSessionTask) { - self.session = session - - switch task { - case is NSURLSessionUploadTask: - delegate = UploadTaskDelegate(task: task) - case is NSURLSessionDataTask: - delegate = DataTaskDelegate(task: task) - case is NSURLSessionDownloadTask: - delegate = DownloadTaskDelegate(task: task) - default: - delegate = TaskDelegate(task: task) - } - - delegate.queue.addOperationWithBlock { self.endTime = CFAbsoluteTimeGetCurrent() } - } - - // MARK: - Authentication - - /** - Associates an HTTP Basic credential with the request. - - - parameter user: The user. - - parameter password: The password. - - parameter persistence: The URL credential persistence. `.ForSession` by default. - - - returns: The request. - */ - public func authenticate( - user user: String, - password: String, - persistence: NSURLCredentialPersistence = .ForSession) - -> Self - { - let credential = NSURLCredential(user: user, password: password, persistence: persistence) - - return authenticate(usingCredential: credential) - } - - /** - Associates a specified credential with the request. - - - parameter credential: The credential. - - - returns: The request. - */ - public func authenticate(usingCredential credential: NSURLCredential) -> Self { - delegate.credential = credential - - return self - } - - // MARK: - Progress - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is written to or read - from the server. - - - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected - to write. - - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes - expected to read. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self { - if let uploadDelegate = delegate as? UploadTaskDelegate { - uploadDelegate.uploadProgress = closure - } else if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataProgress = closure - } else if let downloadDelegate = delegate as? DownloadTaskDelegate { - downloadDelegate.downloadProgress = closure - } - - return self - } - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - - This closure returns the bytes most recently received from the server, not including data from previous calls. - If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - also important to note that the `response` closure will be called with nil `responseData`. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func stream(closure: (NSData -> Void)? = nil) -> Self { - if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataStream = closure - } - - return self - } - - // MARK: - State - - /** - Resumes the request. - */ - public func resume() { - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task) - } - - /** - Suspends the request. - */ - public func suspend() { - task.suspend() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidSuspend, object: task) - } - - /** - Cancels the request. - */ - public func cancel() { - if let - downloadDelegate = delegate as? DownloadTaskDelegate, - downloadTask = downloadDelegate.downloadTask - { - downloadTask.cancelByProducingResumeData { data in - downloadDelegate.resumeData = data - } - } else { - task.cancel() - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidCancel, object: task) - } - - // MARK: - TaskDelegate - - /** - The task delegate is responsible for handling all delegate callbacks for the underlying task as well as - executing all operations attached to the serial operation queue upon task completion. - */ - public class TaskDelegate: NSObject { - - /// The serial operation queue used to execute all operations after the task completes. - public let queue: NSOperationQueue - - let task: NSURLSessionTask - let progress: NSProgress - - var data: NSData? { return nil } - var error: NSError? - - var initialResponseTime: CFAbsoluteTime? - var credential: NSURLCredential? - - init(task: NSURLSessionTask) { - self.task = task - self.progress = NSProgress(totalUnitCount: 0) - self.queue = { - let operationQueue = NSOperationQueue() - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.suspended = true - - if #available(OSX 10.10, *) { - operationQueue.qualityOfService = NSQualityOfService.Utility - } - - return operationQueue - }() - } - - deinit { - queue.cancelAllOperations() - queue.suspended = false - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)? - var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: ((NSURLRequest?) -> Void)) - { - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) - { - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .CancelAuthenticationChallenge - } else { - credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) - - if credential != nil { - disposition = .UseCredential - } - } - } - - completionHandler(disposition, credential) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) - { - var bodyStream: NSInputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - self.error = error - - if let - downloadDelegate = self as? DownloadTaskDelegate, - userInfo = error.userInfo as? [String: AnyObject], - resumeData = userInfo[NSURLSessionDownloadTaskResumeData] as? NSData - { - downloadDelegate.resumeData = resumeData - } - } - - queue.suspended = false - } - } - } - - // MARK: - DataTaskDelegate - - class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate { - var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask } - - private var totalBytesReceived: Int64 = 0 - private var mutableData: NSMutableData - override var data: NSData? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - private var expectedContentLength: Int64? - private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)? - private var dataStream: ((data: NSData) -> Void)? - - override init(task: NSURLSessionTask) { - mutableData = NSMutableData() - super.init(task: task) - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: (NSURLSessionResponseDisposition -> Void)) - { - var disposition: NSURLSessionResponseDisposition = .Allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) - { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data: data) - } else { - mutableData.appendData(data) - } - - totalBytesReceived += data.length - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - dataProgress?( - bytesReceived: Int64(data.length), - totalBytesReceived: totalBytesReceived, - totalBytesExpectedToReceive: totalBytesExpected - ) - } - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: ((NSCachedURLResponse?) -> Void)) - { - var cachedResponse: NSCachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - - /** - The textual representation used when written to an output stream, which includes the HTTP method and URL, as - well as the response status code if a response has been received. - */ - public var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.HTTPMethod { - components.append(HTTPMethod) - } - - if let URLString = request?.URL?.absoluteString { - components.append(URLString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joinWithSeparator(" ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - func cURLRepresentation() -> String { - var components = ["$ curl -i"] - - guard let - request = self.request, - URL = request.URL, - host = URL.host - else { - return "$ curl command could not be created" - } - - if let HTTPMethod = request.HTTPMethod where HTTPMethod != "GET" { - components.append("-X \(HTTPMethod)") - } - - if let credentialStorage = self.session.configuration.URLCredentialStorage { - let protectionSpace = NSURLProtectionSpace( - host: host, - port: URL.port?.integerValue ?? 0, - `protocol`: URL.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.HTTPShouldSetCookies { - if let - cookieStorage = session.configuration.HTTPCookieStorage, - cookies = cookieStorage.cookiesForURL(URL) where !cookies.isEmpty - { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" } - components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"") - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields { - switch field { - case "Cookie": - continue - default: - components.append("-H \"\(field): \(value)\"") - } - } - } - - if let additionalHeaders = session.configuration.HTTPAdditionalHeaders { - for (field, value) in additionalHeaders { - switch field { - case "Cookie": - continue - default: - components.append("-H \"\(field): \(value)\"") - } - } - } - - if let - HTTPBodyData = request.HTTPBody, - HTTPBody = String(data: HTTPBodyData, encoding: NSUTF8StringEncoding) - { - let escapedBody = HTTPBody.stringByReplacingOccurrencesOfString("\"", withString: "\\\"") - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(URL.absoluteString)\"") - - return components.joinWithSeparator(" \\\n\t") - } - - /// The textual representation used when written to an output stream, in the form of a cURL command. - public var debugDescription: String { - return cURLRepresentation() - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Response.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Response.swift deleted file mode 100644 index 153eda5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Response.swift +++ /dev/null @@ -1,95 +0,0 @@ -// Response.swift -// -// Copyright (c) 2014–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 Foundation - -/// Used to store all response data returned from a completed `Request`. -public struct Response { - /// The URL request sent to the server. - public let request: NSURLRequest? - - /// The server's response to the URL request. - public let response: NSHTTPURLResponse? - - /// The data returned by the server. - public let data: NSData? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the `Request`. - public let timeline: Timeline - - /** - Initializes the `Response` instance with the specified URL request, URL response, server data and response - serialization result. - - - parameter request: The URL request sent to the server. - - parameter response: The server's response to the URL request. - - parameter data: The data returned by the server. - - parameter result: The result of response serialization. - - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - - - returns: the new `Response` instance. - */ - public init( - request: NSURLRequest?, - response: NSHTTPURLResponse?, - data: NSData?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - CustomStringConvertible - -extension Response: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } -} - -// MARK: - CustomDebugStringConvertible - -extension Response: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data and the response serialization result. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.length ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joinWithSeparator("\n") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index e636072..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,364 +0,0 @@ -// ResponseSerialization.swift -// -// Copyright (c) 2014–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 Foundation - -// MARK: ResponseSerializer - -/** - The type in which all response serializers must conform to in order to serialize a response. -*/ -public protocol ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializerType`. - typealias SerializedObject - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - typealias ErrorObject: ErrorType - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get } -} - -// MARK: - - -/** - A generic `ResponseSerializerType` used to serialize a request, response, and data into a serialized object. -*/ -public struct ResponseSerializer: ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializer`. - public typealias SerializedObject = Value - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - public typealias ErrorObject = Error - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result - - /** - Initializes the `ResponseSerializer` instance with the given serialize response closure. - - - parameter serializeResponse: The closure used to serialize the response. - - - returns: The new generic response serializer instance. - */ - public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Default - -extension Request { - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Void) - -> Self - { - delegate.queue.addOperationWithBlock { - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, self.delegate.data, self.delegate.error) - } - } - - return self - } - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter responseSerializer: The response serializer responsible for serializing the request, response, - and data. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - responseSerializer: T, - completionHandler: Response -> Void) - -> Self - { - delegate.queue.addOperationWithBlock { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - let timeline = Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - - let response = Response( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: timeline - ) - - dispatch_async(queue ?? dispatch_get_main_queue()) { completionHandler(response) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - - /** - Creates a response serializer that returns the associated data as-is. - - - returns: A data response serializer. - */ - public static func dataResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSData()) } - - guard let validData = data else { - let failureReason = "Data could not be serialized. Input data was nil." - let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - return .Success(validData) - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func responseData(completionHandler: Response -> Void) -> Self { - return response(responseSerializer: Request.dataResponseSerializer(), completionHandler: completionHandler) - } -} - -// MARK: - String - -extension Request { - - /** - Creates a response serializer that returns a string initialized from the response data with the specified - string encoding. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - response, falling back to the default HTTP default character set, ISO-8859-1. - - - returns: A string response serializer. - */ - public static func stringResponseSerializer( - var encoding encoding: NSStringEncoding? = nil) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success("") } - - guard let validData = data else { - let failureReason = "String could not be serialized. Input data was nil." - let error = Error.errorWithCode(.StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - if let encodingName = response?.textEncodingName where encoding == nil { - encoding = CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName) - ) - } - - let actualEncoding = encoding ?? NSISOLatin1StringEncoding - - if let string = String(data: validData, encoding: actualEncoding) { - return .Success(string) - } else { - let failureReason = "String could not be serialized with encoding: \(actualEncoding)" - let error = Error.errorWithCode(.StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - server response, falling back to the default HTTP default character set, - ISO-8859-1. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseString( - encoding encoding: NSStringEncoding? = nil, - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - - /** - Creates a response serializer that returns a JSON object constructed from the response data using - `NSJSONSerialization` with the specified reading options. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - - returns: A JSON object response serializer. - */ - public static func JSONResponseSerializer( - options options: NSJSONReadingOptions = .AllowFragments) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "JSON could not be serialized. Input data was nil or zero length." - let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let JSON = try NSJSONSerialization.JSONObjectWithData(validData, options: options) - return .Success(JSON) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseJSON( - options options: NSJSONReadingOptions = .AllowFragments, - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.JSONResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - - /** - Creates a response serializer that returns an object constructed from the response data using - `NSPropertyListSerialization` with the specified reading options. - - - parameter options: The property list reading options. `NSPropertyListReadOptions()` by default. - - - returns: A property list object response serializer. - */ - public static func propertyListResponseSerializer( - options options: NSPropertyListReadOptions = NSPropertyListReadOptions()) - -> ResponseSerializer - { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "Property list could not be serialized. Input data was nil or zero length." - let error = Error.errorWithCode(.PropertyListSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let plist = try NSPropertyListSerialization.propertyListWithData(validData, options: options, format: nil) - return .Success(plist) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The property list reading options. `0` by default. - - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 3 - arguments: the URL request, the URL response, the server data and the result - produced while creating the property list. - - - returns: The request. - */ - public func responsePropertyList( - options options: NSPropertyListReadOptions = NSPropertyListReadOptions(), - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Result.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Result.swift deleted file mode 100644 index a8557ca..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Result.swift +++ /dev/null @@ -1,101 +0,0 @@ -// Result.swift -// -// Copyright (c) 2014–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 Foundation - -/** - Used to represent whether a request was successful or encountered an error. - - - Success: The request and all post processing operations were successful resulting in the serialization of the - provided associated value. - - Failure: The request encountered an error resulting in a failure. The associated values are the original data - provided by the server as well as the error that caused the failure. -*/ -public enum Result { - case Success(Value) - case Failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .Success: - return true - case .Failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .Success(let value): - return value - case .Failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .Success: - return nil - case .Failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .Success: - return "SUCCESS" - case .Failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .Success(let value): - return "SUCCESS: \(value)" - case .Failure(let error): - return "FAILURE: \(error)" - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 07cd848..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,302 +0,0 @@ -// ServerTrustPolicy.swift -// -// Copyright (c) 2014–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 Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -public class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - public let policies: [String: ServerTrustPolicy] - - /** - Initializes the `ServerTrustPolicyManager` instance with the given policies. - - Since different servers and web services can have different leaf certificates, intermediate and even root - certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - pinning for host3 and disabling evaluation for host4. - - - parameter policies: A dictionary of all policies mapped to a particular host. - - - returns: The new `ServerTrustPolicyManager` instance. - */ - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /** - Returns the `ServerTrustPolicy` for the given host if applicable. - - By default, this method will return the policy that perfectly matches the given host. Subclasses could override - this method and implement more complex mapping implementations such as wildcards. - - - parameter host: The host to use when searching for a matching policy. - - - returns: The server trust policy for the given host if found. - */ - public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension NSURLSession { - private struct AssociatedKeys { - static var ManagerKey = "NSURLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/** - The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when - connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust - with a given set of criteria to determine whether the server trust is valid and the connection should be made. - - Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other - vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged - to route all communication over an HTTPS connection with pinning enabled. - - - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to - validate the host provided by the challenge. Applications are encouraged to always - validate the host in production environments to guarantee the validity of the server's - certificate chain. - - - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is - considered valid if one of the pinned certificates match one of the server certificates. - By validating both the certificate chain and host, certificate pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered - valid if one of the pinned public keys match one of the server certificate public keys. - By validating both the certificate chain and host, public key pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. - - - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust. -*/ -public enum ServerTrustPolicy { - case PerformDefaultEvaluation(validateHost: Bool) - case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case DisableEvaluation - case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool) - - // MARK: - Bundle Location - - /** - Returns all certificates within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `.cer` files. - - - returns: All certificates within the given bundle. - */ - public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil) - }.flatten()) - - for path in paths { - if let - certificateData = NSData(contentsOfFile: path), - certificate = SecCertificateCreateWithData(nil, certificateData) - { - certificates.append(certificate) - } - } - - return certificates - } - - /** - Returns all public keys within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `*.cer` files. - - - returns: All public keys within the given bundle. - */ - public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificatesInBundle(bundle) { - if let publicKey = publicKeyForCertificate(certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /** - Evaluates whether the server trust is valid for the given host. - - - parameter serverTrust: The server trust to evaluate. - - parameter host: The host of the challenge protection space. - - - returns: Whether the server trust is valid. - */ - public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .PerformDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateDataForTrust(serverTrust) - let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData.isEqualToData(pinnedCertificateData) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .DisableEvaluation: - serverTrustIsValid = true - case let .CustomEvaluation(closure): - serverTrustIsValid = closure(serverTrust: serverTrust, host: host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType(kSecTrustResultInvalid) - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType(kSecTrustResultUnspecified) - let proceed = SecTrustResultType(kSecTrustResultProceed) - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateDataForTrust(trust: SecTrust) -> [NSData] { - var certificates: [SecCertificate] = [] - - for index in 0.. [NSData] { - return certificates.map { SecCertificateCopyData($0) as NSData } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust where trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Stream.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Stream.swift deleted file mode 100644 index 905e522..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Stream.swift +++ /dev/null @@ -1,180 +0,0 @@ -// Stream.swift -// -// Copyright (c) 2014–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 Foundation - -#if !os(watchOS) - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager { - private enum Streamable { - case Stream(String, Int) - case NetService(NSNetService) - } - - private func stream(streamable: Streamable) -> Request { - var streamTask: NSURLSessionStreamTask! - - switch streamable { - case .Stream(let hostName, let port): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithHostName(hostName, port: port) - } - case .NetService(let netService): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithNetService(netService) - } - } - - let request = Request(session: session, task: streamTask) - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - /** - Creates a request for bidirectional streaming with the given hostname and port. - - - parameter hostName: The hostname of the server to connect to. - - parameter port: The port of the server to connect to. - - :returns: The created stream request. - */ - public func stream(hostName hostName: String, port: Int) -> Request { - return stream(.Stream(hostName, port)) - } - - /** - Creates a request for bidirectional streaming with the given `NSNetService`. - - - parameter netService: The net service used to identify the endpoint. - - - returns: The created stream request. - */ - public func stream(netService netService: NSNetService) -> Request { - return stream(.NetService(netService)) - } -} - -// MARK: - - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager.SessionDelegate: NSURLSessionStreamDelegate { - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`. - public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`. - public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`. - public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`. - public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - // MARK: Delegate Methods - - /** - Tells the delegate that the read side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /** - Tells the delegate that the write side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /** - Tells the delegate that the system has determined that a better route to the host is available. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /** - Tells the delegate that the stream task has been completed and provides the unopened stream objects. - - - parameter session: The session. - - parameter streamTask: The stream task. - - parameter inputStream: The new input stream. - - parameter outputStream: The new output stream. - */ - public func URLSession( - session: NSURLSession, - streamTask: NSURLSessionStreamTask, - didBecomeInputStream inputStream: NSInputStream, - outputStream: NSOutputStream) - { - streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Timeline.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Timeline.swift deleted file mode 100644 index 0b7ab5d..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,123 +0,0 @@ -// Timeline.swift -// -// Copyright (c) 2014–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 Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: NSTimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: NSTimeInterval - - /** - Creates a new `Timeline` instance with the specified request times. - - - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - Defaults to `0.0`. - - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - to `0.0`. - - - returns: The new `Timeline` instance. - */ - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) - { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - let timings = [ - "\"Latency\": \(latency) secs", - "\"Request Duration\": \(requestDuration) secs", - "\"Serialization Duration\": \(serializationDuration) secs", - "\"Total Duration\": \(totalDuration) secs" - ] - - return "Timeline: { \(timings.joinWithSeparator(", ")) }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let timings = [ - "\"Request Start Time\": \(requestStartTime)", - "\"Initial Response Time\": \(initialResponseTime)", - "\"Request Completed Time\": \(requestCompletedTime)", - "\"Serialization Completed Time\": \(serializationCompletedTime)", - "\"Latency\": \(latency) secs", - "\"Request Duration\": \(requestDuration) secs", - "\"Serialization Duration\": \(serializationDuration) secs", - "\"Total Duration\": \(totalDuration) secs" - ] - - return "Timeline: { \(timings.joinWithSeparator(", ")) }" - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Upload.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Upload.swift deleted file mode 100644 index 78b3072..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Upload.swift +++ /dev/null @@ -1,374 +0,0 @@ -// Upload.swift -// -// Copyright (c) 2014–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 Foundation - -extension Manager { - private enum Uploadable { - case Data(NSURLRequest, NSData) - case File(NSURLRequest, NSURL) - case Stream(NSURLRequest, NSInputStream) - } - - private func upload(uploadable: Uploadable) -> Request { - var uploadTask: NSURLSessionUploadTask! - var HTTPBodyStream: NSInputStream? - - switch uploadable { - case .Data(let request, let data): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromData: data) - } - case .File(let request, let fileURL): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL) - } - case .Stream(let request, let stream): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithStreamedRequest(request) - } - - HTTPBodyStream = stream - } - - let request = Request(session: session, task: uploadTask) - - if HTTPBodyStream != nil { - request.delegate.taskNeedNewBodyStream = { _, _ in - return HTTPBodyStream - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: File - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return upload(.File(URLRequest.URLRequest, file)) - } - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - return upload(mutableURLRequest, file: file) - } - - // MARK: Data - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return upload(.Data(URLRequest.URLRequest, data)) - } - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, data: data) - } - - // MARK: Stream - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return upload(.Stream(URLRequest.URLRequest, stream)) - } - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, stream: stream) - } - - // MARK: MultipartFormData - - /// Default memory threshold used when encoding `MultipartFormData`. - public static let MultipartFormDataEncodingMemoryThreshold: UInt64 = 10 * 1024 * 1024 - - /** - Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - associated values. - - - Success: Represents a successful `MultipartFormData` encoding and contains the new `Request` along with - streaming information. - - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - error. - */ - public enum MultipartFormDataEncodingResult { - case Success(request: Request, streamingFromDisk: Bool, streamFileURL: NSURL?) - case Failure(ErrorType) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) - { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload( - mutableURLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) - { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { - let formData = MultipartFormData() - multipartFormData(formData) - - let URLRequestWithContentType = URLRequest.URLRequest - URLRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - do { - let data = try formData.encode() - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, data: data), - streamingFromDisk: false, - streamFileURL: nil - ) - - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } else { - let fileManager = NSFileManager.defaultManager() - let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.manager/multipart.form.data") - let fileName = NSUUID().UUIDString - let fileURL = directoryURL.URLByAppendingPathComponent(fileName) - - do { - try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil) - try formData.writeEncodedDataToDisk(fileURL) - - dispatch_async(dispatch_get_main_queue()) { - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, file: fileURL), - streamingFromDisk: true, - streamFileURL: fileURL - ) - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } - } - } -} - -// MARK: - - -extension Request { - - // MARK: - UploadTaskDelegate - - class UploadTaskDelegate: DataTaskDelegate { - var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask } - var uploadProgress: ((Int64, Int64, Int64) -> Void)! - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - progress.totalUnitCount = totalBytesExpectedToSend - progress.completedUnitCount = totalBytesSent - - uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend) - } - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Validation.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Validation.swift deleted file mode 100644 index 71d21e1..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,189 +0,0 @@ -// Validation.swift -// -// Copyright (c) 2014–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 Foundation - -extension Request { - - /** - Used to represent whether validation was successful or encountered an error resulting in a failure. - - - Success: The validation was successful. - - Failure: The validation failed encountering the provided error. - */ - public enum ValidationResult { - case Success - case Failure(NSError) - } - - /** - A closure used to validate a request that takes a URL request and URL response, and returns whether the - request was valid. - */ - public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult - - /** - Validates the request, using the specified closure. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter validation: A closure to validate the request. - - - returns: The request. - */ - public func validate(validation: Validation) -> Self { - delegate.queue.addOperationWithBlock { - if let - response = self.response where self.delegate.error == nil, - case let .Failure(error) = validation(self.request, response) - { - self.delegate.error = error - } - } - - return self - } - - // MARK: - Status Code - - /** - Validates that the response has a status code in the specified range. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter range: The range of acceptable status codes. - - - returns: The request. - */ - public func validate(statusCode acceptableStatusCode: S) -> Self { - return validate { _, response in - if acceptableStatusCode.contains(response.statusCode) { - return .Success - } else { - let failureReason = "Response status code was unacceptable: \(response.statusCode)" - return .Failure(Error.errorWithCode(.StatusCodeValidationFailed, failureReason: failureReason)) - } - } - } - - // MARK: - Content-Type - - private struct MIMEType { - let type: String - let subtype: String - - init?(_ string: String) { - let components: [String] = { - let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) - let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex) - return split.componentsSeparatedByString("/") - }() - - if let - type = components.first, - subtype = components.last - { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(MIME: MIMEType) -> Bool { - switch (type, subtype) { - case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - /** - Validates that the response has a content type in the specified array. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - - - returns: The request. - */ - public func validate(contentType acceptableContentTypes: S) -> Self { - return validate { _, response in - guard let validData = self.delegate.data where validData.length > 0 else { return .Success } - - if let - responseContentType = response.MIMEType, - responseMIMEType = MIMEType(responseContentType) - { - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) { - return .Success - } - } - } else { - for contentType in acceptableContentTypes { - if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" { - return .Success - } - } - } - - let failureReason: String - - if let responseContentType = response.MIMEType { - failureReason = ( - "Response content type \"\(responseContentType)\" does not match any acceptable " + - "content types: \(acceptableContentTypes)" - ) - } else { - failureReason = "Response content type was missing and acceptable content type does not match \"*/*\"" - } - - return .Failure(Error.errorWithCode(.ContentTypeValidationFailed, failureReason: failureReason)) - } - } - - // MARK: - Automatic - - /** - Validates that the response has a status code in the default acceptable range of 200...299, and that the content - type matches any specified in the Accept HTTP header field. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - returns: The request. - */ - public func validate() -> Self { - let acceptableStatusCodes: Range = 200..<300 - let acceptableContentTypes: [String] = { - if let accept = request?.valueForHTTPHeaderField("Accept") { - return accept.componentsSeparatedByString(",") - } - - return ["*/*"] - }() - - return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift deleted file mode 100644 index c616174..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/AuthenticationTests.swift +++ /dev/null @@ -1,193 +0,0 @@ -// AuthenticationTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class AuthenticationTestCase: BaseTestCase { - let user = "user" - let password = "password" - var URLString = "" - - override func setUp() { - super.setUp() - - let credentialStorage = NSURLCredentialStorage.sharedCredentialStorage() - - for (protectionSpace, credentials) in credentialStorage.allCredentials { - for (_, credential) in credentials { - credentialStorage.removeCredential(credential, forProtectionSpace: protectionSpace) - } - } - } -} - -// MARK: - - -class BasicAuthenticationTestCase: AuthenticationTestCase { - override func setUp() { - super.setUp() - URLString = "https://httpbin.org/basic-auth/\(user)/\(password)" - } - - func testHTTPBasicAuthenticationWithInvalidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 401") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: "invalid", password: "credentials") - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNil(response, "response should be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, -999, "error should be NSURLErrorDomain Code -999 'cancelled'") - } - } - - func testHTTPBasicAuthenticationWithValidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 200") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: user, password: password) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertEqual(response?.statusCode ?? 0, 200, "response status code should be 200") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } -} - -// MARK: - - -class HTTPDigestAuthenticationTestCase: AuthenticationTestCase { - let qop = "auth" - - override func setUp() { - super.setUp() - URLString = "https://httpbin.org/digest-auth/\(qop)/\(user)/\(password)" - } - - func testHTTPDigestAuthenticationWithInvalidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 401") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: "invalid", password: "credentials") - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNil(response, "response should be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, -999, "error should be NSURLErrorDomain Code -999 'cancelled'") - } - } - - func testHTTPDigestAuthenticationWithValidCredentials() { - // Given - let expectation = expectationWithDescription("\(URLString) 200") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .authenticate(user: user, password: password) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertEqual(response?.statusCode ?? 0, 200, "response status code should be 200") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift deleted file mode 100644 index a9fe24c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift +++ /dev/null @@ -1,34 +0,0 @@ -// BaseTestCase.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class BaseTestCase: XCTestCase { - let timeout: NSTimeInterval = 30.0 - - func URLForResource(fileName: String, withExtension: String) -> NSURL { - let bundle = NSBundle(forClass: BaseTestCase.self) - return bundle.URLForResource(fileName, withExtension: withExtension)! - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift deleted file mode 100644 index 0d3fe3c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/CacheTests.swift +++ /dev/null @@ -1,351 +0,0 @@ -// CacheTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -/** - This test case tests all implemented cache policies against various `Cache-Control` header values. These tests - are meant to cover the main cases of `Cache-Control` header usage, but are no means exhaustive. - - These tests work as follows: - - - Set up an `NSURLCache` - - Set up an `Alamofire.Manager` - - Execute requests for all `Cache-Control` headers values to prime the `NSURLCache` with cached responses - - Start up a new test - - Execute another round of the same requests with a given `NSURLRequestCachePolicy` - - Verify whether the response came from the cache or from the network - - This is determined by whether the cached response timestamp matches the new response timestamp - - An important thing to note is the difference in behavior between iOS and OS X. On iOS, a response with - a `Cache-Control` header value of `no-store` is still written into the `NSURLCache` where on OS X, it is not. - The different tests below reflect and demonstrate this behavior. - - For information about `Cache-Control` HTTP headers, please refer to RFC 2616 - Section 14.9. -*/ -class CacheTestCase: BaseTestCase { - - // MARK: - - - struct CacheControl { - static let Public = "public" - static let Private = "private" - static let MaxAgeNonExpired = "max-age=3600" - static let MaxAgeExpired = "max-age=0" - static let NoCache = "no-cache" - static let NoStore = "no-store" - - static var allValues: [String] { - return [ - CacheControl.Public, - CacheControl.Private, - CacheControl.MaxAgeNonExpired, - CacheControl.MaxAgeExpired, - CacheControl.NoCache, - CacheControl.NoStore - ] - } - } - - // MARK: - Properties - - var URLCache: NSURLCache! - var manager: Manager! - - let URLString = "https://httpbin.org/response-headers" - let requestTimeout: NSTimeInterval = 30 - - var requests: [String: NSURLRequest] = [:] - var timestamps: [String: String] = [:] - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - URLCache = { - let capacity = 50 * 1024 * 1024 // MBs - let URLCache = NSURLCache(memoryCapacity: capacity, diskCapacity: capacity, diskPath: nil) - - return URLCache - }() - - manager = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - configuration.requestCachePolicy = .UseProtocolCachePolicy - configuration.URLCache = self.URLCache - - return configuration - }() - - let manager = Manager(configuration: configuration) - - return manager - }() - - primeCachedResponses() - } - - override func tearDown() { - super.tearDown() - - URLCache.removeAllCachedResponses() - } - - // MARK: - Cache Priming Methods - - /** - Executes a request for all `Cache-Control` header values to load the response into the `URLCache`. - - This implementation leverages dispatch groups to execute all the requests as well as wait an additional - second before returning. This ensures the cache contains responses for all requests that are at least - one second old. This allows the tests to distinguish whether the subsequent responses come from the cache - or the network based on the timestamp of the response. - */ - func primeCachedResponses() { - let dispatchGroup = dispatch_group_create() - let highPriorityDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) - - for cacheControl in CacheControl.allValues { - dispatch_group_enter(dispatchGroup) - - let request = startRequest( - cacheControl: cacheControl, - queue: highPriorityDispatchQueue, - completion: { _, response in - let timestamp = response!.allHeaderFields["Date"] as! String - self.timestamps[cacheControl] = timestamp - - dispatch_group_leave(dispatchGroup) - } - ) - - requests[cacheControl] = request - } - - // Wait for all requests to complete - dispatch_group_wait(dispatchGroup, dispatch_time(DISPATCH_TIME_NOW, Int64(10.0 * Float(NSEC_PER_SEC)))) - - // Pause for 1 additional second to ensure all timestamps will be different - dispatch_group_enter(dispatchGroup) - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(1.0 * Float(NSEC_PER_SEC))), highPriorityDispatchQueue) { - dispatch_group_leave(dispatchGroup) - } - - // Wait for our 1 second pause to complete - dispatch_group_wait(dispatchGroup, dispatch_time(DISPATCH_TIME_NOW, Int64(10.0 * Float(NSEC_PER_SEC)))) - } - - // MARK: - Request Helper Methods - - func URLRequest(cacheControl cacheControl: String, cachePolicy: NSURLRequestCachePolicy) -> NSURLRequest { - let parameters = ["Cache-Control": cacheControl] - let URL = NSURL(string: URLString)! - let URLRequest = NSMutableURLRequest(URL: URL, cachePolicy: cachePolicy, timeoutInterval: requestTimeout) - URLRequest.HTTPMethod = Method.GET.rawValue - - return ParameterEncoding.URL.encode(URLRequest, parameters: parameters).0 - } - - func startRequest( - cacheControl cacheControl: String, - cachePolicy: NSURLRequestCachePolicy = .UseProtocolCachePolicy, - queue: dispatch_queue_t = dispatch_get_main_queue(), - completion: (NSURLRequest?, NSHTTPURLResponse?) -> Void) - -> NSURLRequest - { - let urlRequest = URLRequest(cacheControl: cacheControl, cachePolicy: cachePolicy) - - let request = manager.request(urlRequest) - request.response( - queue: queue, - completionHandler: { _, response, data, _ in - completion(request.request, response) - } - ) - - return urlRequest - } - - // MARK: - Test Execution and Verification - - func executeTest( - cachePolicy cachePolicy: NSURLRequestCachePolicy, - cacheControl: String, - shouldReturnCachedResponse: Bool) - { - // Given - let expectation = expectationWithDescription("GET request to httpbin") - var response: NSHTTPURLResponse? - - // When - startRequest(cacheControl: cacheControl, cachePolicy: cachePolicy) { _, responseResponse in - response = responseResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - verifyResponse(response, forCacheControl: cacheControl, isCachedResponse: shouldReturnCachedResponse) - } - - func verifyResponse(response: NSHTTPURLResponse?, forCacheControl cacheControl: String, isCachedResponse: Bool) { - guard let cachedResponseTimestamp = timestamps[cacheControl] else { - XCTFail("cached response timestamp should not be nil") - return - } - - if let - response = response, - timestamp = response.allHeaderFields["Date"] as? String - { - if isCachedResponse { - XCTAssertEqual(timestamp, cachedResponseTimestamp, "timestamps should be equal") - } else { - XCTAssertNotEqual(timestamp, cachedResponseTimestamp, "timestamps should not be equal") - } - } else { - XCTFail("response should not be nil") - } - } - - // MARK: - Cache Helper Methods - - private func isCachedResponseForNoStoreHeaderExpected() -> Bool { - var storedInCache = false - - #if os(iOS) - let operatingSystemVersion = NSOperatingSystemVersion(majorVersion: 8, minorVersion: 3, patchVersion: 0) - - if !NSProcessInfo().isOperatingSystemAtLeastVersion(operatingSystemVersion) { - storedInCache = true - } - #endif - - return storedInCache - } - - // MARK: - Tests - - func testURLCacheContainsCachedResponsesForAllRequests() { - // Given - let publicRequest = requests[CacheControl.Public]! - let privateRequest = requests[CacheControl.Private]! - let maxAgeNonExpiredRequest = requests[CacheControl.MaxAgeNonExpired]! - let maxAgeExpiredRequest = requests[CacheControl.MaxAgeExpired]! - let noCacheRequest = requests[CacheControl.NoCache]! - let noStoreRequest = requests[CacheControl.NoStore]! - - // When - let publicResponse = URLCache.cachedResponseForRequest(publicRequest) - let privateResponse = URLCache.cachedResponseForRequest(privateRequest) - let maxAgeNonExpiredResponse = URLCache.cachedResponseForRequest(maxAgeNonExpiredRequest) - let maxAgeExpiredResponse = URLCache.cachedResponseForRequest(maxAgeExpiredRequest) - let noCacheResponse = URLCache.cachedResponseForRequest(noCacheRequest) - let noStoreResponse = URLCache.cachedResponseForRequest(noStoreRequest) - - // Then - XCTAssertNotNil(publicResponse, "\(CacheControl.Public) response should not be nil") - XCTAssertNotNil(privateResponse, "\(CacheControl.Private) response should not be nil") - XCTAssertNotNil(maxAgeNonExpiredResponse, "\(CacheControl.MaxAgeNonExpired) response should not be nil") - XCTAssertNotNil(maxAgeExpiredResponse, "\(CacheControl.MaxAgeExpired) response should not be nil") - XCTAssertNotNil(noCacheResponse, "\(CacheControl.NoCache) response should not be nil") - - if isCachedResponseForNoStoreHeaderExpected() { - XCTAssertNotNil(noStoreResponse, "\(CacheControl.NoStore) response should not be nil") - } else { - XCTAssertNil(noStoreResponse, "\(CacheControl.NoStore) response should be nil") - } - } - - func testDefaultCachePolicy() { - let cachePolicy: NSURLRequestCachePolicy = .UseProtocolCachePolicy - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - - func testIgnoreLocalCacheDataPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReloadIgnoringLocalCacheData - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: false) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - - func testUseLocalCacheDataIfExistsOtherwiseLoadFromNetworkPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReturnCacheDataElseLoad - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: true) - - if isCachedResponseForNoStoreHeaderExpected() { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: true) - } else { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: false) - } - } - - func testUseLocalCacheDataAndDontLoadFromNetworkPolicy() { - let cachePolicy: NSURLRequestCachePolicy = .ReturnCacheDataDontLoad - - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Public, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.Private, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeNonExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.MaxAgeExpired, shouldReturnCachedResponse: true) - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoCache, shouldReturnCachedResponse: true) - - if isCachedResponseForNoStoreHeaderExpected() { - executeTest(cachePolicy: cachePolicy, cacheControl: CacheControl.NoStore, shouldReturnCachedResponse: true) - } else { - // Given - let expectation = expectationWithDescription("GET request to httpbin") - var response: NSHTTPURLResponse? - - // When - startRequest(cacheControl: CacheControl.NoStore, cachePolicy: cachePolicy) { _, responseResponse in - response = responseResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(response, "response should be nil") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift deleted file mode 100644 index 2340c0e..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/DownloadTests.swift +++ /dev/null @@ -1,459 +0,0 @@ -// DownloadTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class DownloadInitializationTestCase: BaseTestCase { - let searchPathDirectory: NSSearchPathDirectory = .CachesDirectory - let searchPathDomain: NSSearchPathDomainMask = .UserDomainMask - - func testDownloadClassMethodWithMethodURLAndDestination() { - // Given - let URLString = "https://httpbin.org/" - let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) - - // When - let request = Alamofire.download(.GET, URLString, destination: destination) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should be GET") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testDownloadClassMethodWithMethodURLHeadersAndDestination() { - // Given - let URLString = "https://httpbin.org/" - let destination = Request.suggestedDownloadDestination(directory: searchPathDirectory, domain: searchPathDomain) - - // When - let request = Alamofire.download(.GET, URLString, headers: ["Authorization": "123456"], destination: destination) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should be GET") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class DownloadResponseTestCase: BaseTestCase { - let searchPathDirectory: NSSearchPathDirectory = .CachesDirectory - let searchPathDomain: NSSearchPathDomainMask = .UserDomainMask - - let cachesURL: NSURL = { - let cachesDirectory = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true).first! - let cachesURL = NSURL(fileURLWithPath: cachesDirectory, isDirectory: true) - - return cachesURL - }() - - var randomCachesFileURL: NSURL { - return cachesURL.URLByAppendingPathComponent("\(NSUUID().UUIDString).json") - } - - func testDownloadRequest() { - // Given - let numberOfLines = 100 - let URLString = "https://httpbin.org/stream/\(numberOfLines)" - - let destination = Alamofire.Request.suggestedDownloadDestination( - directory: searchPathDirectory, - domain: searchPathDomain - ) - - let expectation = expectationWithDescription("Download request should download data to file: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var error: NSError? - - // When - Alamofire.download(.GET, URLString, destination: destination) - .response { responseRequest, responseResponse, _, responseError in - request = responseRequest - response = responseResponse - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNil(error, "error should be nil") - - let fileManager = NSFileManager.defaultManager() - let directory = fileManager.URLsForDirectory(searchPathDirectory, inDomains: self.searchPathDomain)[0] - - do { - let contents = try fileManager.contentsOfDirectoryAtURL( - directory, - includingPropertiesForKeys: nil, - options: .SkipsHiddenFiles - ) - - #if os(iOS) || os(tvOS) - let suggestedFilename = "\(numberOfLines)" - #elseif os(OSX) - let suggestedFilename = "\(numberOfLines).json" - #endif - - let predicate = NSPredicate(format: "lastPathComponent = '\(suggestedFilename)'") - let filteredContents = (contents as NSArray).filteredArrayUsingPredicate(predicate) - XCTAssertEqual(filteredContents.count, 1, "should have one file in Documents") - - if let file = filteredContents.first as? NSURL { - XCTAssertEqual( - file.lastPathComponent ?? "", - "\(suggestedFilename)", - "filename should be \(suggestedFilename)" - ) - - if let data = NSData(contentsOfURL: file) { - XCTAssertGreaterThan(data.length, 0, "data length should be non-zero") - } else { - XCTFail("data should exist for contents of URL") - } - - do { - try fileManager.removeItemAtURL(file) - } catch { - XCTFail("file manager should remove item at URL: \(file)") - } - } else { - XCTFail("file should not be nil") - } - } catch { - XCTFail("contents should not be nil") - } - } - - func testDownloadRequestWithProgress() { - // Given - let randomBytes = 4 * 1024 * 1024 - let URLString = "https://httpbin.org/bytes/\(randomBytes)" - - let fileManager = NSFileManager.defaultManager() - let directory = fileManager.URLsForDirectory(searchPathDirectory, inDomains: self.searchPathDomain)[0] - let filename = "test_download_data" - let fileURL = directory.URLByAppendingPathComponent(filename) - - let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let download = Alamofire.download(.GET, URLString) { _, _ in - return fileURL - } - download.progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - let bytes = (bytes: bytesRead, totalBytes: totalBytesRead, totalBytesExpected: totalBytesExpectedToRead) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: download.progress.completedUnitCount, - totalUnitCount: download.progress.totalUnitCount - ) - progressValues.append(progress) - } - download.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response should not be nil") - XCTAssertNil(responseData, "response data should be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0..? - - // When - let download = Alamofire.download(.GET, URLString, destination: destination) - download.progress { _, _, _ in - download.cancel() - } - download.responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - XCTAssertNotNil(response.result.error, "result error should not be nil") - } else { - XCTFail("response should not be nil") - } - - XCTAssertNotNil(download.resumeData, "resume data should not be nil") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Info.plist b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift deleted file mode 100644 index dbd165b..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ManagerTests.swift +++ /dev/null @@ -1,280 +0,0 @@ -// ManagerTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import XCTest - -class ManagerTestCase: BaseTestCase { - - // MARK: Initialization Tests - - func testInitializerWithDefaultArguments() { - // Given, When - let manager = Manager() - - // Then - XCTAssertNotNil(manager.session.delegate, "session delegate should not be nil") - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should be nil") - } - - func testInitializerWithSpecifiedArguments() { - // Given - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - let delegate = Manager.SessionDelegate() - let serverTrustPolicyManager = ServerTrustPolicyManager(policies: [:]) - - // When - let manager = Manager( - configuration: configuration, - delegate: delegate, - serverTrustPolicyManager: serverTrustPolicyManager - ) - - // Then - XCTAssertNotNil(manager.session.delegate, "session delegate should not be nil") - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNotNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should not be nil") - } - - func testThatFailableInitializerSucceedsWithDefaultArguments() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - if let manager = manager { - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should be nil") - } else { - XCTFail("manager should not be nil") - } - } - - func testThatFailableInitializerSucceedsWithSpecifiedArguments() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - }() - - let serverTrustPolicyManager = ServerTrustPolicyManager(policies: [:]) - - // When - let manager = Manager(session: session, delegate: delegate, serverTrustPolicyManager: serverTrustPolicyManager) - - // Then - if let manager = manager { - XCTAssertTrue(manager.delegate === manager.session.delegate, "manager delegate should equal session delegate") - XCTAssertNotNil(manager.session.serverTrustPolicyManager, "session server trust policy manager should not be nil") - } else { - XCTFail("manager should not be nil") - } - } - - func testThatFailableInitializerFailsWithWhenDelegateDoesNotEqualSessionDelegate() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: Manager.SessionDelegate(), delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - XCTAssertNil(manager, "manager should be nil") - } - - func testThatFailableInitializerFailsWhenSessionDelegateIsNil() { - // Given - let delegate = Manager.SessionDelegate() - let session: NSURLSession = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - return NSURLSession(configuration: configuration, delegate: nil, delegateQueue: nil) - }() - - // When - let manager = Manager(session: session, delegate: delegate) - - // Then - XCTAssertNil(manager, "manager should be nil") - } - - // MARK: Start Requests Immediately Tests - - func testSetStartRequestsImmediatelyToFalseAndResumeRequest() { - // Given - let manager = Alamofire.Manager() - manager.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - let expectation = expectationWithDescription("\(URL)") - - var response: NSHTTPURLResponse? - - // When - manager.request(URLRequest) - .response { _, responseResponse, _, _ in - response = responseResponse - expectation.fulfill() - } - .resume() - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response, "response should not be nil") - XCTAssertTrue(response?.statusCode == 200, "response status code should be 200") - } - - // MARK: Deinitialization Tests - - func testReleasingManagerWithPendingRequestDeinitializesSuccessfully() { - // Given - var manager: Manager? = Alamofire.Manager() - manager?.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - // When - let request = manager?.request(URLRequest) - manager = nil - - // Then - XCTAssertTrue(request?.task.state == .Suspended, "request task state should be '.Suspended'") - XCTAssertNil(manager, "manager should be nil") - } - - func testReleasingManagerWithPendingCanceledRequestDeinitializesSuccessfully() { - // Given - var manager: Manager? = Alamofire.Manager() - manager!.startRequestsImmediately = false - - let URL = NSURL(string: "https://httpbin.org/get")! - let URLRequest = NSURLRequest(URL: URL) - - // When - let request = manager!.request(URLRequest) - request.cancel() - manager = nil - - // Then - let state = request.task.state - XCTAssertTrue(state == .Canceling || state == .Completed, "state should be .Canceling or .Completed") - XCTAssertNil(manager, "manager should be nil") - } -} - -// MARK: - - -class ManagerConfigurationHeadersTestCase: BaseTestCase { - enum ConfigurationType { - case Default, Ephemeral, Background - } - - func testThatDefaultConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Default) - } - - func testThatEphemeralConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Ephemeral) - } - - func testThatBackgroundConfigurationHeadersAreSentWithRequest() { - // Given, When, Then - executeAuthorizationHeaderTestForConfigurationType(.Background) - } - - private func executeAuthorizationHeaderTestForConfigurationType(type: ConfigurationType) { - // Given - let manager: Manager = { - let configuration: NSURLSessionConfiguration = { - let configuration: NSURLSessionConfiguration - - switch type { - case .Default: - configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - case .Ephemeral: - configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - case .Background: - let identifier = "com.alamofire.test.manager-configuration-tests" - configuration = NSURLSessionConfiguration.backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier) - } - - var headers = Alamofire.Manager.defaultHTTPHeaders - headers["Authorization"] = "Bearer 123456" - configuration.HTTPAdditionalHeaders = headers - - return configuration - }() - - return Manager(configuration: configuration) - }() - - let expectation = expectationWithDescription("request should complete successfully") - - var response: Response? - - // When - manager.request(.GET, "https://httpbin.org/headers") - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be a success") - - if let - headers = response.result.value?["headers" as NSString] as? [String: String], - authorization = headers["Authorization"] - { - XCTAssertEqual(authorization, "Bearer 123456", "authorization header value does not match") - } else { - XCTFail("failed to extract authorization header value") - } - } else { - XCTFail("response should not be nil") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift deleted file mode 100644 index 7418ece..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/MultipartFormDataTests.swift +++ /dev/null @@ -1,993 +0,0 @@ -// MultipartFormDataTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -struct EncodingCharacters { - static let CRLF = "\r\n" -} - -struct BoundaryGenerator { - enum BoundaryType { - case Initial, Encapsulated, Final - } - - static func boundary(boundaryType boundaryType: BoundaryType, boundaryKey: String) -> String { - let boundary: String - - switch boundaryType { - case .Initial: - boundary = "--\(boundaryKey)\(EncodingCharacters.CRLF)" - case .Encapsulated: - boundary = "\(EncodingCharacters.CRLF)--\(boundaryKey)\(EncodingCharacters.CRLF)" - case .Final: - boundary = "\(EncodingCharacters.CRLF)--\(boundaryKey)--\(EncodingCharacters.CRLF)" - } - - return boundary - } - - static func boundaryData(boundaryType boundaryType: BoundaryType, boundaryKey: String) -> NSData { - return BoundaryGenerator.boundary( - boundaryType: boundaryType, - boundaryKey: boundaryKey - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } -} - -private func temporaryFileURL() -> NSURL { - let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.test/multipart.form.data") - - let fileManager = NSFileManager.defaultManager() - do { - try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil) - } catch { - // No-op - will cause tests to fail, not crash - } - - let fileName = NSUUID().UUIDString - let fileURL = directoryURL.URLByAppendingPathComponent(fileName) - - return fileURL -} - -// MARK: - - -class MultipartFormDataPropertiesTestCase: BaseTestCase { - func testThatContentTypeContainsBoundary() { - // Given - let multipartFormData = MultipartFormData() - - // When - let boundary = multipartFormData.boundary - - // Then - let expectedContentType = "multipart/form-data; boundary=\(boundary)" - XCTAssertEqual(multipartFormData.contentType, expectedContentType, "contentType should match expected value") - } - - func testThatContentLengthMatchesTotalBodyPartSize() { - // Given - let multipartFormData = MultipartFormData() - let data1 = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let data2 = "Vim at integre alterum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - // When - multipartFormData.appendBodyPart(data: data1, name: "data1") - multipartFormData.appendBodyPart(data: data2, name: "data2") - - // Then - let expectedContentLength = UInt64(data1.length + data2.length) - XCTAssertEqual(multipartFormData.contentLength, expectedContentLength, "content length should match expected value") - } -} - -// MARK: - - -class MultipartFormDataEncodingTestCase: BaseTestCase { - let CRLF = EncodingCharacters.CRLF - - func testEncodingDataBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"data\"\(CRLF)\(CRLF)" + - "Lorem ipsum dolor sit amet." + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(encodedData, expectedData, "encoded data should match expected data") - } - } - - func testEncodingMultipleDataBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let emoji = "😃👍🏻🍻🎉".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - multipartFormData.appendBodyPart(data: french, name: "french") - multipartFormData.appendBodyPart(data: japanese, name: "japanese", mimeType: "text/plain") - multipartFormData.appendBodyPart(data: emoji, name: "emoji", mimeType: "text/plain") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"french\"\(CRLF)\(CRLF)" + - "français" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"japanese\"\(CRLF)" + - "Content-Type: text/plain\(CRLF)\(CRLF)" + - "日本語" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"emoji\"\(CRLF)" + - "Content-Type: text/plain\(CRLF)\(CRLF)" + - "😃👍🏻🍻🎉" + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(encodedData, expectedData, "encoded data should match expected data") - } - } - - func testEncodingFileBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleFileBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingStreamBodyPart() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleStreamBodyParts() { - // Given - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } - - func testEncodingMultipleBodyPartsWithVaryingTypes() { - // Given - let multipartFormData = MultipartFormData() - - let loremData = "Lorem ipsum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart(data: loremData, name: "lorem") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodedData: NSData? - - // When - do { - encodedData = try multipartFormData.encode() - } catch { - // No-op - } - - // Then - XCTAssertNotNil(encodedData, "encoded data should not be nil") - - if let encodedData = encodedData { - let boundary = multipartFormData.boundary - - let expectedData = NSMutableData() - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"lorem\"\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(loremData) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(encodedData, expectedData, "data should match expected data") - } - } -} - -// MARK: - - -class MultipartFormDataWriteEncodedDataToDiskTestCase: BaseTestCase { - let CRLF = EncodingCharacters.CRLF - - func testWritingEncodedDataBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"data\"\(CRLF)\(CRLF)" + - "Lorem ipsum dolor sit amet." + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedDataBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let french = "français".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let japanese = "日本語".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - let emoji = "😃👍🏻🍻🎉".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - multipartFormData.appendBodyPart(data: french, name: "french") - multipartFormData.appendBodyPart(data: japanese, name: "japanese") - multipartFormData.appendBodyPart(data: emoji, name: "emoji") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = ( - BoundaryGenerator.boundary(boundaryType: .Initial, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"french\"\(CRLF)\(CRLF)" + - "français" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"japanese\"\(CRLF)\(CRLF)" + - "日本語" + - BoundaryGenerator.boundary(boundaryType: .Encapsulated, boundaryKey: boundary) + - "Content-Disposition: form-data; name=\"emoji\"\(CRLF)\(CRLF)" + - "😃👍🏻🍻🎉" + - BoundaryGenerator.boundary(boundaryType: .Final, boundaryKey: boundary) - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingEncodedFileBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedFileBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingEncodedStreamBodyPartToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedStreamBodyPartsToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - let unicornDataLength = UInt64(NSData(contentsOfURL: unicornImageURL)!.length) - let unicornStream = NSInputStream(URL: unicornImageURL)! - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart( - stream: unicornStream, - length: unicornDataLength, - name: "unicorn", - fileName: "unicorn.png", - mimeType: "image/png" - ) - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } - - func testWritingMultipleEncodedBodyPartsWithVaryingTypesToDisk() { - // Given - let fileURL = temporaryFileURL() - let multipartFormData = MultipartFormData() - - let loremData = "Lorem ipsum.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let unicornImageURL = URLForResource("unicorn", withExtension: "png") - - let rainbowImageURL = URLForResource("rainbow", withExtension: "jpg") - let rainbowDataLength = UInt64(NSData(contentsOfURL: rainbowImageURL)!.length) - let rainbowStream = NSInputStream(URL: rainbowImageURL)! - - multipartFormData.appendBodyPart(data: loremData, name: "lorem") - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart( - stream: rainbowStream, - length: rainbowDataLength, - name: "rainbow", - fileName: "rainbow.jpg", - mimeType: "image/jpeg" - ) - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(encodingError, "encoding error should be nil") - - if let fileData = NSData(contentsOfURL: fileURL) { - let boundary = multipartFormData.boundary - - let expectedFileData = NSMutableData() - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Initial, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"lorem\"\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(loremData) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"unicorn\"; filename=\"unicorn.png\"\(CRLF)" + - "Content-Type: image/png\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: unicornImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundaryKey: boundary)) - expectedFileData.appendData(( - "Content-Disposition: form-data; name=\"rainbow\"; filename=\"rainbow.jpg\"\(CRLF)" + - "Content-Type: image/jpeg\(CRLF)\(CRLF)" - ).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - ) - expectedFileData.appendData(NSData(contentsOfURL: rainbowImageURL)!) - expectedFileData.appendData(BoundaryGenerator.boundaryData(boundaryType: .Final, boundaryKey: boundary)) - - XCTAssertEqual(fileData, expectedFileData, "file data should match expected file data") - } else { - XCTFail("file data should not be nil") - } - } -} - -// MARK: - - -class MultipartFormDataFailureTestCase: BaseTestCase { - func testThatAppendingFileBodyPartWithInvalidLastPathComponentReturnsError() { - // Given - let fileURL = NSURL(string: "")! - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "Failed to extract the fileName of the provided URL: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsNotFileURLReturnsError() { - // Given - let fileURL = NSURL(string: "https://example.com/image.jpg")! - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL does not point to a file URL: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsNotReachableReturnsError() { - // Given - let filePath = (NSTemporaryDirectory() as NSString).stringByAppendingPathComponent("does_not_exist.jpg") - let fileURL = NSURL(fileURLWithPath: filePath) - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: fileURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL is not reachable: \(fileURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatAppendingFileBodyPartThatIsDirectoryReturnsError() { - // Given - let directoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) - let multipartFormData = MultipartFormData() - multipartFormData.appendBodyPart(fileURL: directoryURL, name: "empty_data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.encode() - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let error = encodingError { - XCTAssertEqual(error.domain, "com.alamofire.error", "error domain does not match expected value") - XCTAssertEqual(error.code, NSURLErrorBadURL, "error code does not match expected value") - - if let failureReason = error.userInfo[NSLocalizedFailureReasonErrorKey] as? String { - let expectedFailureReason = "The file URL is a directory, not a file: \(directoryURL)" - XCTAssertEqual(failureReason, expectedFailureReason, "error failure reason does not match expected value") - } else { - XCTFail("failure reason should not be nil") - } - } - } - - func testThatWritingEncodedDataToExistingFileURLFails() { - // Given - let fileURL = temporaryFileURL() - - var writerError: NSError? - - do { - try "dummy data".writeToURL(fileURL, atomically: true, encoding: NSUTF8StringEncoding) - } catch { - writerError = error as NSError - } - - let multipartFormData = MultipartFormData() - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNil(writerError, "writer error should be nil") - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let encodingError = encodingError { - XCTAssertEqual(encodingError.domain, "com.alamofire.error", "encoding error domain does not match expected value") - XCTAssertEqual(encodingError.code, NSURLErrorBadURL, "encoding error code does not match expected value") - } - } - - func testThatWritingEncodedDataToBadURLFails() { - // Given - let fileURL = NSURL(string: "/this/is/not/a/valid/url")! - - let multipartFormData = MultipartFormData() - let data = "Lorem ipsum dolor sit amet.".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - multipartFormData.appendBodyPart(data: data, name: "data") - - var encodingError: NSError? - - // When - do { - try multipartFormData.writeEncodedDataToDisk(fileURL) - } catch { - encodingError = error as NSError - } - - // Then - XCTAssertNotNil(encodingError, "encoding error should not be nil") - - if let encodingError = encodingError { - XCTAssertEqual(encodingError.domain, "com.alamofire.error", "encoding error domain does not match expected value") - XCTAssertEqual(encodingError.code, NSURLErrorBadURL, "encoding error code does not match expected value") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift deleted file mode 100644 index c583e4b..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NSURLSessionConfiguration+AlamofireTests.swift +++ /dev/null @@ -1,37 +0,0 @@ -// NSURLSessionConfiguration+AlamofireTests.swift -// -// Copyright (c) 2014–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 Foundation - -extension NSURLSessionConfiguration { - static func backgroundSessionConfigurationForAllPlatformsWithIdentifier(identifier: String) -> NSURLSessionConfiguration { - let configuration: NSURLSessionConfiguration - - if #available(OSX 10.10, *) { - configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(identifier) - } else { - configuration = NSURLSessionConfiguration.backgroundSessionConfiguration(identifier) - } - - return configuration - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift deleted file mode 100644 index 7595076..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/NetworkReachabilityManagerTests.swift +++ /dev/null @@ -1,220 +0,0 @@ -// NetworkReachabilityManagerTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import SystemConfiguration -import XCTest - -class NetworkReachabilityManagerTestCase: BaseTestCase { - - // MARK: - Tests - Initialization - - func testThatManagerCanBeInitializedFromHost() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertNotNil(manager) - } - - func testThatManagerCanBeInitializedFromAddress() { - // Given, When - let manager = NetworkReachabilityManager() - - // Then - XCTAssertNotNil(manager) - } - - func testThatHostManagerIsReachableOnWiFi() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatHostManagerStartsWithReachableStatus() { - // Given, When - let manager = NetworkReachabilityManager(host: "localhost") - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatAddressManagerStartsWithReachableStatus() { - // Given, When - let manager = NetworkReachabilityManager() - - // Then - XCTAssertEqual(manager?.networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - XCTAssertEqual(manager?.isReachable, true) - XCTAssertEqual(manager?.isReachableOnWWAN, false) - XCTAssertEqual(manager?.isReachableOnEthernetOrWiFi, true) - } - - func testThatHostManagerCanBeDeinitialized() { - // Given - var manager: NetworkReachabilityManager? = NetworkReachabilityManager(host: "localhost") - - // When - manager = nil - - // Then - XCTAssertNil(manager) - } - - func testThatAddressManagerCanBeDeinitialized() { - // Given - var manager: NetworkReachabilityManager? = NetworkReachabilityManager() - - // When - manager = nil - - // Then - XCTAssertNil(manager) - } - - // MARK: - Tests - Listener - - func testThatHostManagerIsNotifiedWhenStartListeningIsCalled() { - // Given - let manager = NetworkReachabilityManager(host: "localhost") - let expectation = expectationWithDescription("listener closure should be executed") - - var networkReachabilityStatus: NetworkReachabilityManager.NetworkReachabilityStatus? - - manager?.listener = { status in - networkReachabilityStatus = status - expectation.fulfill() - } - - // When - manager?.startListening() - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatAddressManagerIsNotifiedWhenStartListeningIsCalled() { - // Given - let manager = NetworkReachabilityManager() - let expectation = expectationWithDescription("listener closure should be executed") - - var networkReachabilityStatus: NetworkReachabilityManager.NetworkReachabilityStatus? - - manager?.listener = { status in - networkReachabilityStatus = status - expectation.fulfill() - } - - // When - manager?.startListening() - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - // MARK: - Tests - Network Reachability Status - - func testThatManagerReturnsNotReachableStatusWhenReachableFlagIsAbsent() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.ConnectionOnDemand] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .NotReachable) - } - - func testThatManagerReturnsNotReachableStatusWhenInterventionIsRequired() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnDemand, .InterventionRequired] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .NotReachable) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsNotRequired() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsOnDemand() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnDemand] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - - func testThatManagerReturnsReachableOnWiFiStatusWhenConnectionIsOnTraffic() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .ConnectionRequired, .ConnectionOnTraffic] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.EthernetOrWiFi)) - } - -#if os(iOS) - func testThatManagerReturnsReachableOnWWANStatusWhenIsWWAN() { - // Given - let manager = NetworkReachabilityManager() - let flags: SCNetworkReachabilityFlags = [.Reachable, .IsWWAN] - - // When - let networkReachabilityStatus = manager?.networkReachabilityStatusForFlags(flags) - - // Then - XCTAssertEqual(networkReachabilityStatus, .Reachable(.WWAN)) - } -#endif -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift deleted file mode 100644 index c96f997..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ParameterEncodingTests.swift +++ /dev/null @@ -1,645 +0,0 @@ -// ParameterEncodingTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ParameterEncodingTestCase: BaseTestCase { - let URLRequest = NSURLRequest(URL: NSURL(string: "https://example.com/")!) -} - -// MARK: - - -class URLParameterEncodingTestCase: ParameterEncodingTestCase { - let encoding: ParameterEncoding = .URL - - // MARK: Tests - Parameter Types - - func testURLParameterEncodeNilParameters() { - // Given - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: nil) - - // Then - XCTAssertNil(URLRequest.URL?.query, "query should be nil") - } - - func testURLParameterEncodeEmptyDictionaryParameter() { - // Given - let parameters: [String: AnyObject] = [:] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertNil(URLRequest.URL?.query, "query should be nil") - } - - func testURLParameterEncodeOneStringKeyStringValueParameter() { - // Given - let parameters = ["foo": "bar"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=bar", "query is incorrect") - } - - func testURLParameterEncodeOneStringKeyStringValueParameterAppendedToQuery() { - // Given - let mutableURLRequest = self.URLRequest.URLRequest - let URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false)! - URLComponents.query = "baz=qux" - mutableURLRequest.URL = URLComponents.URL - - let parameters = ["foo": "bar"] - - // When - let (URLRequest, _) = encoding.encode(mutableURLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "baz=qux&foo=bar", "query is incorrect") - } - - func testURLParameterEncodeTwoStringKeyStringValueParameters() { - // Given - let parameters = ["foo": "bar", "baz": "qux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "baz=qux&foo=bar", "query is incorrect") - } - - func testURLParameterEncodeStringKeyIntegerValueParameter() { - // Given - let parameters = ["foo": 1] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyDoubleValueParameter() { - // Given - let parameters = ["foo": 1.1] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1.1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyBoolValueParameter() { - // Given - let parameters = ["foo": true] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyArrayValueParameter() { - // Given - let parameters = ["foo": ["a", 1, true]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5B%5D=a&foo%5B%5D=1&foo%5B%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyDictionaryValueParameter() { - // Given - let parameters = ["foo": ["bar": 1]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5Bbar%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNestedDictionaryValueParameter() { - // Given - let parameters = ["foo": ["bar": ["baz": 1]]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%5Bbar%5D%5Bbaz%5D=1", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNestedDictionaryArrayValueParameter() { - // Given - let parameters = ["foo": ["bar": ["baz": ["a", 1, true]]]] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "foo%5Bbar%5D%5Bbaz%5D%5B%5D=a&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1&foo%5Bbar%5D%5Bbaz%5D%5B%5D=1" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - // MARK: Tests - All Reserved / Unreserved / Illegal Characters According to RFC 3986 - - func testThatReservedCharactersArePercentEscapedMinusQuestionMarkAndForwardSlash() { - // Given - let generalDelimiters = ":#[]@" - let subDelimiters = "!$&'()*+,;=" - let parameters = ["reserved": "\(generalDelimiters)\(subDelimiters)"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "reserved=%3A%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - func testThatReservedCharactersQuestionMarkAndForwardSlashAreNotPercentEscaped() { - // Given - let parameters = ["reserved": "?/"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "reserved=?/", "query is incorrect") - } - - func testThatUnreservedNumericCharactersAreNotPercentEscaped() { - // Given - let parameters = ["numbers": "0123456789"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "numbers=0123456789", "query is incorrect") - } - - func testThatUnreservedLowercaseCharactersAreNotPercentEscaped() { - // Given - let parameters = ["lowercase": "abcdefghijklmnopqrstuvwxyz"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "lowercase=abcdefghijklmnopqrstuvwxyz", "query is incorrect") - } - - func testThatUnreservedUppercaseCharactersAreNotPercentEscaped() { - // Given - let parameters = ["uppercase": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "uppercase=ABCDEFGHIJKLMNOPQRSTUVWXYZ", "query is incorrect") - } - - func testThatIllegalASCIICharactersArePercentEscaped() { - // Given - let parameters = ["illegal": " \"#%<>[]\\^`{}|"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedQuery = "illegal=%20%22%23%25%3C%3E%5B%5D%5C%5E%60%7B%7D%7C" - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - // MARK: Tests - Special Character Queries - - func testURLParameterEncodeStringWithAmpersandKeyStringWithAmpersandValueParameter() { - // Given - let parameters = ["foo&bar": "baz&qux", "foobar": "bazqux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo%26bar=baz%26qux&foobar=bazqux", "query is incorrect") - } - - func testURLParameterEncodeStringWithQuestionMarkKeyStringWithQuestionMarkValueParameter() { - // Given - let parameters = ["?foo?": "?bar?"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "?foo?=?bar?", "query is incorrect") - } - - func testURLParameterEncodeStringWithSlashKeyStringWithQuestionMarkValueParameter() { - // Given - let parameters = ["foo": "/bar/baz/qux"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "foo=/bar/baz/qux", "query is incorrect") - } - - func testURLParameterEncodeStringWithSpaceKeyStringWithSpaceValueParameter() { - // Given - let parameters = [" foo ": " bar "] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "%20foo%20=%20bar%20", "query is incorrect") - } - - func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameter() { - // Given - let parameters = ["+foo+": "+bar+"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "%2Bfoo%2B=%2Bbar%2B", "query is incorrect") - } - - func testURLParameterEncodeStringKeyPercentEncodedStringValueParameter() { - // Given - let parameters = ["percent": "%25"] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "percent=%2525", "query is incorrect") - } - - func testURLParameterEncodeStringKeyNonLatinStringValueParameter() { - // Given - let parameters = [ - "french": "français", - "japanese": "日本語", - "arabic": "العربية", - "emoji": "😃" - ] - - // When - let (URLRequest, _) = encoding.encode(self.URLRequest, parameters: parameters) - - // Then - let expectedParameterValues = [ - "arabic=%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9", - "emoji=%F0%9F%98%83", - "french=fran%C3%A7ais", - "japanese=%E6%97%A5%E6%9C%AC%E8%AA%9E" - ] - - let expectedQuery = expectedParameterValues.joinWithSeparator("&") - XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect") - } - - func testURLParameterEncodeStringForRequestWithPrecomposedQuery() { - // Given - let URL = NSURL(string: "https://example.com/movies?hd=[1]")! - let parameters = ["page": "0"] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "hd=%5B1%5D&page=0", "query is incorrect") - } - - func testURLParameterEncodeStringWithPlusKeyStringWithPlusValueParameterForRequestWithPrecomposedQuery() { - // Given - let URL = NSURL(string: "https://example.com/movie?hd=[1]")! - let parameters = ["+foo+": "+bar+"] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - XCTAssertEqual(URLRequest.URL?.query ?? "", "hd=%5B1%5D&%2Bfoo%2B=%2Bbar%2B", "query is incorrect") - } - - func testURLParameterEncodeStringWithThousandsOfChineseCharacters() { - // Given - let repeatedCount = 2_000 - let URL = NSURL(string: "https://example.com/movies")! - let parameters = ["chinese": String(count: repeatedCount, repeatedString: "一二三四五六七八九十")] - - // When - let (URLRequest, _) = encoding.encode(NSURLRequest(URL: URL), parameters: parameters) - - // Then - var expected = "chinese=" - for _ in 0.. (NSMutableURLRequest, NSError?) = { URLRequest, parameters in - guard let parameters = parameters else { return (URLRequest.URLRequest, nil) } - - var URLString = URLRequest.URLRequest.URLString + "?" - - parameters.forEach { URLString += "\($0)=\($1)" } - - let mutableURLRequest = URLRequest.URLRequest - mutableURLRequest.URL = NSURL(string: URLString)! - - return (mutableURLRequest, nil) - } - - // When - let encoding: ParameterEncoding = .Custom(encodingClosure) - - // Then - let URL = NSURL(string: "https://example.com")! - let URLRequest = NSURLRequest(URL: URL) - let parameters: [String: AnyObject] = ["foo": "bar"] - - XCTAssertEqual( - encoding.encode(URLRequest, parameters: parameters).0.URLString, - "https://example.com?foo=bar", - "the encoded URL should match the expected value" - ) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift deleted file mode 100644 index 1cbaa8c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/RequestTests.swift +++ /dev/null @@ -1,617 +0,0 @@ -// RequestTests.swift -// -// Copyright (c) 2014-2015 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 Alamofire -import Foundation -import XCTest - -class RequestInitializationTestCase: BaseTestCase { - func testRequestClassMethodWithMethodAndURL() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.request(.GET, URLString) - - // Then - XCTAssertNotNil(request.request, "request URL request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "request response should be nil") - } - - func testRequestClassMethodWithMethodAndURLAndParameters() { - // Given - let URLString = "https://httpbin.org/get" - - // When - let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - - // Then - XCTAssertNotNil(request.request, "request URL request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertNotEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertEqual(request.request?.URL?.query ?? "", "foo=bar", "query is incorrect") - XCTAssertNil(request.response, "request response should be nil") - } - - func testRequestClassMethodWithMethodURLParametersAndHeaders() { - // Given - let URLString = "https://httpbin.org/get" - let headers = ["Authorization": "123456"] - - // When - let request = Alamofire.request(.GET, URLString, parameters: ["foo": "bar"], headers: headers) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "GET", "request HTTP method should match expected value") - XCTAssertNotEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertEqual(request.request?.URL?.query ?? "", "foo=bar", "query is incorrect") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class RequestResponseTestCase: BaseTestCase { - func testRequestResponse() { - // Given - let URLString = "https://httpbin.org/get" - - let expectation = expectationWithDescription("GET request should succeed: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - } - - func testRequestResponseWithProgress() { - // Given - let randomBytes = 4 * 1024 * 1024 - let URLString = "https://httpbin.org/bytes/\(randomBytes)" - - let expectation = expectationWithDescription("Bytes download progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let request = Alamofire.request(.GET, URLString) - request.progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - let bytes = (bytes: bytesRead, totalBytes: totalBytesRead, totalBytesExpected: totalBytesExpectedToRead) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: request.progress.completedUnitCount, - totalUnitCount: request.progress.totalUnitCount - ) - progressValues.append(progress) - } - request.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response response should not be nil") - XCTAssertNotNil(responseData, "response data should not be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0..? - - // When - Alamofire.request(.POST, URLString, parameters: parameters) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - - if let - JSON = response.result.value as? [String: AnyObject], - form = JSON["form"] as? [String: String] - { - XCTAssertEqual(form["french"], parameters["french"], "french parameter value should match form value") - XCTAssertEqual(form["japanese"], parameters["japanese"], "japanese parameter value should match form value") - XCTAssertEqual(form["arabic"], parameters["arabic"], "arabic parameter value should match form value") - XCTAssertEqual(form["emoji"], parameters["emoji"], "emoji parameter value should match form value") - } else { - XCTFail("form parameter in JSON should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } - - func testPOSTRequestWithBase64EncodedImages() { - // Given - let URLString = "https://httpbin.org/post" - - let pngBase64EncodedString: String = { - let URL = URLForResource("unicorn", withExtension: "png") - let data = NSData(contentsOfURL: URL)! - - return data.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) - }() - - let jpegBase64EncodedString: String = { - let URL = URLForResource("rainbow", withExtension: "jpg") - let data = NSData(contentsOfURL: URL)! - - return data.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) - }() - - let parameters = [ - "email": "user@alamofire.org", - "png_image": pngBase64EncodedString, - "jpeg_image": jpegBase64EncodedString - ] - - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.POST, URLString, parameters: parameters) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - if let - JSON = response.result.value as? [String: AnyObject], - form = JSON["form"] as? [String: String] - { - XCTAssertEqual(form["email"], parameters["email"], "email parameter value should match form value") - XCTAssertEqual(form["png_image"], parameters["png_image"], "png_image parameter value should match form value") - XCTAssertEqual(form["jpeg_image"], parameters["jpeg_image"], "jpeg_image parameter value should match form value") - } else { - XCTFail("form parameter in JSON should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -extension Request { - private func preValidate(operation: Void -> Void) -> Self { - delegate.queue.addOperationWithBlock { - operation() - } - - return self - } - - private func postValidate(operation: Void -> Void) -> Self { - delegate.queue.addOperationWithBlock { - operation() - } - - return self - } -} - -// MARK: - - -class RequestExtensionTestCase: BaseTestCase { - func testThatRequestExtensionHasAccessToTaskDelegateQueue() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("GET request should succeed: \(URLString)") - - var responses: [String] = [] - - // When - Alamofire.request(.GET, URLString) - .preValidate { - responses.append("preValidate") - } - .validate() - .postValidate { - responses.append("postValidate") - } - .response { _, _, _, _ in - responses.append("response") - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if responses.count == 3 { - XCTAssertEqual(responses[0], "preValidate", "response at index 0 should be preValidate") - XCTAssertEqual(responses[1], "postValidate", "response at index 1 should be postValidate") - XCTAssertEqual(responses[2], "response", "response at index 2 should be response") - } else { - XCTFail("responses count should be equal to 3") - } - } -} - -// MARK: - - -class RequestDescriptionTestCase: BaseTestCase { - func testRequestDescription() { - // Given - let URLString = "https://httpbin.org/get" - let request = Alamofire.request(.GET, URLString) - let initialRequestDescription = request.description - - let expectation = expectationWithDescription("Request description should update: \(URLString)") - - var finalRequestDescription: String? - var response: NSHTTPURLResponse? - - // When - request.response { _, responseResponse, _, _ in - finalRequestDescription = request.description - response = responseResponse - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(initialRequestDescription, "GET https://httpbin.org/get", "incorrect request description") - XCTAssertEqual( - finalRequestDescription ?? "", - "GET https://httpbin.org/get (\(response?.statusCode ?? -1))", - "incorrect request description" - ) - } -} - -// MARK: - - -class RequestDebugDescriptionTestCase: BaseTestCase { - // MARK: Properties - - let manager: Manager = { - let manager = Manager(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) - manager.startRequestsImmediately = false - return manager - }() - - let managerDisallowingCookies: Manager = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPShouldSetCookies = false - - let manager = Manager(configuration: configuration) - manager.startRequestsImmediately = false - - return manager - }() - - // MARK: Tests - - func testGETRequestDebugDescription() { - // Given - let URLString = "https://httpbin.org/get" - - // When - let request = manager.request(.GET, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertFalse(components.contains("-X"), "command should not contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - // When - let request = manager.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestWithJSONParametersDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - // When - let request = manager.request(.POST, URLString, parameters: ["foo": "bar"], encoding: .JSON) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertTrue( - request.debugDescription.rangeOfString("-H \"Content-Type: application/json\"") != nil, - "command should contain 'application/json' Content-Type" - ) - XCTAssertTrue( - request.debugDescription.rangeOfString("-d \"{\\\"foo\\\":\\\"bar\\\"}\"") != nil, - "command data should contain JSON encoded parameters" - ) - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - } - - func testPOSTRequestWithCookieDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - let properties = [ - NSHTTPCookieDomain: "httpbin.org", - NSHTTPCookiePath: "/post", - NSHTTPCookieName: "foo", - NSHTTPCookieValue: "bar", - ] - - let cookie = NSHTTPCookie(properties: properties)! - manager.session.configuration.HTTPCookieStorage?.setCookie(cookie) - - // When - let request = manager.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - XCTAssertEqual(components[0..<3], ["$", "curl", "-i"], "components should be equal") - XCTAssertEqual(components[3..<5], ["-X", "POST"], "command should contain explicit -X flag") - XCTAssertEqual(components.last ?? "", "\"\(URLString)\"", "URL component should be equal") - XCTAssertEqual(components[5..<6], ["-b"], "command should contain -b flag") - } - - func testPOSTRequestWithCookiesDisabledDebugDescription() { - // Given - let URLString = "https://httpbin.org/post" - - let properties = [ - NSHTTPCookieDomain: "httpbin.org", - NSHTTPCookiePath: "/post", - NSHTTPCookieName: "foo", - NSHTTPCookieValue: "bar", - ] - - let cookie = NSHTTPCookie(properties: properties)! - managerDisallowingCookies.session.configuration.HTTPCookieStorage?.setCookie(cookie) - - // When - let request = managerDisallowingCookies.request(.POST, URLString) - let components = cURLCommandComponents(request) - - // Then - let cookieComponents = components.filter { $0 == "-b" } - XCTAssertTrue(cookieComponents.isEmpty, "command should not contain -b flag") - } - - func testThatRequestWithInvalidURLDebugDescription() { - // Given - let URLString = "invalid_url" - - // When - let request = manager.request(.GET, URLString) - let debugDescription = request.debugDescription - - // Then - XCTAssertNotNil(debugDescription, "debugDescription should not crash") - } - - // MARK: Test Helper Methods - - private func cURLCommandComponents(request: Request) -> [String] { - let whitespaceCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet() - return request.debugDescription.componentsSeparatedByCharactersInSet(whitespaceCharacterSet) - .filter { $0 != "" && $0 != "\\" } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer deleted file mode 100644 index b5ae743..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-root-ca.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer deleted file mode 100644 index 38596c5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca1.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer deleted file mode 100644 index edd135c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/alamofire-signing-ca2.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer deleted file mode 100644 index af5e484..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/expired.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer deleted file mode 100644 index 9e4ef3c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/missing-dns-name-and-uri.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer deleted file mode 100644 index 39828eb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/multiple-dns-names.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer deleted file mode 100644 index 1acfcfc..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca1.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer deleted file mode 100644 index 709889d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/signed-by-ca2.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer deleted file mode 100644 index 01c404b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/test.alamofire.org.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer deleted file mode 100644 index a5da56d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-dns-name.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer deleted file mode 100644 index 80838d4..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/valid-uri.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer deleted file mode 100644 index 959a5d8..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/alamofire.org/wildcard.alamofire.org.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer deleted file mode 100644 index 14866ee..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/intermediate-ca-disig.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer deleted file mode 100644 index e5e2343..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/root-ca-disig.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer deleted file mode 100644 index 6779096..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/disig.sk/testssl-expire.disig.sk.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.cer and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.crt and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der deleted file mode 100644 index a9a2bdb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certDER.der and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer deleted file mode 100644 index d22b9ab..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.cer +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID9DCCAtygAwIBAgIJAIqBVOBRW4qMMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoT -IVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZTAeFw0xNTEyMTEwMjA5 -MDlaFw0xNjEyMTAwMjA5MDlaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTER -MA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVz -IGluIEFsYW1vRmlyZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJy9 -FTR4QzhYyo2v2yv8SwlBQ32MHQF8Ez1J+YBsyZjcTVOGJtyPxrbJxGuRhyDzKUqz -X/zTsT+JPvZQXXBmyq0l0DhCcK84cHyVLcdEAzukam85EpJRWzSg8kDKzuTx2oLk -X8Zdcj7EEtYWV/5+/YahM4tXYhg+Lqm6koJEVHMld6zfedC7HN+jsTb73IrAY0dd -BPl7WPgDIPEl0kcGI6F7NS0+CKsgX412E5+TGUkvA8VI+e9+cn/EXBdklVQQGSOu -rHpcoOi1VqnQI0hGXlFi4MpamwMG2yArIUU0TXZ7G+/AbUYiGdB6ogvg5UTCfyZy -UXVljSJyzYmLs7hXQK8CAwEAAaOBvjCBuzAdBgNVHQ4EFgQU9EaWHrJGYvpCEW5f -CUEMRk9DlN8wgYsGA1UdIwSBgzCBgIAU9EaWHrJGYvpCEW5fCUEMRk9DlN+hXaRb -MFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkx -KjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZYIJAIqB -VOBRW4qMMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEeHeXNZGHJW -VImbOHrYmSsZ5jFnzjGw8ynkOrcoJzaxg3OHoo/pNCQ7KcrIa5YPNFiNoaSa/Lzn -LBt6HkM1Vi1rMaERHLWp/W5ruInCu4CuVtQshdNcOEofJ03wdrQylOBZq8MZkTVn -NcqUFg/sBANM/9WhafVi7XaUjWl+V7ZnzdbKP/ywvsiJ+wyKMA7Wt19HMrV2dTBz -CD4vxpwOBev0oTp2NvAHdgNkeK52skHoz+MY8uivVJQr4hqLYJPXUyAcVZCaqeK/ -hxDkbRo6eZsYcjTRqMKtGMVjHHd8alXcVJwcuWkhUYxy8jRf0kFj/9mMie9jRokJ -ovKLbNJfEbI= ------END CERTIFICATE----- diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt deleted file mode 100644 index d22b9ab..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/certPEM.crt +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID9DCCAtygAwIBAgIJAIqBVOBRW4qMMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoT -IVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZTAeFw0xNTEyMTEwMjA5 -MDlaFw0xNjEyMTAwMjA5MDlaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTER -MA8GA1UEBxMIQmVya2VsZXkxKjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVz -IGluIEFsYW1vRmlyZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJy9 -FTR4QzhYyo2v2yv8SwlBQ32MHQF8Ez1J+YBsyZjcTVOGJtyPxrbJxGuRhyDzKUqz -X/zTsT+JPvZQXXBmyq0l0DhCcK84cHyVLcdEAzukam85EpJRWzSg8kDKzuTx2oLk -X8Zdcj7EEtYWV/5+/YahM4tXYhg+Lqm6koJEVHMld6zfedC7HN+jsTb73IrAY0dd -BPl7WPgDIPEl0kcGI6F7NS0+CKsgX412E5+TGUkvA8VI+e9+cn/EXBdklVQQGSOu -rHpcoOi1VqnQI0hGXlFi4MpamwMG2yArIUU0TXZ7G+/AbUYiGdB6ogvg5UTCfyZy -UXVljSJyzYmLs7hXQK8CAwEAAaOBvjCBuzAdBgNVHQ4EFgQU9EaWHrJGYvpCEW5f -CUEMRk9DlN8wgYsGA1UdIwSBgzCBgIAU9EaWHrJGYvpCEW5fCUEMRk9DlN+hXaRb -MFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTERMA8GA1UEBxMIQmVya2VsZXkx -KjAoBgNVBAoTIVRlc3RpbmcgQ2VydGlmaWNhdGVzIGluIEFsYW1vRmlyZYIJAIqB -VOBRW4qMMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEeHeXNZGHJW -VImbOHrYmSsZ5jFnzjGw8ynkOrcoJzaxg3OHoo/pNCQ7KcrIa5YPNFiNoaSa/Lzn -LBt6HkM1Vi1rMaERHLWp/W5ruInCu4CuVtQshdNcOEofJ03wdrQylOBZq8MZkTVn -NcqUFg/sBANM/9WhafVi7XaUjWl+V7ZnzdbKP/ywvsiJ+wyKMA7Wt19HMrV2dTBz -CD4vxpwOBev0oTp2NvAHdgNkeK52skHoz+MY8uivVJQr4hqLYJPXUyAcVZCaqeK/ -hxDkbRo6eZsYcjTRqMKtGMVjHHd8alXcVJwcuWkhUYxy8jRf0kFj/9mMie9jRokJ -ovKLbNJfEbI= ------END CERTIFICATE----- diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der deleted file mode 100644 index 969657d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/keyDER.der and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt deleted file mode 100644 index 23d1360..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Certificates/selfSignedAndMalformedCerts/randomGibberish.crt and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg deleted file mode 100644 index 9122468..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/rainbow.jpg and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png deleted file mode 100644 index bc504e5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/Resources/Images/unicorn.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift deleted file mode 100644 index e65d41a..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseSerializationTests.swift +++ /dev/null @@ -1,591 +0,0 @@ -// ResponseSerializationTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ResponseSerializationTestCase: BaseTestCase { - let error = NSError(domain: Error.Domain, code: -10000, userInfo: nil) - - // MARK: - Data Response Serializer Tests - - func testThatDataResponseSerializerSucceedsWhenDataIsNotNil() { - // Given - let serializer = Request.dataResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatDataResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.dataResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.DataSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.dataResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.dataResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.DataSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatDataResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.dataResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let data = result.value { - XCTAssertEqual(data.length, 0, "data length should be zero") - } - } - - // MARK: - String Response Serializer Tests - - func testThatStringResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerSucceedsWhenDataIsEmpty() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataAndNoProvidedEncoding() { - let serializer = Request.stringResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataAndUTF8ProvidedEncoding() { - let serializer = Request.stringResponseSerializer(encoding: NSUTF8StringEncoding) - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerSucceedsWithUTF8DataUsingResponseTextEncodingName() { - let serializer = Request.stringResponseSerializer() - let data = "data".dataUsingEncoding(NSUTF8StringEncoding)! - let response = NSHTTPURLResponse( - URL: NSURL(string: "https://httpbin.org/get")!, - statusCode: 200, - HTTPVersion: "HTTP/1.1", - headerFields: ["Content-Type": "image/jpeg; charset=utf-8"] - ) - - // When - let result = serializer.serializeResponse(nil, response, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatStringResponseSerializerFailsWithUTF32DataAndUTF8ProvidedEncoding() { - // Given - let serializer = Request.stringResponseSerializer(encoding: NSUTF8StringEncoding) - let data = "random data".dataUsingEncoding(NSUTF32StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWithUTF32DataAndUTF8ResponseEncoding() { - // Given - let serializer = Request.stringResponseSerializer() - let data = "random data".dataUsingEncoding(NSUTF32StringEncoding)! - let response = NSHTTPURLResponse( - URL: NSURL(string: "https://httpbin.org/get")!, - statusCode: 200, - HTTPVersion: "HTTP/1.1", - headerFields: ["Content-Type": "image/jpeg; charset=utf-8"] - ) - - // When - let result = serializer.serializeResponse(nil, response, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.stringResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.stringResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.StringSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatStringResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.stringResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let string = result.value { - XCTAssertEqual(string, "", "string should be equal to empty string") - } - } - - // MARK: - JSON Response Serializer Tests - - func testThatJSONResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenDataIsEmpty() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerSucceedsWhenDataIsValidJSON() { - // Given - let serializer = Request.stringResponseSerializer() - let data = "{\"json\": true}".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatJSONResponseSerializerFailsWhenDataIsInvalidJSON() { - // Given - let serializer = Request.JSONResponseSerializer() - let data = "definitely not valid json".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, NSCocoaErrorDomain, "error domain should match expected value") - XCTAssertEqual(error.code, 3840, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.JSONResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.JSONResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.JSONSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatJSONResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.JSONResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let json = result.value as? NSNull { - XCTAssertEqual(json, NSNull(), "json should be equal to NSNull") - } - } - - // MARK: - Property List Response Serializer Tests - - func testThatPropertyListResponseSerializerFailsWhenDataIsNil() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsEmpty() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, NSData(), nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerSucceedsWhenDataIsValidPropertyListData() { - // Given - let serializer = Request.propertyListResponseSerializer() - let data = NSKeyedArchiver.archivedDataWithRootObject(["foo": "bar"]) - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsInvalidPropertyListData() { - // Given - let serializer = Request.propertyListResponseSerializer() - let data = "definitely not valid plist data".dataUsingEncoding(NSUTF8StringEncoding)! - - // When - let result = serializer.serializeResponse(nil, nil, data, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, NSCocoaErrorDomain, "error domain should match expected value") - XCTAssertEqual(error.code, 3840, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenErrorIsNotNil() { - // Given - let serializer = Request.propertyListResponseSerializer() - - // When - let result = serializer.serializeResponse(nil, nil, nil, error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, self.error.code, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerFailsWhenDataIsNilWithNon204ResponseStatusCode() { - // Given - let serializer = Request.propertyListResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 200, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true") - XCTAssertNil(result.value, "result value should be nil") - XCTAssertNotNil(result.error, "result error should not be nil") - - if let error = result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should match expected value") - XCTAssertEqual(error.code, Error.Code.PropertyListSerializationFailed.rawValue, "error code should match expected value") - } else { - XCTFail("error should not be nil") - } - } - - func testThatPropertyListResponseSerializerSucceedsWhenDataIsNilWith204ResponseStatusCode() { - // Given - let serializer = Request.propertyListResponseSerializer() - let URL = NSURL(string: "https://httpbin.org/get")! - let response = NSHTTPURLResponse(URL: URL, statusCode: 204, HTTPVersion: "HTTP/1.1", headerFields: nil) - - // When - let result = serializer.serializeResponse(nil, response, nil, nil) - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true") - XCTAssertNotNil(result.value, "result value should not be nil") - XCTAssertNil(result.error, "result error should be nil") - - if let plist = result.value as? NSNull { - XCTAssertEqual(plist, NSNull(), "plist should be equal to NSNull") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift deleted file mode 100644 index 66659a5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift +++ /dev/null @@ -1,533 +0,0 @@ -// ResponseTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ResponseDataTestCase: BaseTestCase { - func testThatResponseDataReturnsSuccessResultWithValidData() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseData { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseDataReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseData { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class ResponseStringTestCase: BaseTestCase { - func testThatResponseStringReturnsSuccessResultWithValidString() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseString { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseStringReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseString { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class ResponseJSONTestCase: BaseTestCase { - func testThatResponseJSONReturnsSuccessResultWithValidJSON() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseStringReturnsFailureResultWithOptionalDataAndError() { - // Given - let URLString = "https://invalid-url-here.org/this/does/not/exist" - let expectation = expectationWithDescription("request should fail with 404") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNil(response.response, "response should be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isFailure, "result should be failure") - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseJSONReturnsSuccessResultForGETRequest() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.GET, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let args = response.result.value?["args" as NSString] as? [String: String] { - XCTAssertEqual(args, ["foo": "bar"], "args should match parameters") - } else { - XCTFail("args should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } - - func testThatResponseJSONReturnsSuccessResultForPOSTRequest() { - // Given - let URLString = "https://httpbin.org/post" - let expectation = expectationWithDescription("request should succeed") - - var response: Response? - - // When - Alamofire.request(.POST, URLString, parameters: ["foo": "bar"]) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - if let response = response { - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNotNil(response.data, "data should not be nil") - XCTAssertTrue(response.result.isSuccess, "result should be success") - - // The `as NSString` cast is necessary due to a compiler bug. See the following rdar for more info. - // - https://openradar.appspot.com/radar?id=5517037090635776 - if let form = response.result.value?["form" as NSString] as? [String: String] { - XCTAssertEqual(form, ["foo": "bar"], "form should match parameters") - } else { - XCTFail("form should not be nil") - } - } else { - XCTFail("response should not be nil") - } - } -} - -// MARK: - - -class RedirectResponseTestCase: BaseTestCase { - - // MARK: Setup and Teardown - - override func tearDown() { - super.tearDown() - Alamofire.Manager.sharedInstance.delegate.taskWillPerformHTTPRedirection = nil - } - - // MARK: Tests - - func testThatRequestWillPerformHTTPRedirectionByDefault() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatRequestWillPerformRedirectionMultipleTimesByDefault() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect/5" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatTaskOverrideClosureCanPerformHTTPRedirection() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - - delegate.taskWillPerformHTTPRedirection = { _, _, _, request in - return request - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - } - - func testThatTaskOverrideClosureCanCancelHTTPRedirection() { - // Given - let redirectURLString = "https://www.apple.com" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - - let expectation = expectationWithDescription("Request should not redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - - delegate.taskWillPerformHTTPRedirection = { _, _, _, _ in - return nil - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", URLString, "response URL should match the origin URL") - XCTAssertEqual(response?.statusCode ?? -1, 302, "response should have a 302 status code") - } - - func testThatTaskOverrideClosureIsCalledMultipleTimesForMultipleHTTPRedirects() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect/5" - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate - var totalRedirectCount = 0 - - delegate.taskWillPerformHTTPRedirection = { _, _, _, request in - ++totalRedirectCount - return request - } - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - XCTAssertEqual(response?.URL?.URLString ?? "", redirectURLString, "response URL should match the redirect URL") - XCTAssertEqual(response?.statusCode ?? -1, 200, "response should have a 200 status code") - XCTAssertEqual(totalRedirectCount, 5, "total redirect count should be 5") - } - - func testThatRedirectedRequestContainsAllHeadersFromOriginalRequest() { - // Given - let redirectURLString = "https://httpbin.org/get" - let URLString = "https://httpbin.org/redirect-to?url=\(redirectURLString)" - let headers = [ - "Authorization": "1234", - "Custom-Header": "foobar", - ] - - // NOTE: It appears that most headers are maintained during a redirect with the exception of the `Authorization` - // header. It appears that Apple's strips the `Authorization` header from the redirected URL request. If you - // need to maintain the `Authorization` header, you need to manually append it to the redirected request. - - let manager = Manager(configuration: NSURLSessionConfiguration.ephemeralSessionConfiguration()) - - manager.delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var redirectedRequest = request - - if let - originalRequest = task.originalRequest, - headers = originalRequest.allHTTPHeaderFields, - authorizationHeaderValue = headers["Authorization"] - { - let mutableRequest = request.mutableCopy() as! NSMutableURLRequest - mutableRequest.setValue(authorizationHeaderValue, forHTTPHeaderField: "Authorization") - redirectedRequest = mutableRequest - } - - return redirectedRequest - } - - let expectation = expectationWithDescription("Request should redirect to \(redirectURLString)") - - var response: Response? - - // When - manager.request(.GET, URLString, headers: headers) - .responseJSON { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertNotNil(response?.data, "data should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "response result should be a success") - - if let - JSON = response?.result.value as? [String: AnyObject], - headers = JSON["headers"] as? [String: String] - { - XCTAssertEqual(headers["Custom-Header"], "foobar", "Custom-Header should be equal to foobar") - XCTAssertEqual(headers["Authorization"], "1234", "Authorization header should be equal to 1234") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift deleted file mode 100644 index 4b1f002..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ResultTests.swift +++ /dev/null @@ -1,145 +0,0 @@ -// ResultTests.swift -// -// Copyright (c) 2014–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. - -@testable import Alamofire -import Foundation -import XCTest - -class ResultTestCase: BaseTestCase { - let error = Error.errorWithCode(.StatusCodeValidationFailed, failureReason: "Status code validation failed") - - // MARK: - Is Success Tests - - func testThatIsSuccessPropertyReturnsTrueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertTrue(result.isSuccess, "result is success should be true for success case") - } - - func testThatIsSuccessPropertyReturnsFalseForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertFalse(result.isSuccess, "result is success should be true for failure case") - } - - // MARK: - Is Failure Tests - - func testThatIsFailurePropertyReturnsFalseForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertFalse(result.isFailure, "result is failure should be false for success case") - } - - func testThatIsFailurePropertyReturnsTrueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertTrue(result.isFailure, "result is failure should be true for failure case") - } - - // MARK: - Value Tests - - func testThatValuePropertyReturnsValueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertEqual(result.value ?? "", "success", "result value should match expected value") - } - - func testThatValuePropertyReturnsNilForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertNil(result.value, "result value should be nil for failure case") - } - - // MARK: - Error Tests - - func testThatErrorPropertyReturnsNilForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertTrue(result.error == nil, "result error should be nil for success case") - } - - func testThatErrorPropertyReturnsErrorForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertTrue(result.error != nil, "result error should not be nil for failure case") - } - - // MARK: - Description Tests - - func testThatDescriptionStringMatchesExpectedValueForSuccessCase() { - // Given, When - let result = Result.Success("success") - - // Then - XCTAssertEqual(result.description, "SUCCESS", "result description should match expected value for success case") - } - - func testThatDescriptionStringMatchesExpectedValueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertEqual(result.description, "FAILURE", "result description should match expected value for failure case") - } - - // MARK: - Debug Description Tests - - func testThatDebugDescriptionStringMatchesExpectedValueForSuccessCase() { - // Given, When - let result = Result.Success("success value") - - // Then - XCTAssertEqual( - result.debugDescription, - "SUCCESS: success value", - "result debug description should match expected value for success case" - ) - } - - func testThatDebugDescriptionStringMatchesExpectedValueForFailureCase() { - // Given, When - let result = Result.Failure(error) - - // Then - XCTAssertEqual( - result.debugDescription, - "FAILURE: \(error)", - "result debug description should match expected value for failure case" - ) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift deleted file mode 100644 index 2c24188..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/ServerTrustPolicyTests.swift +++ /dev/null @@ -1,1418 +0,0 @@ -// MultipartFormDataTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -private struct TestCertificates { - // Root Certificates - static let RootCA = TestCertificates.certificateWithFileName("alamofire-root-ca") - - // Intermediate Certificates - static let IntermediateCA1 = TestCertificates.certificateWithFileName("alamofire-signing-ca1") - static let IntermediateCA2 = TestCertificates.certificateWithFileName("alamofire-signing-ca2") - - // Leaf Certificates - Signed by CA1 - static let LeafWildcard = TestCertificates.certificateWithFileName("wildcard.alamofire.org") - static let LeafMultipleDNSNames = TestCertificates.certificateWithFileName("multiple-dns-names") - static let LeafSignedByCA1 = TestCertificates.certificateWithFileName("signed-by-ca1") - static let LeafDNSNameAndURI = TestCertificates.certificateWithFileName("test.alamofire.org") - - // Leaf Certificates - Signed by CA2 - static let LeafExpired = TestCertificates.certificateWithFileName("expired") - static let LeafMissingDNSNameAndURI = TestCertificates.certificateWithFileName("missing-dns-name-and-uri") - static let LeafSignedByCA2 = TestCertificates.certificateWithFileName("signed-by-ca2") - static let LeafValidDNSName = TestCertificates.certificateWithFileName("valid-dns-name") - static let LeafValidURI = TestCertificates.certificateWithFileName("valid-uri") - - static func certificateWithFileName(fileName: String) -> SecCertificate { - class Bundle {} - let filePath = NSBundle(forClass: Bundle.self).pathForResource(fileName, ofType: "cer")! - let data = NSData(contentsOfFile: filePath)! - let certificate = SecCertificateCreateWithData(nil, data)! - - return certificate - } -} - -// MARK: - - -private struct TestPublicKeys { - // Root Public Keys - static let RootCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.RootCA) - - // Intermediate Public Keys - static let IntermediateCA1 = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA1) - static let IntermediateCA2 = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA2) - - // Leaf Public Keys - Signed by CA1 - static let LeafWildcard = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafWildcard) - static let LeafMultipleDNSNames = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafMultipleDNSNames) - static let LeafSignedByCA1 = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafSignedByCA1) - static let LeafDNSNameAndURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafDNSNameAndURI) - - // Leaf Public Keys - Signed by CA2 - static let LeafExpired = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafExpired) - static let LeafMissingDNSNameAndURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafMissingDNSNameAndURI) - static let LeafSignedByCA2 = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafSignedByCA2) - static let LeafValidDNSName = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafValidDNSName) - static let LeafValidURI = TestPublicKeys.publicKeyForCertificate(TestCertificates.LeafValidURI) - - static func publicKeyForCertificate(certificate: SecCertificate) -> SecKey { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificate, policy, &trust) - - let publicKey = SecTrustCopyPublicKey(trust!)! - - return publicKey - } -} - -// MARK: - - -private enum TestTrusts { - // Leaf Trusts - Signed by CA1 - case LeafWildcard - case LeafMultipleDNSNames - case LeafSignedByCA1 - case LeafDNSNameAndURI - - // Leaf Trusts - Signed by CA2 - case LeafExpired - case LeafMissingDNSNameAndURI - case LeafSignedByCA2 - case LeafValidDNSName - case LeafValidURI - - // Invalid Trusts - case LeafValidDNSNameMissingIntermediate - case LeafValidDNSNameWithIncorrectIntermediate - - var trust: SecTrust { - let trust: SecTrust - - switch self { - case .LeafWildcard: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafWildcard, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafMultipleDNSNames: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafMultipleDNSNames, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafSignedByCA1: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafSignedByCA1, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafDNSNameAndURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - case .LeafExpired: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafExpired, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafMissingDNSNameAndURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafMissingDNSNameAndURI, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafSignedByCA2: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafSignedByCA2, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafValidDNSName: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case .LeafValidURI: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidURI, - TestCertificates.IntermediateCA2, - TestCertificates.RootCA - ]) - case LeafValidDNSNameMissingIntermediate: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.RootCA - ]) - case LeafValidDNSNameWithIncorrectIntermediate: - trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - } - - return trust - } - - static func trustWithCertificates(certificates: [SecCertificate]) -> SecTrust { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificates, policy, &trust) - - return trust! - } -} - -// MARK: - Basic X509 and SSL Exploration Tests - - -class ServerTrustPolicyTestCase: BaseTestCase { - func setRootCertificateAsLoneAnchorCertificateForTrust(trust: SecTrust) { - SecTrustSetAnchorCertificates(trust, [TestCertificates.RootCA]) - SecTrustSetAnchorCertificatesOnly(trust, true) - } - - func trustIsValid(trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType(kSecTrustResultInvalid) - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType(kSecTrustResultUnspecified) - let proceed = SecTrustResultType(kSecTrustResultProceed) - - isValid = result == unspecified || result == proceed - } - - return isValid - } -} - -// MARK: - - -class ServerTrustPolicyExplorationBasicX509PolicyValidationTestCase: ServerTrustPolicyTestCase { - func testThatAnchoredRootCertificatePassesBasicX509ValidationWithRootInTrust() { - // Given - let trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatAnchoredRootCertificatePassesBasicX509ValidationWithoutRootInTrust() { - // Given - let trust = TestTrusts.LeafDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatCertificateMissingDNSNamePassesBasicX509Validation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatExpiredCertificateFailsBasicX509Validation() { - // Given - let trust = TestTrusts.LeafExpired.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateBasicX509()] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } -} - -// MARK: - - -class ServerTrustPolicyExplorationSSLPolicyValidationTestCase: ServerTrustPolicyTestCase { - func testThatAnchoredRootCertificatePassesSSLValidationWithRootInTrust() { - // Given - let trust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafDNSNameAndURI, - TestCertificates.IntermediateCA1, - TestCertificates.RootCA - ]) - - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatAnchoredRootCertificatePassesSSLValidationWithoutRootInTrust() { - // Given - let trust = TestTrusts.LeafDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatCertificateMissingDNSNameFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } - - func testThatWildcardCertificatePassesSSLValidation() { - // Given - let trust = TestTrusts.LeafWildcard.trust // *.alamofire.org - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatDNSNameCertificatePassesSSLValidation() { - // Given - let trust = TestTrusts.LeafValidDNSName.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should be valid") - } - - func testThatURICertificateFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafValidURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } - - func testThatMultipleDNSNamesCertificatePassesSSLValidationForAllEntries() { - // Given - let trust = TestTrusts.LeafMultipleDNSNames.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [ - SecPolicyCreateSSL(true, "test.alamofire.org"), - SecPolicyCreateSSL(true, "blog.alamofire.org"), - SecPolicyCreateSSL(true, "www.alamofire.org") - ] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should not be valid") - } - - func testThatPassingNilForHostParameterAllowsCertificateMissingDNSNameToPassSSLValidation() { - // Given - let trust = TestTrusts.LeafMissingDNSNameAndURI.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, nil)] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertTrue(trustIsValid(trust), "trust should not be valid") - } - - func testThatExpiredCertificateFailsSSLValidation() { - // Given - let trust = TestTrusts.LeafExpired.trust - setRootCertificateAsLoneAnchorCertificateForTrust(trust) - - // When - let policies = [SecPolicyCreateSSL(true, "test.alamofire.org")] - SecTrustSetPolicies(trust, policies) - - // Then - XCTAssertFalse(trustIsValid(trust), "trust should not be valid") - } -} - -// MARK: - Server Trust Policy Tests - - -class ServerTrustPolicyPerformDefaultEvaluationTestCase: ServerTrustPolicyTestCase { - - // MARK: Do NOT Validate Host - - func testThatValidCertificateChainPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatNonAnchoredRootCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2 - ]) - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingDNSNameLeafCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafMissingDNSNameAndURI.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingIntermediateCertificateInChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: false) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Validate Host - - func testThatValidCertificateChainPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatNonAnchoredRootCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.trustWithCertificates([ - TestCertificates.LeafValidDNSName, - TestCertificates.IntermediateCA2 - ]) - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingDNSNameLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafMissingDNSNameAndURI.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatWildcardedLeafCertificateChainPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafWildcard.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatMissingIntermediateCertificateInChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyPinCertificatesTestCase: ServerTrustPolicyTestCase { - - // MARK: Validate Certificate Chain Without Validating Host - - func testThatPinnedLeafCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificatePassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Validate Certificate Chain and Host - - func testThatPinnedLeafCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificatePassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: true, - validateHost: true - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - // MARK: Do NOT Validate Certificate Chain or Host - - func testThatPinnedLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedIntermediateCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinnedRootCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafCertificateNotInCertificateChainWithoutCertificateChainValidationFailsEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningIntermediateCertificateNotInCertificateChainWithoutCertificateChainValidationFailsEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let certificates = [TestCertificates.IntermediateCA1] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateCertificateWithExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootCertificateWithExpiredLeafCertificateWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let certificates = [TestCertificates.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningMultipleCertificatesWithoutCertificateChainValidationPassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - - let certificates = [ - TestCertificates.LeafMultipleDNSNames, // not in certificate chain - TestCertificates.LeafSignedByCA1, // not in certificate chain - TestCertificates.LeafExpired, // in certificate chain 👍🏼👍🏼 - TestCertificates.LeafWildcard, // not in certificate chain - TestCertificates.LeafDNSNameAndURI, // not in certificate chain - ] - - let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: certificates, - validateCertificateChain: false, - validateHost: false - ) - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyPinPublicKeysTestCase: ServerTrustPolicyTestCase { - - // MARK: Validate Certificate Chain Without Validating Host - - func testThatPinningLeafKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningKeyNotInCertificateChainFailsEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningBackupKeyPassesEvaluationWithoutHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA1, TestPublicKeys.IntermediateCA1, TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - // MARK: Validate Certificate Chain and Host - - func testThatPinningLeafKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningKeyNotInCertificateChainFailsEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningBackupKeyPassesEvaluationWithHostValidation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let publicKeys = [TestPublicKeys.LeafSignedByCA1, TestPublicKeys.IntermediateCA1, TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: true, - validateHost: true - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - // MARK: Do NOT Validate Certificate Chain or Host - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithMissingIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyWithoutCertificateChainValidationFailsEvaluationWithMissingIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithIncorrectIntermediateCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameWithIncorrectIntermediate.trust - let publicKeys = [TestPublicKeys.LeafValidDNSName] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningLeafKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.LeafExpired] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningIntermediateKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.IntermediateCA2] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatPinningRootKeyWithoutCertificateChainValidationPassesEvaluationWithExpiredLeafCertificate() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let publicKeys = [TestPublicKeys.RootCA] - let serverTrustPolicy = ServerTrustPolicy.PinPublicKeys( - publicKeys: publicKeys, - validateCertificateChain: false, - validateHost: false - ) - - // When - setRootCertificateAsLoneAnchorCertificateForTrust(serverTrust) - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyDisableEvaluationTestCase: ServerTrustPolicyTestCase { - func testThatCertificateChainMissingIntermediateCertificatePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSNameMissingIntermediate.trust - let serverTrustPolicy = ServerTrustPolicy.DisableEvaluation - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatExpiredLeafCertificatePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafExpired.trust - let serverTrustPolicy = ServerTrustPolicy.DisableEvaluation - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyCustomEvaluationTestCase: ServerTrustPolicyTestCase { - func testThatReturningTrueFromClosurePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.CustomEvaluation { _, _ in - return true - } - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertTrue(serverTrustIsValid, "server trust should pass evaluation") - } - - func testThatReturningFalseFromClosurePassesEvaluation() { - // Given - let host = "test.alamofire.org" - let serverTrust = TestTrusts.LeafValidDNSName.trust - let serverTrustPolicy = ServerTrustPolicy.CustomEvaluation { _, _ in - return false - } - - // When - let serverTrustIsValid = serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) - - // Then - XCTAssertFalse(serverTrustIsValid, "server trust should not pass evaluation") - } -} - -// MARK: - - -class ServerTrustPolicyCertificatesInBundleTestCase: ServerTrustPolicyTestCase { - func testOnlyValidCertificatesAreDetected() { - // Given - // Files present in bundle in the form of type+encoding+extension [key|cert][DER|PEM].[cer|crt|der|key|pem] - // certDER.cer: DER-encoded well-formed certificate - // certDER.crt: DER-encoded well-formed certificate - // certDER.der: DER-encoded well-formed certificate - // certPEM.*: PEM-encoded well-formed certificates, expected to fail: Apple API only handles DER encoding - // devURandomGibberish.crt: Random data, should fail - // keyDER.der: DER-encoded key, not a certificate, should fail - - // When - let certificates = ServerTrustPolicy.certificatesInBundle( - NSBundle(forClass: ServerTrustPolicyCertificatesInBundleTestCase.self) - ) - - // Then - // Expectation: 18 well-formed certificates in the test bundle plus 4 invalid certificates. - #if os(OSX) - // For some reason, OSX is allowing all certificates to be considered valid. Need to file a - // rdar demonstrating this behavior. - XCTAssertEqual(certificates.count, 22, "Expected 22 well-formed certificates") - #else - XCTAssertEqual(certificates.count, 18, "Expected 18 well-formed certificates") - #endif - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift deleted file mode 100644 index 6a1a3ab..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/String+AlamofireTests.swift +++ /dev/null @@ -1,31 +0,0 @@ -// NSURLSessionConfiguration+AlamofireTests.swift -// -// Copyright (c) 2014–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 Foundation - -extension String { - init(count: Int, repeatedString: String) { - var value = "" - for _ in 0.. SecCertificate { - class Bundle {} - let filePath = NSBundle(forClass: Bundle.self).pathForResource(fileName, ofType: "cer")! - let data = NSData(contentsOfFile: filePath)! - let certificate = SecCertificateCreateWithData(nil, data)! - - return certificate - } -} - -// MARK: - - -private struct TestPublicKeys { - static let RootCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.RootCA) - static let IntermediateCA = TestPublicKeys.publicKeyForCertificate(TestCertificates.IntermediateCA) - static let Leaf = TestPublicKeys.publicKeyForCertificate(TestCertificates.Leaf) - - static func publicKeyForCertificate(certificate: SecCertificate) -> SecKey { - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - SecTrustCreateWithCertificates(certificate, policy, &trust) - - let publicKey = SecTrustCopyPublicKey(trust!)! - - return publicKey - } -} - -// MARK: - - -class TLSEvaluationExpiredLeafCertificateTestCase: BaseTestCase { - let URL = "https://testssl-expire.disig.sk/" - let host = "testssl-expire.disig.sk" - var configuration: NSURLSessionConfiguration! - - // MARK: Setup and Teardown - - override func setUp() { - super.setUp() - configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - } - - // MARK: Default Behavior Tests - - func testThatExpiredCertificateRequestFailsWithNoServerTrustPolicy() { - // Given - weak var expectation = expectationWithDescription("\(URL)") - let manager = Manager(configuration: configuration) - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorServerCertificateUntrusted, "code should be untrusted server certficate") - } else { - XCTFail("error should be an NSError") - } - } - - // MARK: Server Trust Policy - Perform Default Tests - - func testThatExpiredCertificateRequestFailsWithDefaultServerTrustPolicy() { - // Given - let policies = [host: ServerTrustPolicy.PerformDefaultEvaluation(validateHost: true)] - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - // MARK: Server Trust Policy - Certificate Pinning Tests - - func testThatExpiredCertificateRequestFailsWhenPinningLeafCertificateWithCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestFailsWhenPinningAllCertificatesWithCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf, TestCertificates.IntermediateCA, TestCertificates.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningLeafCertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningIntermediateCACertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.IntermediateCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningRootCACertificateWithoutCertificateChainValidation() { - // Given - let certificates = [TestCertificates.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinCertificates(certificates: certificates, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Public Key Pinning Tests - - func testThatExpiredCertificateRequestFailsWhenPinningLeafPublicKeyWithCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: true, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningLeafPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.Leaf] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningIntermediateCAPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.IntermediateCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestSucceedsWhenPinningRootCAPublicKeyWithoutCertificateChainValidation() { - // Given - let publicKeys = [TestPublicKeys.RootCA] - let policies: [String: ServerTrustPolicy] = [ - host: .PinPublicKeys(publicKeys: publicKeys, validateCertificateChain: false, validateHost: true) - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Disabling Evaluation Tests - - func testThatExpiredCertificateRequestSucceedsWhenDisablingEvaluation() { - // Given - let policies = [host: ServerTrustPolicy.DisableEvaluation] - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - // MARK: Server Trust Policy - Custom Evaluation Tests - - func testThatExpiredCertificateRequestSucceedsWhenCustomEvaluationReturnsTrue() { - // Given - let policies = [ - host: ServerTrustPolicy.CustomEvaluation { _, _ in - // Implement a custom evaluation routine here... - return true - } - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatExpiredCertificateRequestFailsWhenCustomEvaluationReturnsFalse() { - // Given - let policies = [ - host: ServerTrustPolicy.CustomEvaluation { _, _ in - // Implement a custom evaluation routine here... - return false - } - ] - - let manager = Manager( - configuration: configuration, - serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies) - ) - - weak var expectation = expectationWithDescription("\(URL)") - var error: NSError? - - // When - manager.request(.GET, URL) - .response { _, _, _, responseError in - error = responseError - expectation?.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let code = error?.code { - XCTAssertEqual(code, NSURLErrorCancelled, "code should be cancelled") - } else { - XCTFail("error should be an NSError") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift deleted file mode 100644 index 11a2d32..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/URLProtocolTests.swift +++ /dev/null @@ -1,169 +0,0 @@ -// URLProtocolTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class ProxyURLProtocol: NSURLProtocol { - - // MARK: Properties - - struct PropertyKeys { - static let HandledByForwarderURLProtocol = "HandledByProxyURLProtocol" - } - - lazy var session: NSURLSession = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - - return configuration - }() - - let session = NSURLSession(configuration: configuration, delegate: self, delegateQueue: nil) - - return session - }() - - var activeTask: NSURLSessionTask? - - // MARK: Class Request Methods - - override class func canInitWithRequest(request: NSURLRequest) -> Bool { - if NSURLProtocol.propertyForKey(PropertyKeys.HandledByForwarderURLProtocol, inRequest: request) != nil { - return false - } - - return true - } - - override class func canonicalRequestForRequest(request: NSURLRequest) -> NSURLRequest { - return request - } - - override class func requestIsCacheEquivalent(a: NSURLRequest, toRequest b: NSURLRequest) -> Bool { - return false - } - - // MARK: Loading Methods - - override func startLoading() { - let mutableRequest = request.URLRequest - NSURLProtocol.setProperty(true, forKey: PropertyKeys.HandledByForwarderURLProtocol, inRequest: mutableRequest) - - activeTask = session.dataTaskWithRequest(mutableRequest) - activeTask?.resume() - } - - override func stopLoading() { - activeTask?.cancel() - } -} - -// MARK: - - -extension ProxyURLProtocol: NSURLSessionDelegate { - - // MARK: NSURLSessionDelegate - - func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - client?.URLProtocol(self, didLoadData: data) - } - - func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let response = task.response { - client?.URLProtocol(self, didReceiveResponse: response, cacheStoragePolicy: .NotAllowed) - } - - client?.URLProtocolDidFinishLoading(self) - } -} - -// MARK: - - -class URLProtocolTestCase: BaseTestCase { - - // MARK: Setup and Teardown Methods - - override func setUp() { - super.setUp() - - let configuration = Alamofire.Manager.sharedInstance.session.configuration - - configuration.protocolClasses = [ProxyURLProtocol.self] - configuration.HTTPAdditionalHeaders = ["Session-Configuration-Header": "foo"] - } - - override func tearDown() { - super.tearDown() - - Alamofire.Manager.sharedInstance.session.configuration.protocolClasses = [] - } - - // MARK: Tests - - func testThatURLProtocolReceivesRequestHeadersAndNotSessionConfigurationHeaders() { - // Given - let URLString = "https://httpbin.org/response-headers" - let URL = NSURL(string: URLString)! - let parameters = ["request-header": "foobar"] - - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.HTTPMethod = Method.GET.rawValue - - let URLRequest = ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 - - let expectation = expectationWithDescription("GET request should succeed") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - Alamofire.request(URLRequest) - .response { responseRequest, responseResponse, responseData, responseError in - request = responseRequest - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - if let headers = response?.allHeaderFields as? [String: String] { - XCTAssertEqual(headers["request-header"] ?? "", "foobar", "urlrequest-header should be foobar") - XCTAssertNil(headers["Session-Configuration-Header"], "Session-Configuration-Header should be nil") - } else { - XCTFail("headers should not be nil") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift b/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift deleted file mode 100644 index 7e2b901..0000000 --- a/Carthage/Checkouts/AlamofireImage/Carthage/Checkouts/Alamofire/Tests/UploadTests.swift +++ /dev/null @@ -1,766 +0,0 @@ -// UploadTests.swift -// -// Copyright (c) 2014–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 Alamofire -import Foundation -import XCTest - -class UploadFileInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndFile() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - - // When - let request = Alamofire.upload(.POST, URLString, file: imageURL) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndFile() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], file: imageURL) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadDataInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndData() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.upload(.POST, URLString, data: NSData()) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndData() { - // Given - let URLString = "https://httpbin.org/" - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], data: NSData()) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadStreamInitializationTestCase: BaseTestCase { - func testUploadClassMethodWithMethodURLAndStream() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - let imageStream = NSInputStream(URL: imageURL)! - - // When - let request = Alamofire.upload(.POST, URLString, stream: imageStream) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - XCTAssertNil(request.response, "response should be nil") - } - - func testUploadClassMethodWithMethodURLHeadersAndStream() { - // Given - let URLString = "https://httpbin.org/" - let imageURL = URLForResource("rainbow", withExtension: "jpg") - let imageStream = NSInputStream(URL: imageURL)! - - // When - let request = Alamofire.upload(.POST, URLString, headers: ["Authorization": "123456"], stream: imageStream) - - // Then - XCTAssertNotNil(request.request, "request should not be nil") - XCTAssertEqual(request.request?.HTTPMethod ?? "", "POST", "request HTTP method should be POST") - XCTAssertEqual(request.request?.URLString ?? "", URLString, "request URL string should be equal") - - let authorizationHeader = request.request?.valueForHTTPHeaderField("Authorization") ?? "" - XCTAssertEqual(authorizationHeader, "123456", "Authorization header is incorrect") - - XCTAssertNil(request.response, "response should be nil") - } -} - -// MARK: - - -class UploadDataTestCase: BaseTestCase { - func testUploadDataRequest() { - // Given - let URLString = "https://httpbin.org/post" - let data = "Lorem ipsum dolor sit amet".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - - let expectation = expectationWithDescription("Upload request should succeed: \(URLString)") - - var request: NSURLRequest? - var response: NSHTTPURLResponse? - var error: NSError? - - // When - Alamofire.upload(.POST, URLString, data: data) - .response { responseRequest, responseResponse, _, responseError in - request = responseRequest - response = responseResponse - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(request, "request should not be nil") - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNil(error, "error should be nil") - } - - func testUploadDataRequestWithProgress() { - // Given - let URLString = "https://httpbin.org/post" - let data: NSData = { - var text = "" - for _ in 1...3_000 { - text += "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " - } - - return text.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - }() - - let expectation = expectationWithDescription("Bytes upload progress should be reported: \(URLString)") - - var byteValues: [(bytes: Int64, totalBytes: Int64, totalBytesExpected: Int64)] = [] - var progressValues: [(completedUnitCount: Int64, totalUnitCount: Int64)] = [] - var responseRequest: NSURLRequest? - var responseResponse: NSHTTPURLResponse? - var responseData: NSData? - var responseError: ErrorType? - - // When - let upload = Alamofire.upload(.POST, URLString, data: data) - upload.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in - let bytes = (bytes: bytesWritten, totalBytes: totalBytesWritten, totalBytesExpected: totalBytesExpectedToWrite) - byteValues.append(bytes) - - let progress = ( - completedUnitCount: upload.progress.completedUnitCount, - totalUnitCount: upload.progress.totalUnitCount - ) - progressValues.append(progress) - } - upload.response { request, response, data, error in - responseRequest = request - responseResponse = response - responseData = data - responseError = error - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(responseRequest, "response request should not be nil") - XCTAssertNotNil(responseResponse, "response response should not be nil") - XCTAssertNotNil(responseData, "response data should not be nil") - XCTAssertNil(responseError, "response error should be nil") - - XCTAssertEqual(byteValues.count, progressValues.count, "byteValues count should equal progressValues count") - - if byteValues.count == progressValues.count { - for index in 0.. Request { - var dataTask: NSURLSessionDataTask! - - dispatch_sync(queue) { - dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) - } - - let request = MockRequest(session: session, task: dataTask) - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - } - - class MockRequest: Request { - override var response: NSHTTPURLResponse? { - return MockHTTPURLResponse( - URL: NSURL(string: request!.URLString)!, - statusCode: 204, - HTTPVersion: "HTTP/1.1", - headerFields: nil - ) - } - } - - class MockHTTPURLResponse: NSHTTPURLResponse { - override var MIMEType: String? { return nil } - } - - let manager: Manager = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders - - return configuration - }() - - return MockManager(configuration: configuration) - }() - - let URLString = "https://httpbin.org/delete" - let expectation = expectationWithDescription("request should be stubbed and return 204 status code") - - var response: NSHTTPURLResponse? - var data: NSData? - var error: NSError? - - // When - manager.request(.DELETE, URLString) - .validate(contentType: ["*/*"]) - .response { _, responseResponse, responseData, responseError in - response = responseResponse - data = responseData - error = responseError - - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(data, "data should not be nil") - XCTAssertNil(error, "error should be nil") - - if let response = response { - XCTAssertEqual(response.statusCode, 204, "response status code should be 204") - XCTAssertNil(response.MIMEType, "response mime type should be nil") - } - } -} - -// MARK: - - -class MultipleValidationTestCase: BaseTestCase { - func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() { - // Given - let URLString = "https://httpbin.org/ip" - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponseFailsWithStatusCodeError() { - // Given - let URLString = "https://httpbin.org/xml" - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(statusCode: 400..<600) - .validate(contentType: ["application/octet-stream"]) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.StatusCodeValidationFailed.rawValue, "code should be status code validation failure") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatValidationForRequestWithUnacceptableStatusCodeAndContentTypeResponseFailsWithContentTypeError() { - // Given - let URLString = "https://httpbin.org/xml" - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate(contentType: ["application/octet-stream"]) - .validate(statusCode: 400..<600) - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.ContentTypeValidationFailed.rawValue, "code should be content type validation failure") - } else { - XCTFail("error should be an NSError") - } - } -} - -// MARK: - - -class AutomaticValidationTestCase: BaseTestCase { - func testThatValidationForRequestWithAcceptableStatusCodeAndContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/ip")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableStatusCodeResponseFails() { - // Given - let URLString = "https://httpbin.org/status/404" - let expectation = expectationWithDescription("request should return 404 status code") - - var error: NSError? - - // When - Alamofire.request(.GET, URLString) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.StatusCodeValidationFailed.rawValue, "code should be status code validation failure") - } else { - XCTFail("error should be an NSError") - } - } - - func testThatValidationForRequestWithAcceptableWildcardContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/ip")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/*", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return ip") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithAcceptableComplexContentTypeResponseSucceeds() { - // Given - let URL = NSURL(string: "https://httpbin.org/xml")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - - let headerValue = "text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8,*/*;q=0.5" - mutableURLRequest.setValue(headerValue, forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNil(error, "error should be nil") - } - - func testThatValidationForRequestWithUnacceptableContentTypeResponseFails() { - // Given - let URL = NSURL(string: "https://httpbin.org/xml")! - let mutableURLRequest = NSMutableURLRequest(URL: URL) - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Accept") - - let expectation = expectationWithDescription("request should succeed and return xml") - - var error: NSError? - - // When - Alamofire.request(mutableURLRequest) - .validate() - .response { _, _, _, responseError in - error = responseError - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(error, "error should not be nil") - - if let error = error { - XCTAssertEqual(error.domain, Error.Domain, "domain should be Alamofire error domain") - XCTAssertEqual(error.code, Error.Code.ContentTypeValidationFailed.rawValue, "code should be content type validation failure") - } else { - XCTFail("error should be an NSError") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Documentation/AlamofireImage 2.0 Migration Guide.md b/Carthage/Checkouts/AlamofireImage/Documentation/AlamofireImage 2.0 Migration Guide.md deleted file mode 100644 index e7992e5..0000000 --- a/Carthage/Checkouts/AlamofireImage/Documentation/AlamofireImage 2.0 Migration Guide.md +++ /dev/null @@ -1,105 +0,0 @@ -# AlamofireImage 2.0 Migration Guide - -AlamofireImage 2.0 is the latest major release of AlamofireImage, an image component library for Alamofire supporting iOS, Mac OS X and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 2.0 introduces several API-breaking changes that one should be aware of. - -This guide is provided in order to ease the transition of existing applications using Alamofire 2.x to the latest APIs, as well as explain the design and structure of new and changed functionality. - -## Requirements - -AlamofireImage 2.0 officially supports iOS 8+, Mac OS X 10.9+, watchOS 2.0, Xcode 7 and Swift 2.0. - -## Reasons for Bumping to 2.0 - -The [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) (ASF) tries to do everything possible to avoid MAJOR version bumps. We realize the challenges involved with migrating large projects from one MAJOR version to another. The reason for bumping to 2.0 is due to the Alamofire 3.0 changes. We want to keep both libraries in sync, which requires changes to the foundational classes of AlamofireImage. The changes made to Alamofire give us more flexibility moving forward to help avoid the need for MAJOR version bumps to maintain backwards compatibility. - -## Benefits of Upgrading - -The benefits of upgrading can be summarized as follows: - -* Can be used in conjunction with Alamofire 3.0 -* Leverages generic `Response` types for all `Request` completion closures. -* Image download request cancellation logic is now much more intelligent thanks to the new `RequestReceipt` struct allowing MUCH better optimization for table and collection view use cases. - ---- - -## Breaking API Changes - -AlamofireImage 2.0 contains some breaking API changes to the foundational classes supporting the response serialization system. It is important to understand how these changes affect the common usage patterns. - -### Request Extension - -The `Request` extension has been modified to support the Alamofire 3.0 `ResponseSerializer` changes. All `responseImage` methods now use a `completionHandler` of type `Response -> Void` matching all response serializers located in the Alamofire core library. - -```swift -public func responseImage( - imageScale: CGFloat = Request.imageScale, - inflateResponseImage: Bool = true, - completionHandler: Response -> Void) - -> Self -{ - return response( - responseSerializer: Request.imageResponseSerializer( - imageScale: imageScale, - inflateResponseImage: inflateResponseImage - ), - completionHandler: completionHandler - ) -} -``` - -> There are no actual changes in functionality in terms of the `responseImage` serializers. - -### Image Downloader - -#### Completion Handler - -The `CompletionHandler` typealias in the `ImageDownloader` has been modified to a `Response` type to match the Alamofire 3.0 APIs. - -```swift -public class ImageDownloader { - public typealias CompletionHandler = Response -> Void -} -``` - -#### Request Receipts - -The `downloadImage` APIs now return a `RequestReceipt?` instead of a `Request?`. The main reason for this change was to allow the `ImageDownloader` to be more intelligent about cancelling active requests. Here are some of the questions we asked ourselves when designing this new system: - -Should a download request be cancelled... - -* If it is pending in the queue? - * `YES` -* If it is actively being downloaded? - * `NO` - The completion handler should be called with a cancellation error while the request is allowed to complete. -* If there are multiple response handlers attached to the same request? - * `NO` - The completion handler should be called with a cancellation error while the request is allowed to complete since the other callers also depend on the same request. - -In order to be able to support the third case, the `ImageDownloader` needed a way to identify multiple response handlers attached to a single `Request`. The `RequestReceipt` solves this problem by associating a `receiptID` with each download request. Each call to `downloadImage` generates a new, unique `receiptID` which can in turn be used to cancel a request. - -```swift -public class RequestReceipt { - public let request: Request - public let receiptID: String -} -``` - -The `cancelRequestForRequestReceipt` method on the `ImageDownloader` handles all three cancellation cases internally. By always cancelling requests using the `RequestReceipt` APIs, your download requests will much better optimized for table and collection view use cases. - - -### UIImageView Extension - -The only changes to the `UIImageView` extension in terms of backwards compatibility is the `completion` closure signature that now leverages the new Alamofire 3.0 `Response` type. - -```swift -public func af_setImageWithURLRequest( - URLRequest: URLRequestConvertible, - placeholderImage: UIImage?, - filter: ImageFilter?, - imageTransition: ImageTransition, - completion: (Response -> Void)?) -{ - ... -} -``` - -Another change worth noting is the `UIImageView` extension now leverages `RequestReceipt` objects for cancelling the active request. This greatly improves overall performance and behavior for image views used in table and collection views. diff --git a/Carthage/Checkouts/AlamofireImage/Example/AppDelegate.swift b/Carthage/Checkouts/AlamofireImage/Example/AppDelegate.swift deleted file mode 100644 index 11a9ef4..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/AppDelegate.swift +++ /dev/null @@ -1,45 +0,0 @@ -// AppDelegate.swift -// -// Copyright (c) 2015 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 Foundation -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - // MARK: - Application State Methods - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - window = { - let window = UIWindow(frame: UIScreen.mainScreen().bounds) - - window.rootViewController = UINavigationController(rootViewController: ImagesViewController()) - window.backgroundColor = UIColor.whiteColor() - window.makeKeyAndVisible() - - return window - }() - - return true - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Example/Base.lproj/LaunchScreen.xib b/Carthage/Checkouts/AlamofireImage/Example/Base.lproj/LaunchScreen.xib deleted file mode 100644 index 85bb703..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/Example/Gravatar.swift b/Carthage/Checkouts/AlamofireImage/Example/Gravatar.swift deleted file mode 100644 index 42cb6aa..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/Gravatar.swift +++ /dev/null @@ -1,113 +0,0 @@ -// Gravatar.swift -// -// Copyright (c) 2015 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 Foundation -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 digestLength = Int(CC_MD5_DIGEST_LENGTH) - let result = UnsafeMutablePointer.alloc(digestLength) - - CC_MD5(utf8String, stringLength, result) - - var hash = "" - - for i in 0.. NSURL { - let URL = Gravatar.baseURL.URLByAppendingPathComponent(email.md5_hash) - let components = NSURLComponents(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))) - - components.queryItems = queryItems - - return components.URL! - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Example/ImageCell.swift b/Carthage/Checkouts/AlamofireImage/Example/ImageCell.swift deleted file mode 100644 index e5eddcb..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/ImageCell.swift +++ /dev/null @@ -1,76 +0,0 @@ -// ImageCell.swift -// -// Copyright (c) 2015 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 Alamofire -import AlamofireImage -import Foundation -import UIKit - -class ImageCell : UICollectionViewCell { - class var ReuseIdentifier: String { return "com.alamofire.identifier.\(self.dynamicType)" } - let imageView: UIImageView - - // MARK: - Initialization - - override init(frame: CGRect) { - imageView = { - let imageView = UIImageView(frame: frame) - - imageView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] - imageView.contentMode = .Center - imageView.clipsToBounds = true - - return imageView - }() - - super.init(frame: frame) - - contentView.addSubview(imageView) - - imageView.frame = contentView.bounds - } - - required init(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Lifecycle Methods - - func configureCellWithURLString(URLString: String, placeholderImage: UIImage) { - let size = imageView.frame.size - - imageView.af_setImageWithURL( - NSURL(string: URLString)!, - placeholderImage: placeholderImage, - filter: AspectScaledToFillSizeWithRoundedCornersFilter(size: size, radius: 20.0), - imageTransition: .CrossDissolve(0.2) - ) - } - - override func prepareForReuse() { - super.prepareForReuse() - - imageView.af_cancelImageRequest() - imageView.layer.removeAllAnimations() - imageView.image = nil - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Example/ImageViewController.swift b/Carthage/Checkouts/AlamofireImage/Example/ImageViewController.swift deleted file mode 100644 index bad69fd..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/ImageViewController.swift +++ /dev/null @@ -1,66 +0,0 @@ -// ImageViewController.swift -// -// Copyright (c) 2015 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 AlamofireImage -import Foundation -import UIKit - -class ImageViewController : UIViewController { - var gravatar: Gravatar! - var imageView: UIImageView! - - // MARK: - View Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - - setUpInstanceProperties() - setUpImageView() - } - - // MARK: - Private - Setup Methods - - private func setUpInstanceProperties() { - title = gravatar.email - edgesForExtendedLayout = UIRectEdge.None - view.backgroundColor = UIColor(white: 0.9, alpha: 1.0) - } - - private func setUpImageView() { - imageView = UIImageView() - imageView.contentMode = .ScaleAspectFit - - let URL = gravatar.URL(size: view.bounds.size.width) - - imageView.af_setImageWithURL( - URL, - placeholderImage: nil, - filter: CircleFilter(), - imageTransition: .FlipFromBottom(0.5) - ) - - view.addSubview(imageView) - - imageView.frame = view.bounds - imageView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/AppIcon.appiconset/Contents.json b/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Contents.json b/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Contents.json deleted file mode 100644 index 77f26aa..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "Placeholder Image.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "Placeholder Image@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "Placeholder Image@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image.png b/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image.png deleted file mode 100644 index 422d091..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@2x.png b/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@2x.png deleted file mode 100644 index ce88e03..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@3x.png b/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@3x.png deleted file mode 100644 index e10a6ff..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Example/Images.xcassets/Placeholder Image.imageset/Placeholder Image@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Example/ImagesViewController.swift b/Carthage/Checkouts/AlamofireImage/Example/ImagesViewController.swift deleted file mode 100644 index 37183fc..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/ImagesViewController.swift +++ /dev/null @@ -1,157 +0,0 @@ -// ImagesViewController.swift -// -// Copyright (c) 2015 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 Alamofire -import AlamofireImage -import Foundation -import UIKit - -class ImagesViewController: UIViewController { - lazy var gravatars: [Gravatar] = [] - - lazy var placeholderImage: UIImage = { - let image = UIImage(named: "Placeholder Image")! - return image - }() - - var collectionView: UICollectionView! - - // MARK: View Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - - setUpInstanceProperties() - setUpCollectionView() - } - - // MARK: Private - Setup - - private func setUpInstanceProperties() { - title = "Random Images" - - for _ in 1...1_000 { - let gravatar = Gravatar( - emailAddress: NSUUID().UUIDString, - defaultImage: Gravatar.DefaultImage.Identicon, - forceDefault: true - ) - - gravatars.append(gravatar) - } - } - - private func setUpCollectionView() { - collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout: UICollectionViewFlowLayout()) - collectionView.backgroundColor = UIColor.whiteColor() - - collectionView.delegate = self - collectionView.dataSource = self - - collectionView.registerClass(ImageCell.self, forCellWithReuseIdentifier: ImageCell.ReuseIdentifier) - - view.addSubview(self.collectionView) - - collectionView.frame = self.view.bounds - collectionView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] - } - - private func sizeForCollectionViewItem() -> CGSize { - let viewWidth = view.bounds.size.width - - var cellWidth = (viewWidth - 4 * 8) / 3.0 - - if UIDevice.currentDevice().userInterfaceIdiom == .Pad { - cellWidth = (viewWidth - 7 * 8) / 6.0 - } - - return CGSize(width: cellWidth, height: cellWidth) - } -} - -// MARK: - UICollectionViewDataSource - -extension ImagesViewController : UICollectionViewDataSource { - func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return gravatars.count - } - - func collectionView( - collectionView: UICollectionView, - cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell - { - let cell = collectionView.dequeueReusableCellWithReuseIdentifier(ImageCell.ReuseIdentifier, forIndexPath: indexPath) as! ImageCell - let gravatar = gravatars[indexPath.row] - cell.configureCellWithURLString(gravatar.URL(size: sizeForCollectionViewItem().width).URLString, placeholderImage: placeholderImage) - - return cell - } -} - -// MARK: - UICollectionViewDelegateFlowLayout - -extension ImagesViewController : UICollectionViewDelegateFlowLayout { - func collectionView( - collectionView: UICollectionView, - layout collectionViewLayout: UICollectionViewLayout, - sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize - { - return sizeForCollectionViewItem() - } - - func collectionView( - collectionView: UICollectionView, - layout collectionViewLayout: UICollectionViewLayout, - insetForSectionAtIndex section: Int) -> UIEdgeInsets - { - return UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8) - } - - func collectionView( - collectionView: UICollectionView, - layout collectionViewLayout: UICollectionViewLayout, - minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat - { - return 8.0 - } - - func collectionView( - collectionView: UICollectionView, - layout collectionViewLayout: UICollectionViewLayout, - minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat - { - return 8.0 - } -} - -// MARK: - UICollectionViewDelegate - -extension ImagesViewController : UICollectionViewDelegate { - func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { - let gravatar = self.gravatars[indexPath.row] - - let imageViewController = ImageViewController() - imageViewController.gravatar = gravatar - - self.navigationController?.pushViewController(imageViewController, animated: true) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Example/Info.plist b/Carthage/Checkouts/AlamofireImage/Example/Info.plist deleted file mode 100644 index 2d4f401..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - AFImage - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown - - - diff --git a/Carthage/Checkouts/AlamofireImage/Example/iOS-Example-Bridging-Header.h b/Carthage/Checkouts/AlamofireImage/Example/iOS-Example-Bridging-Header.h deleted file mode 100644 index f7872be..0000000 --- a/Carthage/Checkouts/AlamofireImage/Example/iOS-Example-Bridging-Header.h +++ /dev/null @@ -1,23 +0,0 @@ -// iOS-Example-Bridging-Header.h -// -// Copyright (c) 2015 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 diff --git a/Carthage/Checkouts/AlamofireImage/LICENSE b/Carthage/Checkouts/AlamofireImage/LICENSE deleted file mode 100644 index 4fe9ec9..0000000 --- a/Carthage/Checkouts/AlamofireImage/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-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. diff --git a/Carthage/Checkouts/AlamofireImage/Package.swift b/Carthage/Checkouts/AlamofireImage/Package.swift deleted file mode 100644 index d89597c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Package.swift +++ /dev/null @@ -1,30 +0,0 @@ -// Package.swift -// -// Copyright (c) 2015-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 PackageDescription - -let package = Package( - name: "AlamofireImage", - dependencies: [ - .Package(url: "https://github.com/Alamofire/Alamofire.git", versions: Version(3, 1, 5).. CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+. - -To integrate AlamofireImage into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -use_frameworks! - -pod 'AlamofireImage', '~> 2.0' -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### 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 AlamofireImage into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/AlamofireImage" ~> 2.0 -``` - ---- - -## Usage - -### Image Response Serializers - -```swift -import AlamofireImage - -Alamofire.request(.GET, "https://httpbin.org/image/png") - .responseImage { response in - debugPrint(response) - - print(response.request) - print(response.response) - debugPrint(response.result) - - if let image = response.result.value { - print("image downloaded: \(image)") - } - } -``` - -The AlamofireImage response image serializers support a wide range of image types including: - -- `image/png` -- `image/jpeg` -- `image/tiff` -- `image/gif` -- `image/ico` -- `image/x-icon` -- `image/bmp` -- `image/x-bmp` -- `image/x-xbitmap` -- `image/x-win-bitmap` - -> If the image you are attempting to download is an invalid MIME type not in the list, you can add custom acceptable content types using the `addAcceptableImageContentTypes` extension on the `Request` type. - -### UIImage Extensions - -There are several `UIImage` extensions designed to make the common image manipulation operations as simple as possible. - -#### Inflation - -```swift -let URL = NSBundle.mainBundle().URLForResource("unicorn", withExtension: "png")! -let data = NSData(contentsOfURL: URL)! -let image = UIImage(data: data, scale: UIScreen.mainScreen().scale)! - -image.af_inflate() -``` - -> Inflating compressed image formats (such as PNG or JPEG) in a background queue can significantly improve drawing performance on the main thread. - -#### Scaling - -```swift -let image = UIImage(named: "unicorn")! -let size = CGSize(width: 100.0, height: 100.0) - -// Scale image to size disregarding aspect ratio -let scaledImage = image.af_imageScaledToSize(size) - -// Scale image to fit within specified size while maintaining aspect ratio -let aspectScaledToFitImage = image.af_imageAspectScaledToFitSize(size) - -// Scale image to fill specified size while maintaining aspect ratio -let aspectScaledToFillImage = image.af_imageAspectScaledToFillSize(size) -``` - -#### Rounded Corners - -```swift -let image = UIImage(named: "unicorn")! -let radius: CGFloat = 20.0 - -let roundedImage = image.af_imageWithRoundedCornerRadius(radius) -let circularImage = image.af_imageRoundedIntoCircle() -``` - -#### Core Image Filters - -```swift -let image = UIImage(named: "unicorn")! - -let sepiaImage = image.af_imageWithAppliedCoreImageFilter("CISepiaTone") -let blurredImage = image.af_imageWithAppliedCoreImageFilter( - "CIGaussianBlur", - filterParameters: ["inputRadius": 25] -) -``` - -### Image Filters - -The `ImageFilter` protocol was designed to make it easy to apply a filter operation and cache the result after an image finished downloading. It defines two properties to facilitate this functionality. - -```swift -public protocol ImageFilter { - var filter: Image -> Image { get } - var identifier: String { get } -} -``` - -The `filter` closure contains the operation used to create a modified version of the specified image. The `identifier` property is a string used to uniquely identify the filter operation. This is useful when adding filtered versions of an image to a cache. All identifier properties inside AlamofireImage are implemented using protocol extensions. - -#### Single Pass - -The single pass image filters only perform a single operation on the specified image. - -```swift -let image = UIImage(named: "unicorn")! -let imageFilter = RoundedCornersFilter(radius: 10.0) - -let roundedImage = imageFilter.filter(image) -``` - -The current list of single pass image filters includes: - -- `ScaledToSizeFilter` - Scales an image to a specified size. -- `AspectScaledToFitSizeFilter` - Scales an image from the center while maintaining the aspect ratio to fit within a specified size. -- `AspectScaledToFillSizeFilter` - Scales an image from the center while maintaining the aspect ratio to fill a specified size. Any pixels that fall outside the specified size are clipped. -- `RoundedCornersFilter` - Rounds the corners of an image to the specified radius. -- `CircleFilter` - Rounds the corners of an image into a circle. -- `BlurFilter` - Blurs an image using a `CIGaussianBlur` filter with the specified blur radius. - -> Each image filter is built ontop of the `UIImage` extensions. - -#### Multi-Pass - -The multi-pass image filters perform multiple operations on the specified image. - -```swift -let image = UIImage(named: "avatar")! -let size = CGSize(width: 100.0, height: 100.0) -let imageFilter = AspectScaledToFillSizeCircleFilter(size: size) - -let avatarImage = imageFilter.filter(image) -``` - -The current list of multi-pass image filters includes: - -- `ScaledToSizeWithRoundedCornersFilter` - Scales an image to a specified size, then rounds the corners to the specified radius. -- `AspectScaledToFillSizeWithRoundedCornersFilter` - Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the corners to the specified radius. -- `ScaledToSizeCircleFilter` - Scales an image to a specified size, then rounds the corners into a circle. -- `AspectScaledToFillSizeCircleFilter` - Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the corners into a circle. - -### Image Cache - -Image caching can become complicated when it comes to network images. `NSURLCache` is quite powerful and does a great job reasoning through the various cache policies and `Cache-Control` headers. However, it is not equiped to handle caching multiple modified versions of those images. - -For example, let's say you need to download an album of images. Your app needs to display both the thumbnail version as well as the full size version at various times. Due to performance issues, you want to scale down the thumbnails to a reasonable size before rendering them on-screen. You also need to apply a global CoreImage filter to the full size images when displayed. While `NSURLCache` can easily handle storing the original downloaded image, it cannot store these different variants. What you really need is another caching layer designed to handle these different variants. - -```swift -let imageCache = AutoPurgingImageCache( - memoryCapacity: 100 * 1024 * 1024, - preferredMemoryUsageAfterPurge: 60 * 1024 * 1024 -) -``` - -The `AutoPurgingImageCache` in AlamofireImage fills the role of that additional caching layer. It is an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. - -#### Add / Remove / Fetch Images - -Interacting with the `ImageCache` protocol APIs is very straightforward. - -```swift -let imageCache = AutoPurgingImageCache() -let avatarImage = UIImage(data: data)! - -// Add -imageCache.addImage(avatarImage, withIdentifier: "avatar") - -// Fetch -let cachedAvatar = imageCache.imageWithIdentifier("avatar") - -// Remove -imageCache.removeImageWithIdentifier("avatar") -``` - -#### URL Requests - -The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding support for `NSURLRequest` caching. This allows an `NSURLRequest` and additional identifier to generate the unique identifier for the image in the cache. - -```swift -let imageCache = AutoPurgingImageCache() - -let URLRequest = NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/png")!) -let avatarImage = UIImage(named: "avatar")!.af_imageRoundedIntoCircle() - -// Add -imageCache.addImage( - avatarImage, - forRequest: URLRequest, - withAdditionalIdentifier: "circle" -) - -// Fetch -let cachedAvatarImage = imageCache.imageForRequest( - URLRequest, - withAdditionalIdentifier: "circle" -) - -// Remove -imageCache.removeImageForRequest( - URLRequest, - withAdditionalIdentifier: "circle" -) -``` - -#### Auto-Purging - -Each time an image is fetched from the cache, the cache internally updates the last access date for that image. - -```swift -let avatar = imageCache.imageWithIdentifier("avatar") -let circularAvatar = imageCache.imageForRequest( - URLRequest, - withIdentifier: "circle" -) -``` - -By updating the last access date for each image, the image cache can make more informed decisions about which images to purge when the memory capacity is reached. The `AutoPurgingImageCache` automatically evicts images from the cache in order from oldest last access date to newest until the memory capacity drops below the `preferredMemoryCapacityAfterPurge`. - -> It is important to set reasonable default values for the `memoryCapacity` and `preferredMemoryCapacityAfterPurge` when you are initializing your image cache. By default, the `memoryCapacity` equals 100 MB and the `preferredMemoryCapacityAfterPurge` equals 60 MB. - -#### Memory Warnings - -The `AutoPurgingImageCache` also listens for memory warnings from your application and will purge all images from the cache if a memory warning is observed. - -### Image Downloader - -The `ImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. It uses an internal Alamofire `Manager` instance to handle all the downloading and response image serialization. By default, the initialization of an `ImageDownloader` uses a default `NSURLSessionConfiguration` with the most common parameter values. - -```swift -let imageDownloader = ImageDownloader( - configuration: ImageDownloader.defaultURLSessionConfiguration(), - downloadPrioritization: .FIFO, - maximumActiveDownloads: 4, - imageCache: AutoPurgingImageCache() -) -``` - -> If you need to customize the `NSURLSessionConfiguration` type or parameters, then simply provide your own rather than using the default. - -#### Downloading an Image - -```swift -let downloader = ImageDownloader() -let URLRequest = NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/jpeg")!) - -downloader.downloadImage(URLRequest: URLRequest) { response in - print(response.request) - print(response.response) - debugPrint(response.result) - - if let image = response.result.value { - print(image) - } -} -``` - -> Make sure to keep a strong reference to the `ImageDownloader` instance, otherwise the `completion` closure will not be called because the `downloader` reference will go out of scope before the `completion` closure can be called. - -#### Applying an ImageFilter - -```swift -let downloader = ImageDownloader() -let URLRequest = NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/jpeg")!) -let filter = AspectScaledToFillSizeCircleFilter(size: CGSize(width: 100.0, height: 100.0)) - -downloader.downloadImage(URLRequest: URLRequest, filter: filter) { response in - print(response.request) - print(response.response) - debugPrint(response.result) - - if let image = response.result.value { - print(image) - } -} -``` - -#### Authentication - -If your images are behind HTTP Basic Auth, you can append the `user:password:` or the `credential` to the `ImageDownloader` instance. The credentials will be applied to all future download requests. - -```swift -let downloader = ImageDownloader() -downloader.addAuthentication(user: "username", password: "password") -``` - -#### Download Prioritization - -The `ImageDownloader` maintains an internal queue of pending download requests. Depending on your situation, you may want incoming downloads to be inserted at the front or the back of the queue. The `DownloadPrioritization` enumeration allows you to specify which behavior you would prefer. - -```swift -public enum DownloadPrioritization { - case FIFO, LIFO -} -``` - -> The `ImageDownloader` is initialized with a `.FIFO` queue by default. - -#### Image Caching - -The `ImageDownloader` uses a combination of an `NSURLCache` and `AutoPurgingImageCache` to create a very robust, high performance image caching system. - -##### NSURLCache - -The `NSURLCache` is used to cache all the original image content downloaded from the server. By default, it is initialized with a memory capacity of 20 MB and a disk capacity of 150 MB. This allows up to 150 MB of original image data to be stored on disk at any given time. While these defaults have been carefully set, it is very important to consider your application's needs and performance requirements and whether these values are right for you. - -> If you wish to disable this caching layer, create a custom `NSURLSessionConfiguration` with the `URLCache` property set to `nil` and use that configuration when initializing the `ImageDownloader`. - -##### Image Cache - -The `ImageCache` is used to cache all the potentially filtered image content after it has been downloaded from the server. This allows multiple variants of the same image to also be cached, rather than having to re-apply the image filters to the original image each time it is required. By default, an `AutoPurgingImageCache` is initialized with a memory capacity of 100 MB and a preferred memory usage after purge limit of 60 MB. This allows up to 100 MB of most recently accessed filtered image content to be stored in-memory at a given time. - -##### Setting Ideal Capacity Limits - -Determining the ideal the in-memory and on-disk capacity limits of the `NSURLCache` and `AutoPurgingImageCache` requires a bit of forethought. You must carefully consider your application's needs, and tailor the limits accordingly. By default, the combination of caches offers the following storage capacities: - -- 150 MB of on-disk storage -- 20 MB of in-memory original image data storage -- 100 MB of in-memory storage of filtered image content -- 60 MB preferred memory capacity after purge of filtered image content - -> If you do not use image filters, it is advised to set the memory capacity of the `NSURLCache` to zero to avoid storing the same content in-memory twice. - -#### Duplicate Downloads - -Sometimes application logic can end up attempting to download an image more than once before the initial download request is complete. Most often, this results in the image being downloaded more than once. AlamofireImage handles this case elegantly by merging the duplicate downloads. The image will only be downloaded once, yet both completion handlers will be called. - -##### Image Filter Reuse - -In addition to merging duplicate downloads, AlamofireImage can also merge duplicate image filters. If two image filters with the same identifier are attached to the same download, the image filter is only executed once and both completion handlers are called with the same resulting image. This can save large amounts of time and resources for computationally expensive filters such as ones leveraging CoreImage. - -##### Request Receipts - -Sometimes it is necessary to cancel an image download for various reasons. AlamofireImage can intelligently handle cancellation logic in the `ImageDownloader` by leveraging the `RequestReceipt` type along with the `cancelRequestForRequestReceipt` method. Each download request vends a `RequestReceipt` which can be later used to cancel the request. - -By cancelling the request through the `ImageDownloader` using the `RequestReceipt`, AlamofireImage is able to determine how to best handle the cancellation. The cancelled download will always receive a cancellation error, while duplicate downloads are allowed to complete. If the download is already active, it is allowed to complete even though the completion handler will be called with a cancellation error. This greatly improves performance of table and collection views displaying large amounts of images. - -> It is NOT recommended to directly call `cancel` on the `request` in the `RequestReceipt`. Doing so can lead to issues such as duplicate downloads never being allowed to complete. - -### UIImageView Extension - -The [UIImage Extensions](#uiimage-extensions), [Image Filters](#image-filters), [Image Cache](#image-cache) and [Image Downloader](#image-downloader) were all designed to be flexible and standalone, yet also to provide the foundation of the `UIImageView` extension. Due to the powerful support of these classes, protocols and extensions, the `UIImageView` APIs are concise, easy to use and contain a large amount of functionality. - -#### Setting Image with URL - -Setting the image with a URL will asynchronously download the image and set it once the request is finished. - -```swift -let imageView = UIImageView(frame: frame) -let URL = NSURL(string: "https://httpbin.org/image/png")! - -imageView.af_setImageWithURL(URL) -``` - -> If the image is cached locally, the image is set immediately. - -#### Placeholder Images - -By specifying a placeholder image, the image view uses the placeholder image until the remote image is downloaded. - -```swift -let imageView = UIImageView(frame: frame) -let URL = NSURL(string: "https://httpbin.org/image/png")! -let placeholderImage = UIImage(named: "placeholder")! - -imageView.af_setImageWithURL(URL, placeholderImage: placeholderImage) -``` - -> If the remote image is cached locally, the placeholder image is never set. - -#### Image Filters - -If an image filter is specified, it is applied asynchronously after the remote image is downloaded. Once the filter execution is complete, the resulting image is set on the image view. - -```swift -let imageView = UIImageView(frame: frame) - -let URL = NSURL(string: "https://httpbin.org/image/png")! -let placeholderImage = UIImage(named: "placeholder")! - -let filter = AspectScaledToFillSizeWithRoundedCornersFilter( - size: imageView.frame.size, - radius: 20.0 -) - -imageView.af_setImageWithURL( - URL, - placeholderImage: placeholderImage, - filter: filter -) -``` - -> If the remote image with the applied filter is cached locally, the image is set immediately. - -#### Image Transitions - -By default, there is no image transition animation when setting the image on the image view. If you wish to add a cross dissolve or flip-from-bottom animation, then specify an `ImageTransition` with the preferred duration. - -```swift -let imageView = UIImageView(frame: frame) - -let URL = NSURL(string: "https://httpbin.org/image/png")! -let placeholderImage = UIImage(named: "placeholder")! - -let filter = AspectScaledToFillSizeWithRoundedCornersFilter( - size: imageView.frame.size, - radius: 20.0 -) - -imageView.af_setImageWithURL( - URL, - placeholderImage: placeholderImage, - filter: filter, - imageTransition: .CrossDissolve(0.2) -) -``` - -> If the remote image is cached locally, the image transition is ignored. - -#### Image Downloader - -The `UIImageView` extension is powered by the default `ImageDownloader` instance. To customize cache capacities, download priorities, request cache policies, timeout durations, etc., please refer to the [Image Downloader](#image-downloader) documentation. - -##### Authentication - -If an image requires and authentication credential from the `UIImageView` extension, it can be provided as follows: - -```swift -ImageDownloader.defaultInstance.addAuthentication( - user: "user", - password: "password" -) -``` - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with AlamofireImage, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## License - -AlamofireImage is released under the MIT license. See LICENSE for details. diff --git a/Carthage/Checkouts/AlamofireImage/Source/AlamofireImage.h b/Carthage/Checkouts/AlamofireImage/Source/AlamofireImage.h deleted file mode 100644 index 58220a9..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/AlamofireImage.h +++ /dev/null @@ -1,26 +0,0 @@ -// AlamofireImage.h -// -// Copyright (c) 2015-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 - -FOUNDATION_EXPORT double AlamofireImageVersionNumber; -FOUNDATION_EXPORT const unsigned char AlamofireImageVersionString[]; diff --git a/Carthage/Checkouts/AlamofireImage/Source/Image.swift b/Carthage/Checkouts/AlamofireImage/Source/Image.swift deleted file mode 100644 index 6c349bf..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/Image.swift +++ /dev/null @@ -1,31 +0,0 @@ -// Image.swift -// -// Copyright (c) 2015-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 Foundation - -#if os(iOS) || os(tvOS) || os(watchOS) -import UIKit -public typealias Image = UIImage -#elseif os(OSX) -import Cocoa -public typealias Image = NSImage -#endif diff --git a/Carthage/Checkouts/AlamofireImage/Source/ImageCache.swift b/Carthage/Checkouts/AlamofireImage/Source/ImageCache.swift deleted file mode 100644 index 0340a9c..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/ImageCache.swift +++ /dev/null @@ -1,330 +0,0 @@ -// ImageCache.swift -// -// Copyright (c) 2015-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 Alamofire -import Foundation - -#if os(iOS) || os(tvOS) || os(watchOS) -import UIKit -#elseif os(OSX) -import Cocoa -#endif - -// MARK: ImageCache - -/// The `ImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache. -public protocol ImageCache { - /// Adds the image to the cache with the given identifier. - func addImage(image: Image, withIdentifier identifier: String) - - /// Removes the image from the cache matching the given identifier. - func removeImageWithIdentifier(identifier: String) -> Bool - - /// Removes all images stored in the cache. - func removeAllImages() -> Bool - - /// Returns the image in the cache associated with the given identifier. - func imageWithIdentifier(identifier: String) -> Image? -} - -/// The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and -/// fetching images from a cache given an `NSURLRequest` and additional identifier. -public protocol ImageRequestCache: ImageCache { - /// Adds the image to the cache using an identifier created from the request and additional identifier. - func addImage(image: Image, forRequest request: NSURLRequest, withAdditionalIdentifier identifier: String?) - - /// Removes the image from the cache using an identifier created from the request and additional identifier. - func removeImageForRequest(request: NSURLRequest, withAdditionalIdentifier identifier: String?) -> Bool - - /// Returns the image from the cache associated with an identifier created from the request and additional identifier. - func imageForRequest(request: NSURLRequest, withAdditionalIdentifier identifier: String?) -> Image? -} - -// MARK: - - -/// The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When -/// the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously -/// purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the -/// internal access date of the image is updated. -public class AutoPurgingImageCache: ImageRequestCache { - private class CachedImage { - let image: Image - let identifier: String - let totalBytes: UInt64 - var lastAccessDate: NSDate - - init(_ image: Image, identifier: String) { - self.image = image - self.identifier = identifier - self.lastAccessDate = NSDate() - - self.totalBytes = { - #if os(iOS) || os(tvOS) || os(watchOS) - let size = CGSize(width: image.size.width * image.scale, height: image.size.height * image.scale) - #elseif os(OSX) - let size = CGSize(width: image.size.width, height: image.size.height) - #endif - - let bytesPerPixel: CGFloat = 4.0 - let bytesPerRow = size.width * bytesPerPixel - let totalBytes = UInt64(bytesPerRow) * UInt64(size.height) - - return totalBytes - }() - } - - func accessImage() -> Image { - lastAccessDate = NSDate() - return image - } - } - - // MARK: Properties - - /// The current total memory usage in bytes of all images stored within the cache. - public var memoryUsage: UInt64 { - var memoryUsage: UInt64 = 0 - dispatch_sync(synchronizationQueue) { memoryUsage = self.currentMemoryUsage } - - return memoryUsage - } - - /// The total memory capacity of the cache in bytes. - public let memoryCapacity: UInt64 - - /// The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory - /// capacity drops below this limit. - public let preferredMemoryUsageAfterPurge: UInt64 - - private let synchronizationQueue: dispatch_queue_t - private var cachedImages: [String: CachedImage] - private var currentMemoryUsage: UInt64 - - // MARK: Initialization - - /** - Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage - after purge limit. - - Please note, the memory capacity must always be greater than or equal to the preferred memory usage after purge. - - - parameter memoryCapacity: The total memory capacity of the cache in bytes. `100 MB` by default. - - parameter preferredMemoryUsageAfterPurge: The preferred memory usage after purge in bytes. `60 MB` by default. - - - returns: The new `AutoPurgingImageCache` instance. - */ - public init(memoryCapacity: UInt64 = 100_000_000, preferredMemoryUsageAfterPurge: UInt64 = 60_000_000) { - self.memoryCapacity = memoryCapacity - self.preferredMemoryUsageAfterPurge = preferredMemoryUsageAfterPurge - - precondition( - memoryCapacity >= preferredMemoryUsageAfterPurge, - "The `memoryCapacity` must be greater than or equal to `preferredMemoryUsageAfterPurge`" - ) - - self.cachedImages = [:] - self.currentMemoryUsage = 0 - - self.synchronizationQueue = { - let name = String(format: "com.alamofire.autopurgingimagecache-%08%08", arc4random(), arc4random()) - return dispatch_queue_create(name, DISPATCH_QUEUE_CONCURRENT) - }() - - #if os(iOS) - NSNotificationCenter.defaultCenter().addObserver( - self, - selector: "removeAllImages", - name: UIApplicationDidReceiveMemoryWarningNotification, - object: nil - ) - #endif - } - - deinit { - NSNotificationCenter.defaultCenter().removeObserver(self) - } - - // MARK: Add Image to Cache - - /** - Adds the image to the cache using an identifier created from the request and optional identifier. - - - parameter image: The image to add to the cache. - - parameter request: The request used to generate the image's unique identifier. - - parameter identifier: The additional identifier to append to the image's unique identifier. - */ - public func addImage(image: Image, forRequest request: NSURLRequest, withAdditionalIdentifier identifier: String? = nil) { - let requestIdentifier = imageCacheKeyFromURLRequest(request, withAdditionalIdentifier: identifier) - addImage(image, withIdentifier: requestIdentifier) - } - - /** - Adds the image to the cache with the given identifier. - - - parameter image: The image to add to the cache. - - parameter identifier: The identifier to use to uniquely identify the image. - */ - public func addImage(image: Image, withIdentifier identifier: String) { - dispatch_barrier_async(synchronizationQueue) { - let cachedImage = CachedImage(image, identifier: identifier) - - if let previousCachedImage = self.cachedImages[identifier] { - self.currentMemoryUsage -= previousCachedImage.totalBytes - } - - self.cachedImages[identifier] = cachedImage - self.currentMemoryUsage += cachedImage.totalBytes - } - - dispatch_barrier_async(synchronizationQueue) { - if self.currentMemoryUsage > self.memoryCapacity { - let bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge - - var sortedImages = [CachedImage](self.cachedImages.values) - sortedImages.sortInPlace { - let date1 = $0.lastAccessDate - let date2 = $1.lastAccessDate - - return date1.timeIntervalSinceDate(date2) < 0.0 - } - - var bytesPurged = UInt64(0) - - for cachedImage in sortedImages { - self.cachedImages.removeValueForKey(cachedImage.identifier) - bytesPurged += cachedImage.totalBytes - - if bytesPurged >= bytesToPurge { - break - } - } - - self.currentMemoryUsage -= bytesPurged - } - } - } - - // MARK: Remove Image from Cache - - /** - Removes the image from the cache using an identifier created from the request and optional identifier. - - - parameter request: The request used to generate the image's unique identifier. - - parameter identifier: The additional identifier to append to the image's unique identifier. - - - returns: `true` if the image was removed, `false` otherwise. - */ - public func removeImageForRequest(request: NSURLRequest, withAdditionalIdentifier identifier: String?) -> Bool { - let requestIdentifier = imageCacheKeyFromURLRequest(request, withAdditionalIdentifier: identifier) - return removeImageWithIdentifier(requestIdentifier) - } - - /** - Removes the image from the cache matching the given identifier. - - - parameter identifier: The unique identifier for the image. - - - returns: `true` if the image was removed, `false` otherwise. - */ - public func removeImageWithIdentifier(identifier: String) -> Bool { - var removed = false - - dispatch_barrier_async(synchronizationQueue) { - if let cachedImage = self.cachedImages.removeValueForKey(identifier) { - self.currentMemoryUsage -= cachedImage.totalBytes - removed = true - } - } - - return removed - } - - /** - Removes all images stored in the cache. - - - returns: `true` if images were removed from the cache, `false` otherwise. - */ - @objc public func removeAllImages() -> Bool { - var removed = false - - dispatch_sync(synchronizationQueue) { - if !self.cachedImages.isEmpty { - self.cachedImages.removeAll() - self.currentMemoryUsage = 0 - - removed = true - } - } - - return removed - } - - // MARK: Fetch Image from Cache - - /** - Returns the image from the cache associated with an identifier created from the request and optional identifier. - - - parameter request: The request used to generate the image's unique identifier. - - parameter identifier: The additional identifier to append to the image's unique identifier. - - - returns: The image if it is stored in the cache, `nil` otherwise. - */ - public func imageForRequest(request: NSURLRequest, withAdditionalIdentifier identifier: String? = nil) -> Image? { - let requestIdentifier = imageCacheKeyFromURLRequest(request, withAdditionalIdentifier: identifier) - return imageWithIdentifier(requestIdentifier) - } - - /** - Returns the image in the cache associated with the given identifier. - - - parameter identifier: The unique identifier for the image. - - - returns: The image if it is stored in the cache, `nil` otherwise. - */ - public func imageWithIdentifier(identifier: String) -> Image? { - var image: Image? - - dispatch_sync(synchronizationQueue) { - if let cachedImage = self.cachedImages[identifier] { - image = cachedImage.accessImage() - } - } - - return image - } - - // MARK: Private - Helper Methods - - private func imageCacheKeyFromURLRequest( - request: NSURLRequest, - withAdditionalIdentifier identifier: String?) - -> String - { - var key = request.URLString - - if let identifier = identifier { - key += "-\(identifier)" - } - - return key - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Source/ImageDownloader.swift b/Carthage/Checkouts/AlamofireImage/Source/ImageDownloader.swift deleted file mode 100644 index 2283189..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/ImageDownloader.swift +++ /dev/null @@ -1,530 +0,0 @@ -// ImageDownloader.swift -// -// Copyright (c) 2015-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 Alamofire -import Foundation - -#if os(iOS) || os(tvOS) || os(watchOS) -import UIKit -#elseif os(OSX) -import Cocoa -#endif - -/// The `RequestReceipt` is an object vended by the `ImageDownloader` when starting a download request. It can be used -/// to cancel active requests running on the `ImageDownloader` session. As a general rule, image download requests -/// should be cancelled using the `RequestReceipt` instead of calling `cancel` directly on the `request` itself. The -/// `ImageDownloader` is optimized to handle duplicate request scenarios as well as pending versus active downloads. -public class RequestReceipt { - /// The download request created by the `ImageDownloader`. - public let request: Request - - /// The unique identifier for the image filters and completion handlers when duplicate requests are made. - public let receiptID: String - - init(request: Request, receiptID: String) { - self.request = request - self.receiptID = receiptID - } -} - -/// The `ImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming -/// downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded -/// image is cached in the underlying `NSURLCache` as well as the in-memory image cache that supports image filters. -/// By default, any download request with a cached image equivalent in the image cache will automatically be served the -/// cached image representation. Additional advanced features include supporting multiple image filters and completion -/// handlers for a single request. -public class ImageDownloader { - /// The completion handler closure used when an image download completes. - public typealias CompletionHandler = Response -> Void - - /** - Defines the order prioritization of incoming download requests being inserted into the queue. - - - FIFO: All incoming downloads are added to the back of the queue. - - LIFO: All incoming downloads are added to the front of the queue. - */ - public enum DownloadPrioritization { - case FIFO, LIFO - } - - class ResponseHandler { - let identifier: String - let request: Request - var operations: [(id: String, filter: ImageFilter?, completion: CompletionHandler?)] - - init(request: Request, id: String, filter: ImageFilter?, completion: CompletionHandler?) { - self.request = request - self.identifier = ImageDownloader.identifierForURLRequest(request.request!) - self.operations = [(id: id, filter: filter, completion: completion)] - } - } - - // MARK: - Properties - - /// The image cache used to store all downloaded images in. - public let imageCache: ImageRequestCache? - - /// The credential used for authenticating each download request. - public private(set) var credential: NSURLCredential? - - /// The underlying Alamofire `Manager` instance used to handle all download requests. - public let sessionManager: Alamofire.Manager - - let downloadPrioritization: DownloadPrioritization - let maximumActiveDownloads: Int - - var activeRequestCount = 0 - var queuedRequests: [Request] = [] - var responseHandlers: [String: ResponseHandler] = [:] - - private let synchronizationQueue: dispatch_queue_t = { - let name = String(format: "com.alamofire.imagedownloader.synchronizationqueue-%08%08", arc4random(), arc4random()) - return dispatch_queue_create(name, DISPATCH_QUEUE_SERIAL) - }() - - private let responseQueue: dispatch_queue_t = { - let name = String(format: "com.alamofire.imagedownloader.responsequeue-%08%08", arc4random(), arc4random()) - return dispatch_queue_create(name, DISPATCH_QUEUE_CONCURRENT) - }() - - // MARK: - Initialization - - /// The default instance of `ImageDownloader` initialized with default values. - public static let defaultInstance = ImageDownloader() - - /** - Creates a default `NSURLSessionConfiguration` with common usage parameter values. - - - returns: The default `NSURLSessionConfiguration` instance. - */ - public class func defaultURLSessionConfiguration() -> NSURLSessionConfiguration { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - - configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders - configuration.HTTPShouldSetCookies = true - configuration.HTTPShouldUsePipelining = false - - configuration.requestCachePolicy = .UseProtocolCachePolicy - configuration.allowsCellularAccess = true - configuration.timeoutIntervalForRequest = 60 - - configuration.URLCache = ImageDownloader.defaultURLCache() - - return configuration - } - - /** - Creates a default `NSURLCache` with common usage parameter values. - - - returns: The default `NSURLCache` instance. - */ - public class func defaultURLCache() -> NSURLCache { - return NSURLCache( - memoryCapacity: 20 * 1024 * 1024, // 20 MB - diskCapacity: 150 * 1024 * 1024, // 150 MB - diskPath: "com.alamofire.imagedownloader" - ) - } - - /** - Initializes the `ImageDownloader` instance with the given configuration, download prioritization, maximum active - download count and image cache. - - - parameter configuration: The `NSURLSessionConfiguration` to use to create the underlying Alamofire - `Manager` instance. - - parameter downloadPrioritization: The download prioritization of the download queue. `.FIFO` by default. - - parameter maximumActiveDownloads: The maximum number of active downloads allowed at any given time. - - parameter imageCache: The image cache used to store all downloaded images in. - - - returns: The new `ImageDownloader` instance. - */ - public init( - configuration: NSURLSessionConfiguration = ImageDownloader.defaultURLSessionConfiguration(), - downloadPrioritization: DownloadPrioritization = .FIFO, - maximumActiveDownloads: Int = 4, - imageCache: ImageRequestCache? = AutoPurgingImageCache()) - { - self.sessionManager = Alamofire.Manager(configuration: configuration) - self.sessionManager.startRequestsImmediately = false - - self.downloadPrioritization = downloadPrioritization - self.maximumActiveDownloads = maximumActiveDownloads - self.imageCache = imageCache - } - - /** - Initializes the `ImageDownloader` instance with the given sesion manager, download prioritization, maximum - active download count and image cache. - - - parameter sessionManager: The Alamofire `Manager` instance to handle all download requests. - - parameter downloadPrioritization: The download prioritization of the download queue. `.FIFO` by default. - - parameter maximumActiveDownloads: The maximum number of active downloads allowed at any given time. - - parameter imageCache: The image cache used to store all downloaded images in. - - - returns: The new `ImageDownloader` instance. - */ - public init( - sessionManager: Manager, - downloadPrioritization: DownloadPrioritization = .FIFO, - maximumActiveDownloads: Int = 4, - imageCache: ImageRequestCache? = AutoPurgingImageCache()) - { - self.sessionManager = sessionManager - self.sessionManager.startRequestsImmediately = false - - self.downloadPrioritization = downloadPrioritization - self.maximumActiveDownloads = maximumActiveDownloads - self.imageCache = imageCache - } - - // MARK: - Authentication - - /** - Associates an HTTP Basic Auth credential with all future download requests. - - - parameter user: The user. - - parameter password: The password. - - parameter persistence: The URL credential persistence. `.ForSession` by default. - */ - public func addAuthentication( - user user: String, - password: String, - persistence: NSURLCredentialPersistence = .ForSession) - { - let credential = NSURLCredential(user: user, password: password, persistence: persistence) - addAuthentication(usingCredential: credential) - } - - /** - Associates the specified credential with all future download requests. - - - parameter credential: The credential. - */ - public func addAuthentication(usingCredential credential: NSURLCredential) { - dispatch_sync(synchronizationQueue) { - self.credential = credential - } - } - - // MARK: - Download - - /** - Creates a download request using the internal Alamofire `Manager` instance for the specified URL request. - - If the same download request is already in the queue or currently being downloaded, the filter and completion - handler are appended to the already existing request. Once the request completes, all filters and completion - handlers attached to the request are executed in the order they were added. Additionally, any filters attached - to the request with the same identifiers are only executed once. The resulting image is then passed into each - completion handler paired with the filter. - - You should not attempt to directly cancel the `request` inside the request receipt since other callers may be - relying on the completion of that request. Instead, you should call `cancelRequestForRequestReceipt` with the - returned request receipt to allow the `ImageDownloader` to optimize the cancellation on behalf of all active - callers. - - - parameter URLRequest: The URL request. - - parameter filter The image filter to apply to the image after the download is complete. Defaults to `nil`. - - parameter completion: The closure called when the download request is complete. - - - returns: The request receipt for the download request if available. `nil` if the image is stored in the image - cache and the URL request cache policy allows the cache to be used. - */ - public func downloadImage( - URLRequest URLRequest: URLRequestConvertible, - filter: ImageFilter? = nil, - completion: CompletionHandler? = nil) - -> RequestReceipt? - { - return downloadImage( - URLRequest: URLRequest, - receiptID: NSUUID().UUIDString, - filter: filter, - completion: completion - ) - } - - func downloadImage( - URLRequest URLRequest: URLRequestConvertible, - receiptID: String, - filter: ImageFilter?, - completion: CompletionHandler?) - -> RequestReceipt? - { - var request: Request! - - dispatch_sync(synchronizationQueue) { - // 1) Append the filter and completion handler to a pre-existing request if it already exists - let identifier = ImageDownloader.identifierForURLRequest(URLRequest) - - if let responseHandler = self.responseHandlers[identifier] { - responseHandler.operations.append(id: receiptID, filter: filter, completion: completion) - request = responseHandler.request - return - } - - // 2) Attempt to load the image from the image cache if the cache policy allows it - switch URLRequest.URLRequest.cachePolicy { - case .UseProtocolCachePolicy, .ReturnCacheDataElseLoad, .ReturnCacheDataDontLoad: - if let image = self.imageCache?.imageForRequest( - URLRequest.URLRequest, - withAdditionalIdentifier: filter?.identifier) - { - dispatch_async(dispatch_get_main_queue()) { - let response = Response( - request: URLRequest.URLRequest, - response: nil, - data: nil, - result: .Success(image) - ) - - completion?(response) - } - - return - } - default: - break - } - - // 3) Create the request and set up authentication, validation and response serialization - request = self.sessionManager.request(URLRequest) - - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - request.validate() - request.response( - queue: self.responseQueue, - responseSerializer: Request.imageResponseSerializer(), - completionHandler: { [weak self] response in - guard let strongSelf = self, let request = response.request else { return } - - let responseHandler = strongSelf.safelyRemoveResponseHandlerWithIdentifier(identifier) - - switch response.result { - case .Success(let image): - var filteredImages: [String: Image] = [:] - - for (_, filter, completion) in responseHandler.operations { - var filteredImage: Image - - if let filter = filter { - if let alreadyFilteredImage = filteredImages[filter.identifier] { - filteredImage = alreadyFilteredImage - } else { - filteredImage = filter.filter(image) - filteredImages[filter.identifier] = filteredImage - } - } else { - filteredImage = image - } - - strongSelf.imageCache?.addImage( - filteredImage, - forRequest: request, - withAdditionalIdentifier: filter?.identifier - ) - - dispatch_async(dispatch_get_main_queue()) { - let response = Response( - request: response.request, - response: response.response, - data: response.data, - result: .Success(filteredImage), - timeline: response.timeline - ) - - completion?(response) - } - } - case .Failure: - for (_, _, completion) in responseHandler.operations { - dispatch_async(dispatch_get_main_queue()) { completion?(response) } - } - } - - strongSelf.safelyDecrementActiveRequestCount() - strongSelf.safelyStartNextRequestIfNecessary() - } - ) - - // 4) Store the response handler for use when the request completes - let responseHandler = ResponseHandler( - request: request, - id: receiptID, - filter: filter, - completion: completion - ) - - self.responseHandlers[identifier] = responseHandler - - // 5) Either start the request or enqueue it depending on the current active request count - if self.isActiveRequestCountBelowMaximumLimit() { - self.startRequest(request) - } else { - self.enqueueRequest(request) - } - } - - if let request = request { - return RequestReceipt(request: request, receiptID: receiptID) - } - - return nil - } - - /** - Creates a download request using the internal Alamofire `Manager` instance for each specified URL request. - - For each request, if the same download request is already in the queue or currently being downloaded, the - filter and completion handler are appended to the already existing request. Once the request completes, all - filters and completion handlers attached to the request are executed in the order they were added. - Additionally, any filters attached to the request with the same identifiers are only executed once. The - resulting image is then passed into each completion handler paired with the filter. - - You should not attempt to directly cancel any of the `request`s inside the request receipts array since other - callers may be relying on the completion of that request. Instead, you should call - `cancelRequestForRequestReceipt` with the returned request receipt to allow the `ImageDownloader` to optimize - the cancellation on behalf of all active callers. - - - parameter URLRequests: The URL requests. - - parameter filter The image filter to apply to the image after each download is complete. - - parameter completion: The closure called when each download request is complete. - - - returns: The request receipts for the download requests if available. If an image is stored in the image - cache and the URL request cache policy allows the cache to be used, a receipt will not be returned - for that request. - */ - public func downloadImages( - URLRequests URLRequests: [URLRequestConvertible], - filter: ImageFilter? = nil, - completion: CompletionHandler? = nil) - -> [RequestReceipt] - { - return URLRequests.flatMap { downloadImage(URLRequest: $0, filter: filter, completion: completion) } - } - - /** - Cancels the request in the receipt by removing the response handler and cancelling the request if necessary. - - If the request is pending in the queue, it will be cancelled if no other response handlers are registered with - the request. If the request is currently executing or is already completed, the response handler is removed and - will not be called. - - - parameter requestReceipt: The request receipt to cancel. - */ - public func cancelRequestForRequestReceipt(requestReceipt: RequestReceipt) { - dispatch_sync(synchronizationQueue) { - let identifier = ImageDownloader.identifierForURLRequest(requestReceipt.request.request!) - guard let responseHandler = self.responseHandlers[identifier] else { return } - - if let index = responseHandler.operations.indexOf({ $0.id == requestReceipt.receiptID }) { - let operation = responseHandler.operations.removeAtIndex(index) - - let response: Response = { - let URLRequest = requestReceipt.request.request! - let error: NSError = { - let failureReason = "ImageDownloader cancelled URL request: \(URLRequest.URLString)" - let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] - return NSError(domain: Error.Domain, code: NSURLErrorCancelled, userInfo: userInfo) - }() - - return Response(request: URLRequest, response: nil, data: nil, result: .Failure(error)) - }() - - dispatch_async(dispatch_get_main_queue()) { operation.completion?(response) } - } - - if responseHandler.operations.isEmpty && requestReceipt.request.task.state == .Suspended { - requestReceipt.request.cancel() - } - } - } - - // MARK: - Internal - Thread-Safe Request Methods - - func safelyRemoveResponseHandlerWithIdentifier(identifier: String) -> ResponseHandler { - var responseHandler: ResponseHandler! - - dispatch_sync(synchronizationQueue) { - responseHandler = self.responseHandlers.removeValueForKey(identifier) - } - - return responseHandler - } - - func safelyStartNextRequestIfNecessary() { - dispatch_sync(synchronizationQueue) { - guard self.isActiveRequestCountBelowMaximumLimit() else { return } - - while (!self.queuedRequests.isEmpty) { - if let request = self.dequeueRequest() where request.task.state == .Suspended { - self.startRequest(request) - break - } - } - } - } - - func safelyDecrementActiveRequestCount() { - dispatch_sync(self.synchronizationQueue) { - if self.activeRequestCount > 0 { - self.activeRequestCount -= 1 - } - } - } - - // MARK: - Internal - Non Thread-Safe Request Methods - - func startRequest(request: Request) { - request.resume() - activeRequestCount += 1 - } - - func enqueueRequest(request: Request) { - switch downloadPrioritization { - case .FIFO: - queuedRequests.append(request) - case .LIFO: - queuedRequests.insert(request, atIndex: 0) - } - } - - func dequeueRequest() -> Request? { - var request: Request? - - if !queuedRequests.isEmpty { - request = queuedRequests.removeFirst() - } - - return request - } - - func isActiveRequestCountBelowMaximumLimit() -> Bool { - return activeRequestCount < maximumActiveDownloads - } - - static func identifierForURLRequest(URLRequest: URLRequestConvertible) -> String { - return URLRequest.URLRequest.URLString - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Source/ImageFilter.swift b/Carthage/Checkouts/AlamofireImage/Source/ImageFilter.swift deleted file mode 100644 index 0549ed4..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/ImageFilter.swift +++ /dev/null @@ -1,428 +0,0 @@ -// ImageFilter.swift -// -// Copyright (c) 2015-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 Foundation - -#if os(iOS) || os(tvOS) || os(watchOS) -import UIKit -#elseif os(OSX) -import Cocoa -#endif - -// MARK: ImageFilter - -/// The `ImageFilter` protocol defines properties for filtering an image as well as identification of the filter. -public protocol ImageFilter { - /// A closure used to create an alternative representation of the given image. - var filter: Image -> Image { get } - - /// The string used to uniquely identify the filter operation. - var identifier: String { get } -} - -extension ImageFilter { - /// The unique identifier for any `ImageFilter` type. - public var identifier: String { return "\(self.dynamicType)" } -} - -// MARK: - Sizable - -/// The `Sizable` protocol defines a size property intended for use with `ImageFilter` types. -public protocol Sizable { - /// The size of the type. - var size: CGSize { get } -} - -extension ImageFilter where Self: Sizable { - /// The unique idenitifier for an `ImageFilter` conforming to the `Sizable` protocol. - public var identifier: String { - let width = Int64(round(size.width)) - let height = Int64(round(size.height)) - - return "\(self.dynamicType)-size:(\(width)x\(height))" - } -} - -// MARK: - Roundable - -/// The `Roundable` protocol defines a radius property intended for use with `ImageFilter` types. -public protocol Roundable { - /// The radius of the type. - var radius: CGFloat { get } -} - -extension ImageFilter where Self: Roundable { - /// The unique idenitifier for an `ImageFilter` conforming to the `Roundable` protocol. - public var identifier: String { - let radius = Int64(round(self.radius)) - return "\(self.dynamicType)-radius:(\(radius))" - } -} - -// MARK: - DynamicImageFilter - -/// The `DynamicImageFilter` class simplifies custom image filter creation by using a trailing closure initializer. -public struct DynamicImageFilter: ImageFilter { - /// The string used to uniquely identify the image filter operation. - public let identifier: String - - /// A closure used to create an alternative representation of the given image. - public let filter: Image -> Image - - /** - Initializes the `DynamicImageFilter` instance with the specified identifier and filter closure. - - - parameter identifier: The unique identifier of the filter. - - parameter filter: A closure used to create an alternative representation of the given image. - - - returns: The new `DynamicImageFilter` instance. - */ - public init(_ identifier: String, filter: Image -> Image) { - self.identifier = identifier - self.filter = filter - } -} - -// MARK: - CompositeImageFilter - -/// The `CompositeImageFilter` protocol defines an additional `filters` property to support multiple composite filters. -public protocol CompositeImageFilter: ImageFilter { - /// The image filters to apply to the image in sequential order. - var filters: [ImageFilter] { get } -} - -public extension CompositeImageFilter { - /// The unique idenitifier for any `CompositeImageFilter` type. - var identifier: String { - return filters.map { $0.identifier }.joinWithSeparator("_") - } - - /// The filter closure for any `CompositeImageFilter` type. - var filter: Image -> Image { - return { image in - return self.filters.reduce(image) { $1.filter($0) } - } - } -} - -// MARK: - DynamicCompositeImageFilter - -/// The `DynamicCompositeImageFilter` class is a composite image filter based on a specified array of filters. -public struct DynamicCompositeImageFilter: CompositeImageFilter { - /// The image filters to apply to the image in sequential order. - public let filters: [ImageFilter] - - /** - Initializes the `DynamicCompositeImageFilter` instance with the given filters. - - - parameter filters: The filters taking part in the composite image filter. - - - returns: The new `DynamicCompositeImageFilter` instance. - */ - public init(_ filters: [ImageFilter]) { - self.filters = filters - } - - /** - Initializes the `DynamicCompositeImageFilter` instance with the given filters. - - - parameter filters: The filters taking part in the composite image filter. - - - returns: The new `DynamicCompositeImageFilter` instance. - */ - public init(_ filters: ImageFilter...) { - self.init(filters) - } -} - -#if os(iOS) || os(tvOS) || os(watchOS) - -// MARK: - Single Pass Image Filters (iOS, tvOS and watchOS only) - - -/// Scales an image to a specified size. -public struct ScaledToSizeFilter: ImageFilter, Sizable { - /// The size of the filter. - public let size: CGSize - - /** - Initializes the `ScaledToSizeFilter` instance with the given size. - - - parameter size: The size. - - - returns: The new `ScaledToSizeFilter` instance. - */ - public init(size: CGSize) { - self.size = size - } - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - return image.af_imageScaledToSize(self.size) - } - } -} - -// MARK: - - -/// Scales an image from the center while maintaining the aspect ratio to fit within a specified size. -public struct AspectScaledToFitSizeFilter: ImageFilter, Sizable { - /// The size of the filter. - public let size: CGSize - - /** - Initializes the `AspectScaledToFitSizeFilter` instance with the given size. - - - parameter size: The size. - - - returns: The new `AspectScaledToFitSizeFilter` instance. - */ - public init(size: CGSize) { - self.size = size - } - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - return image.af_imageAspectScaledToFitSize(self.size) - } - } -} - -// MARK: - - -/// Scales an image from the center while maintaining the aspect ratio to fill a specified size. Any pixels that fall -/// outside the specified size are clipped. -public struct AspectScaledToFillSizeFilter: ImageFilter, Sizable { - /// The size of the filter. - public let size: CGSize - - /** - Initializes the `AspectScaledToFillSizeFilter` instance with the given size. - - - parameter size: The size. - - - returns: The new `AspectScaledToFillSizeFilter` instance. - */ - public init(size: CGSize) { - self.size = size - } - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - return image.af_imageAspectScaledToFillSize(self.size) - } - } -} - -// MARK: - - -/// Rounds the corners of an image to the specified radius. -public struct RoundedCornersFilter: ImageFilter, Roundable { - /// The radius of the filter. - public let radius: CGFloat - - /// Whether to divide the radius by the image scale. - public let divideRadiusByImageScale: Bool - - /** - Initializes the `RoundedCornersFilter` instance with the given radius. - - - parameter radius: The radius. - - parameter divideRadiusByImageScale: Whether to divide the radius by the image scale. Set to `true` when the - image has the same resolution for all screen scales such as @1x, @2x and - @3x (i.e. single image from web server). Set to `false` for images loaded - from an asset catalog with varying resolutions for each screen scale. - `false` by default. - - - returns: The new `RoundedCornersFilter` instance. - */ - public init(radius: CGFloat, divideRadiusByImageScale: Bool = false) { - self.radius = radius - self.divideRadiusByImageScale = divideRadiusByImageScale - } - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - return image.af_imageWithRoundedCornerRadius( - self.radius, - divideRadiusByImageScale: self.divideRadiusByImageScale - ) - } - } - - /// The unique idenitifier for an `ImageFilter` conforming to the `Roundable` protocol. - public var identifier: String { - let radius = Int64(round(self.radius)) - return "\(self.dynamicType)-radius:(\(radius))-divided:(\(divideRadiusByImageScale))" - } -} - -// MARK: - - -/// Rounds the corners of an image into a circle. -public struct CircleFilter: ImageFilter { - /** - Initializes the `CircleFilter` instance. - - - returns: The new `CircleFilter` instance. - */ - public init() {} - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - return image.af_imageRoundedIntoCircle() - } - } -} - -// MARK: - - -#if os(iOS) || os(tvOS) - -/// Blurs an image using a `CIGaussianBlur` filter with the specified blur radius. -public struct BlurFilter: ImageFilter { - /// The blur radius of the filter. - let blurRadius: UInt - - /** - Initializes the `BlurFilter` instance with the given blur radius. - - - parameter blurRadius: The blur radius. - - - returns: The new `BlurFilter` instance. - */ - public init(blurRadius: UInt = 10) { - self.blurRadius = blurRadius - } - - /// The filter closure used to create the modified representation of the given image. - public var filter: Image -> Image { - return { image in - let parameters = ["inputRadius": self.blurRadius] - return image.af_imageWithAppliedCoreImageFilter("CIGaussianBlur", filterParameters: parameters) ?? image - } - } -} - -#endif - -// MARK: - Composite Image Filters (iOS, tvOS and watchOS only) - - -/// Scales an image to a specified size, then rounds the corners to the specified radius. -public struct ScaledToSizeWithRoundedCornersFilter: CompositeImageFilter { - /** - Initializes the `ScaledToSizeWithRoundedCornersFilter` instance with the given size and radius. - - - parameter size: The size. - - parameter radius: The radius. - - parameter divideRadiusByImageScale: Whether to divide the radius by the image scale. Set to `true` when the - image has the same resolution for all screen scales such as @1x, @2x and - @3x (i.e. single image from web server). Set to `false` for images loaded - from an asset catalog with varying resolutions for each screen scale. - `false` by default. - - - returns: The new `ScaledToSizeWithRoundedCornersFilter` instance. - */ - public init(size: CGSize, radius: CGFloat, divideRadiusByImageScale: Bool = false) { - self.filters = [ - ScaledToSizeFilter(size: size), - RoundedCornersFilter(radius: radius, divideRadiusByImageScale: divideRadiusByImageScale) - ] - } - - /// The image filters to apply to the image in sequential order. - public let filters: [ImageFilter] -} - -// MARK: - - -/// Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the -/// corners to the specified radius. -public struct AspectScaledToFillSizeWithRoundedCornersFilter: CompositeImageFilter { - /** - Initializes the `AspectScaledToFillSizeWithRoundedCornersFilter` instance with the given size and radius. - - - parameter size: The size. - - parameter radius: The radius. - - parameter divideRadiusByImageScale: Whether to divide the radius by the image scale. Set to `true` when the - image has the same resolution for all screen scales such as @1x, @2x and - @3x (i.e. single image from web server). Set to `false` for images loaded - from an asset catalog with varying resolutions for each screen scale. - `false` by default. - - - returns: The new `AspectScaledToFillSizeWithRoundedCornersFilter` instance. - */ - public init(size: CGSize, radius: CGFloat, divideRadiusByImageScale: Bool = false) { - self.filters = [ - AspectScaledToFillSizeFilter(size: size), - RoundedCornersFilter(radius: radius, divideRadiusByImageScale: divideRadiusByImageScale) - ] - } - - /// The image filters to apply to the image in sequential order. - public let filters: [ImageFilter] -} - -// MARK: - - -/// Scales an image to a specified size, then rounds the corners into a circle. -public struct ScaledToSizeCircleFilter: CompositeImageFilter { - /** - Initializes the `ScaledToSizeCircleFilter` instance with the given size. - - - parameter size: The size. - - - returns: The new `ScaledToSizeCircleFilter` instance. - */ - public init(size: CGSize) { - self.filters = [ScaledToSizeFilter(size: size), CircleFilter()] - } - - /// The image filters to apply to the image in sequential order. - public let filters: [ImageFilter] -} - -// MARK: - - -/// Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the -/// corners into a circle. -public struct AspectScaledToFillSizeCircleFilter: CompositeImageFilter { - /** - Initializes the `AspectScaledToFillSizeCircleFilter` instance with the given size. - - - parameter size: The size. - - - returns: The new `AspectScaledToFillSizeCircleFilter` instance. - */ - public init(size: CGSize) { - self.filters = [AspectScaledToFillSizeFilter(size: size), CircleFilter()] - } - - /// The image filters to apply to the image in sequential order. - public let filters: [ImageFilter] -} - -#endif diff --git a/Carthage/Checkouts/AlamofireImage/Source/Info-tvOS.plist b/Carthage/Checkouts/AlamofireImage/Source/Info-tvOS.plist deleted file mode 100644 index f72edb4..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/Info-tvOS.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 2.3.1 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - UIRequiredDeviceCapabilities - - arm64 - - - diff --git a/Carthage/Checkouts/AlamofireImage/Source/Request+AlamofireImage.swift b/Carthage/Checkouts/AlamofireImage/Source/Request+AlamofireImage.swift deleted file mode 100644 index da5aa97..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/Request+AlamofireImage.swift +++ /dev/null @@ -1,235 +0,0 @@ -// Request+AlamofireImage.swift -// -// Copyright (c) 2015-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 Alamofire -import Foundation - -#if os(iOS) || os(tvOS) -import UIKit -#elseif os(watchOS) -import UIKit -import WatchKit -#elseif os(OSX) -import Cocoa -#endif - -extension Request { - static var acceptableImageContentTypes: Set = [ - "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" - ] - - /** - Adds the content types specified to the list of acceptable images content types for validation. - - - parameter contentTypes: The additional content types. - */ - public class func addAcceptableImageContentTypes(contentTypes: Set) { - Request.acceptableImageContentTypes.unionInPlace(contentTypes) - } - - // MARK: - iOS, tvOS and watchOS - -#if os(iOS) || os(tvOS) || os(watchOS) - - /** - Creates a response serializer that returns an image initialized from the response data using the specified - image options. - - - parameter imageScale: The scale factor used when interpreting the image data to construct - `responseImage`. Specifying a scale factor of 1.0 results in an image whose - size matches the pixel-based dimensions of the image. Applying a different - scale factor changes the size of the image as reported by the size property. - `Screen.scale` by default. - - parameter inflateResponseImage: Whether to automatically inflate response image data for compressed formats - (such as PNG or JPEG). Enabling this can significantly improve drawing - performance as it allows a bitmap representation to be constructed in the - background rather than on the main thread. `true` by default. - - - returns: An image response serializer. - */ - public class func imageResponseSerializer( - imageScale imageScale: CGFloat = Request.imageScale, - inflateResponseImage: Bool = true) - -> ResponseSerializer - { - return ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - guard let validData = data where validData.length > 0 else { - return .Failure(Request.imageDataError()) - } - - guard Request.validateContentTypeForRequest(request, response: response) else { - return .Failure(Request.contentTypeValidationError()) - } - - do { - let image = try Request.imageFromResponseData(validData, imageScale: imageScale) - if inflateResponseImage { image.af_inflate() } - - return .Success(image) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter imageScale: The scale factor used when interpreting the image data to construct - `responseImage`. Specifying a scale factor of 1.0 results in an image whose - size matches the pixel-based dimensions of the image. Applying a different - scale factor changes the size of the image as reported by the size property. - This is set to the value of scale of the main screen by default, which - automatically scales images for retina displays, for instance. - `Screen.scale` by default. - - parameter inflateResponseImage: Whether to automatically inflate response image data for compressed formats - (such as PNG or JPEG). Enabling this can significantly improve drawing - performance as it allows a bitmap representation to be constructed in the - background rather than on the main thread. `true` by default. - - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 4 - arguments: the URL request, the URL response, if one was received, the image, - if one could be created from the URL response and data, and any error produced - while creating the image. - - - returns: The request. - */ - public func responseImage( - imageScale: CGFloat = Request.imageScale, - inflateResponseImage: Bool = true, - completionHandler: Response -> Void) - -> Self - { - return response( - responseSerializer: Request.imageResponseSerializer( - imageScale: imageScale, - inflateResponseImage: inflateResponseImage - ), - completionHandler: completionHandler - ) - } - - private class func imageFromResponseData(data: NSData, imageScale: CGFloat) throws -> UIImage { - if let image = UIImage.af_threadSafeImageWithData(data, scale: imageScale) { - return image - } - - throw imageDataError() - } - - private class var imageScale: CGFloat { - #if os(iOS) || os(tvOS) - return UIScreen.mainScreen().scale - #elseif os(watchOS) - return WKInterfaceDevice.currentDevice().screenScale - #endif - } - -#elseif os(OSX) - - // MARK: - OSX - - /** - Creates a response serializer that returns an image initialized from the response data. - - - returns: An image response serializer. - */ - public class func imageResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(error!) } - - guard let validData = data where validData.length > 0 else { - return .Failure(Request.imageDataError()) - } - - guard Request.validateContentTypeForRequest(request, response: response) else { - return .Failure(Request.contentTypeValidationError()) - } - - guard let bitmapImage = NSBitmapImageRep(data: validData) else { - return .Failure(Request.imageDataError()) - } - - let image = NSImage(size: NSSize(width: bitmapImage.pixelsWide, height: bitmapImage.pixelsHigh)) - image.addRepresentation(bitmapImage) - - return .Success(image) - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 4 - arguments: the URL request, the URL response, if one was received, the image, if - one could be created from the URL response and data, and any error produced while - creating the image. - - - returns: The request. - */ - public func responseImage(completionHandler: Response -> Void) -> Self { - return response( - responseSerializer: Request.imageResponseSerializer(), - completionHandler: completionHandler - ) - } - -#endif - - // MARK: - Private - Shared Helper Methods - - private class func validateContentTypeForRequest( - request: NSURLRequest?, - response: NSHTTPURLResponse?) - -> Bool - { - if let URL = request?.URL where URL.fileURL { - return true - } - - if let mimeType = response?.MIMEType where Request.acceptableImageContentTypes.contains(mimeType) { - return true - } - - return false - } - - private class func contentTypeValidationError() -> NSError { - let failureReason = "Failed to validate response due to unacceptable content type" - return Error.errorWithCode(NSURLErrorCannotDecodeContentData, failureReason: failureReason) - } - - private class func imageDataError() -> NSError { - let failureReason = "Failed to create a valid Image from the response data" - return Error.errorWithCode(NSURLErrorCannotDecodeContentData, failureReason: failureReason) - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Source/UIButton+AlamofireImage.swift b/Carthage/Checkouts/AlamofireImage/Source/UIButton+AlamofireImage.swift deleted file mode 100644 index 0f9c848..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/UIButton+AlamofireImage.swift +++ /dev/null @@ -1,405 +0,0 @@ -// UIButton+AlamofireImage.swift -// -// Copyright (c) 2015-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 Alamofire -import Foundation -import UIKit - -extension UIButton { - - // MARK: - Private - AssociatedKeys - - private struct AssociatedKeys { - static var ImageDownloaderKey = "af_UIButton.ImageDownloader" - static var SharedImageDownloaderKey = "af_UIButton.SharedImageDownloader" - static var ImageReceiptsKey = "af_UIButton.ImageReceipts" - static var BackgroundImageReceiptsKey = "af_UIButton.BackgroundImageReceipts" - } - - // MARK: - Properties - - /// The instance image downloader used to download all images. If this property is `nil`, the `UIButton` will - /// fallback on the `af_sharedImageDownloader` for all downloads. The most common use case for needing to use a - /// custom instance image downloader is when images are behind different basic auth credentials. - public var af_imageDownloader: ImageDownloader? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ImageDownloaderKey) as? ImageDownloader - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.ImageDownloaderKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - /// The shared image downloader used to download all images. By default, this is the default `ImageDownloader` - /// instance backed with an `AutoPurgingImageCache` which automatically evicts images from the cache when the memory - /// capacity is reached or memory warning notifications occur. The shared image downloader is only used if the - /// `af_imageDownloader` is `nil`. - public class var af_sharedImageDownloader: ImageDownloader { - get { - guard let - downloader = objc_getAssociatedObject(self, &AssociatedKeys.SharedImageDownloaderKey) as? ImageDownloader - else { - return ImageDownloader.defaultInstance - } - - return downloader - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.SharedImageDownloaderKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - private var imageRequestReceipts: [UInt: RequestReceipt] { - get { - guard let - receipts = objc_getAssociatedObject(self, &AssociatedKeys.ImageReceiptsKey) as? [UInt: RequestReceipt] - else { - return [:] - } - - return receipts - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.ImageReceiptsKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - private var backgroundImageRequestReceipts: [UInt: RequestReceipt] { - get { - guard let - receipts = objc_getAssociatedObject(self, &AssociatedKeys.BackgroundImageReceiptsKey) as? [UInt: RequestReceipt] - else { - return [:] - } - - return receipts - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.BackgroundImageReceiptsKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - // MARK: - Image Downloads - - /** - Asynchronously downloads an image from the specified URL and sets it once the request is finished. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - - parameter URL: The URL used for your image request. - - parameter placeholderImage: The image to be set initially until the image request finished. If `nil`, the - image will not change its image until the image request finishes. - Defaults to `nil`. - - parameter completion: A closure to be executed when the image request finishes. The closure - has no return value and takes three arguments: the original request, - the response from the server and the result containing either the - image or the error that occurred. If the image was returned from the - image cache, the response will be `nil`. Defaults to `nil`. - */ - public func af_setImageForState( - state: UIControlState, - URL: NSURL, - placeHolderImage: UIImage? = nil, - completion: (Response -> Void)? = nil) - { - af_setImageForState(state, - URLRequest: URLRequestWithURL(URL), - placeholderImage: placeHolderImage, - completion: completion) - } - - /** - Asynchronously downloads an image from the specified URL request and sets it once the request is finished. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - - parameter URLRequest: The URL request. - - parameter placeholderImage: The image to be set initially until the image request finished. If `nil`, the - image will not change its image until the image request finishes. - Defaults to `nil`. - - parameter completion: A closure to be executed when the image request finishes. The closure - has no return value and takes three arguments: the original request, - the response from the server and the result containing either the - image or the error that occurred. If the image was returned from the - image cache, the response will be `nil`. Defaults to `nil`. - */ - public func af_setImageForState( - state: UIControlState, - URLRequest: URLRequestConvertible, - placeholderImage: UIImage? = nil, - completion: (Response -> Void)? = nil) - { - guard !isImageURLRequest(URLRequest, equalToActiveRequestURLForState: state) else { return } - - af_cancelImageRequestForState(state) - - let imageDownloader = af_imageDownloader ?? UIButton.af_sharedImageDownloader - let imageCache = imageDownloader.imageCache - - // Use the image from the image cache if it exists - if let image = imageCache?.imageForRequest(URLRequest.URLRequest, withAdditionalIdentifier: nil) { - let response = Response( - request: URLRequest.URLRequest, - response: nil, - data: nil, - result: .Success(image) - ) - - completion?(response) - setImage(image, forState: state) - - return - } - - // Set the placeholder since we're going to have to download - if let placeholderImage = placeholderImage { self.setImage(placeholderImage, forState: state) } - - // Generate a unique download id to check whether the active request has changed while downloading - let downloadID = NSUUID().UUIDString - - // Download the image, then set the image for the control state - let requestReceipt = imageDownloader.downloadImage( - URLRequest: URLRequest, - receiptID: downloadID, - filter: nil, - completion: { [weak self] response in - guard let strongSelf = self else { return } - - completion?(response) - - guard - strongSelf.isImageURLRequest(response.request, equalToActiveRequestURLForState: state) && - strongSelf.imageRequestReceiptForState(state)?.receiptID == downloadID - else { - return - } - - if let image = response.result.value { - strongSelf.setImage(image, forState: state) - } - - strongSelf.setImageRequestReceipt(nil, forState: state) - } - ) - - setImageRequestReceipt(requestReceipt, forState: state) - } - - /** - Cancels the active download request for the image, if one exists. - */ - public func af_cancelImageRequestForState(state: UIControlState) { - guard let receipt = imageRequestReceiptForState(state) else { return } - - let imageDownloader = af_imageDownloader ?? UIButton.af_sharedImageDownloader - imageDownloader.cancelRequestForRequestReceipt(receipt) - - setImageRequestReceipt(nil, forState: state) - } - - // MARK: - Background Image Downloads - - /** - Asynchronously downloads an image from the specified URL and sets it once the request is finished. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - - parameter URL: The URL used for the image request. - - parameter placeholderImage: The image to be set initially until the image request finished. If `nil`, the - background image will not change its image until the image request finishes. - Defaults to `nil`. - */ - public func af_setBackgroundImageForState( - state: UIControlState, - URL: NSURL, - placeHolderImage: UIImage? = nil, - completion: (Response -> Void)? = nil) - { - af_setBackgroundImageForState(state, - URLRequest: URLRequestWithURL(URL), - placeholderImage: placeHolderImage, - completion: completion) - } - - /** - Asynchronously downloads an image from the specified URL request and sets it once the request is finished. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - - parameter URLRequest: The URL request. - - parameter placeholderImage: The image to be set initially until the image request finished. If `nil`, the - background image will not change its image until the image request finishes. - Defaults to `nil`. - - parameter completion: A closure to be executed when the image request finishes. The closure - has no return value and takes three arguments: the original request, - the response from the server and the result containing either the - image or the error that occurred. If the image was returned from the - image cache, the response will be `nil`. Defaults to `nil`. - */ - public func af_setBackgroundImageForState( - state: UIControlState, - URLRequest: URLRequestConvertible, - placeholderImage: UIImage? = nil, - completion: (Response -> Void)? = nil) - { - guard !isImageURLRequest(URLRequest, equalToActiveRequestURLForState: state) else { return } - - af_cancelBackgroundImageRequestForState(state) - - let imageDownloader = af_imageDownloader ?? UIButton.af_sharedImageDownloader - let imageCache = imageDownloader.imageCache - - // Use the image from the image cache if it exists - if let image = imageCache?.imageForRequest(URLRequest.URLRequest, withAdditionalIdentifier: nil) { - let response = Response( - request: URLRequest.URLRequest, - response: nil, - data: nil, - result: .Success(image) - ) - - completion?(response) - setBackgroundImage(image, forState: state) - - return - } - - // Set the placeholder since we're going to have to download - if let placeholderImage = placeholderImage { self.setBackgroundImage(placeholderImage, forState: state) } - - // Generate a unique download id to check whether the active request has changed while downloading - let downloadID = NSUUID().UUIDString - - // Download the image, then set the image for the control state - let requestReceipt = imageDownloader.downloadImage( - URLRequest: URLRequest, - receiptID: downloadID, - filter: nil, - completion: { [weak self] response in - guard let strongSelf = self else { return } - - completion?(response) - - guard - strongSelf.isBackgroundImageURLRequest(response.request, equalToActiveRequestURLForState: state) && - strongSelf.backgroundImageRequestReceiptForState(state)?.receiptID == downloadID - else { - return - } - - if let image = response.result.value { - strongSelf.setBackgroundImage(image, forState: state) - } - - strongSelf.setBackgroundImageRequestReceipt(nil, forState: state) - } - ) - - setBackgroundImageRequestReceipt(requestReceipt, forState: state) - } - - /** - Cancels the active download request for the background image, if one exists. - */ - public func af_cancelBackgroundImageRequestForState(state: UIControlState) { - guard let receipt = backgroundImageRequestReceiptForState(state) else { return } - - let imageDownloader = af_imageDownloader ?? UIButton.af_sharedImageDownloader - imageDownloader.cancelRequestForRequestReceipt(receipt) - - setBackgroundImageRequestReceipt(nil, forState: state) - } - - // MARK: - Internal - Image Request Receipts - - func imageRequestReceiptForState(state: UIControlState) -> RequestReceipt? { - guard let receipt = imageRequestReceipts[state.rawValue] else { return nil } - return receipt - } - - func setImageRequestReceipt(receipt: RequestReceipt?, forState state: UIControlState) { - var receipts = imageRequestReceipts - receipts[state.rawValue] = receipt - - imageRequestReceipts = receipts - } - - // MARK: - Internal - Background Image Request Receipts - - func backgroundImageRequestReceiptForState(state: UIControlState) -> RequestReceipt? { - guard let receipt = backgroundImageRequestReceipts[state.rawValue] else { return nil } - return receipt - } - - func setBackgroundImageRequestReceipt(receipt: RequestReceipt?, forState state: UIControlState) { - var receipts = backgroundImageRequestReceipts - receipts[state.rawValue] = receipt - - backgroundImageRequestReceipts = receipts - } - - // MARK: - Private - URL Request Helpers - - private func isImageURLRequest( - URLRequest: URLRequestConvertible?, - equalToActiveRequestURLForState state: UIControlState) - -> Bool - { - if let - currentRequest = imageRequestReceiptForState(state)?.request.task.originalRequest - where currentRequest.URLString == URLRequest?.URLRequest.URLString - { - return true - } - - return false - } - - private func isBackgroundImageURLRequest( - URLRequest: URLRequestConvertible?, - equalToActiveRequestURLForState state: UIControlState) - -> Bool - { - if let - currentRequest = backgroundImageRequestReceiptForState(state)?.request.task.originalRequest - where currentRequest.URLString == URLRequest?.URLRequest.URLString - { - return true - } - - return false - } - - private func URLRequestWithURL(URL: NSURL) -> NSURLRequest { - let mutableURLRequest = NSMutableURLRequest(URL: URL) - - for mimeType in Request.acceptableImageContentTypes { - mutableURLRequest.addValue(mimeType, forHTTPHeaderField: "Accept") - } - - return mutableURLRequest - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Source/UIImage+AlamofireImage.swift b/Carthage/Checkouts/AlamofireImage/Source/UIImage+AlamofireImage.swift deleted file mode 100644 index ddd460d..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/UIImage+AlamofireImage.swift +++ /dev/null @@ -1,325 +0,0 @@ -// UIImage+AlamofireImage.swift -// -// Copyright (c) 2015-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 CoreGraphics -import Foundation -import UIKit - -#if os(iOS) || os(tvOS) -import CoreImage -#endif - -// MARK: Initialization - -private let lock = NSLock() - -extension UIImage { - /** - Initializes and returns the image object with the specified data in a thread-safe manner. - - It has been reported that there are thread-safety issues when initializing large amounts of images - simultaneously. In the event of these issues occurring, this method can be used in place of - the `init?(data:)` method. - - - parameter data: The data object containing the image data. - - - returns: An initialized `UIImage` object, or `nil` if the method failed. - */ - public static func af_threadSafeImageWithData(data: NSData) -> UIImage? { - lock.lock() - let image = UIImage(data: data) - lock.unlock() - - return image - } - - /** - Initializes and returns the image object with the specified data and scale in a thread-safe manner. - - It has been reported that there are thread-safety issues when initializing large amounts of images - simultaneously. In the event of these issues occurring, this method can be used in place of - the `init?(data:scale:)` method. - - - parameter data: The data object containing the image data. - - parameter scale: The scale factor to assume when interpreting the image data. Applying a scale factor of 1.0 - results in an image whose size matches the pixel-based dimensions of the image. Applying a - different scale factor changes the size of the image as reported by the size property. - - - returns: An initialized `UIImage` object, or `nil` if the method failed. - */ - public static func af_threadSafeImageWithData(data: NSData, scale: CGFloat) -> UIImage? { - lock.lock() - let image = UIImage(data: data, scale: scale) - lock.unlock() - - return image - } -} - -// MARK: - Inflation - -extension UIImage { - private struct AssociatedKeys { - static var InflatedKey = "af_UIImage.Inflated" - } - - /// Returns whether the image is inflated. - public var af_inflated: Bool { - get { - if let inflated = objc_getAssociatedObject(self, &AssociatedKeys.InflatedKey) as? Bool { - return inflated - } else { - return false - } - } - set(inflated) { - objc_setAssociatedObject(self, &AssociatedKeys.InflatedKey, inflated, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - /** - Inflates the underlying compressed image data to be backed by an uncompressed bitmap representation. - - Inflating compressed image formats (such as PNG or JPEG) can significantly improve drawing performance as it - allows a bitmap representation to be constructed in the background rather than on the main thread. - */ - public func af_inflate() { - guard !af_inflated else { return } - - af_inflated = true - CGDataProviderCopyData(CGImageGetDataProvider(CGImage)) - } -} - -// MARK: - Alpha - -extension UIImage { - /// Returns whether the image contains an alpha component. - public var af_containsAlphaComponent: Bool { - let alphaInfo = CGImageGetAlphaInfo(CGImage) - - return ( - alphaInfo == .First || - alphaInfo == .Last || - alphaInfo == .PremultipliedFirst || - alphaInfo == .PremultipliedLast - ) - } - - /// Returns whether the image is opaque. - public var af_isOpaque: Bool { return !af_containsAlphaComponent } -} - -// MARK: - Scaling - -extension UIImage { - /** - Returns a new version of the image scaled to the specified size. - - - parameter size: The size to use when scaling the new image. - - - returns: A new image object. - */ - public func af_imageScaledToSize(size: CGSize) -> UIImage { - UIGraphicsBeginImageContextWithOptions(size, af_isOpaque, 0.0) - drawInRect(CGRect(origin: CGPointZero, size: size)) - - let scaledImage = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - - return scaledImage - } - - /** - Returns a new version of the image scaled from the center while maintaining the aspect ratio to fit within - a specified size. - - The resulting image contains an alpha component used to pad the width or height with the necessary transparent - pixels to fit the specified size. In high performance critical situations, this may not be the optimal approach. - To maintain an opaque image, you could compute the `scaledSize` manually, then use the `af_imageScaledToSize` - method in conjunction with a `.Center` content mode to achieve the same visual result. - - - parameter size: The size to use when scaling the new image. - - - returns: A new image object. - */ - public func af_imageAspectScaledToFitSize(size: CGSize) -> UIImage { - let imageAspectRatio = self.size.width / self.size.height - let canvasAspectRatio = size.width / size.height - - var resizeFactor: CGFloat - - if imageAspectRatio > canvasAspectRatio { - resizeFactor = size.width / self.size.width - } else { - resizeFactor = size.height / self.size.height - } - - let scaledSize = CGSize(width: self.size.width * resizeFactor, height: self.size.height * resizeFactor) - let origin = CGPoint(x: (size.width - scaledSize.width) / 2.0, y: (size.height - scaledSize.height) / 2.0) - - UIGraphicsBeginImageContextWithOptions(size, false, 0.0) - drawInRect(CGRect(origin: origin, size: scaledSize)) - - let scaledImage = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - - return scaledImage - } - - /** - Returns a new version of the image scaled from the center while maintaining the aspect ratio to fill a - specified size. Any pixels that fall outside the specified size are clipped. - - - parameter size: The size to use when scaling the new image. - - - returns: A new image object. - */ - public func af_imageAspectScaledToFillSize(size: CGSize) -> UIImage { - let imageAspectRatio = self.size.width / self.size.height - let canvasAspectRatio = size.width / size.height - - var resizeFactor: CGFloat - - if imageAspectRatio > canvasAspectRatio { - resizeFactor = size.height / self.size.height - } else { - resizeFactor = size.width / self.size.width - } - - let scaledSize = CGSize(width: self.size.width * resizeFactor, height: self.size.height * resizeFactor) - let origin = CGPoint(x: (size.width - scaledSize.width) / 2.0, y: (size.height - scaledSize.height) / 2.0) - - UIGraphicsBeginImageContextWithOptions(size, af_isOpaque, 0.0) - drawInRect(CGRect(origin: origin, size: scaledSize)) - - let scaledImage = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - - return scaledImage - } -} - -// MARK: - Rounded Corners - -extension UIImage { - /** - Returns a new version of the image with the corners rounded to the specified radius. - - - parameter radius: The radius to use when rounding the new image. - - parameter divideRadiusByImageScale: Whether to divide the radius by the image scale. Set to `true` when the - image has the same resolution for all screen scales such as @1x, @2x and - @3x (i.e. single image from web server). Set to `false` for images loaded - from an asset catalog with varying resolutions for each screen scale. - `false` by default. - - - returns: A new image object. - */ - public func af_imageWithRoundedCornerRadius(radius: CGFloat, divideRadiusByImageScale: Bool = false) -> UIImage { - UIGraphicsBeginImageContextWithOptions(size, false, 0.0) - - let scaledRadius = divideRadiusByImageScale ? radius / scale : radius - - let clippingPath = UIBezierPath(roundedRect: CGRect(origin: CGPointZero, size: size), cornerRadius: scaledRadius) - clippingPath.addClip() - - drawInRect(CGRect(origin: CGPointZero, size: size)) - - let roundedImage = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - - return roundedImage - } - - /** - Returns a new version of the image rounded into a circle. - - - returns: A new image object. - */ - public func af_imageRoundedIntoCircle() -> UIImage { - let radius = min(size.width, size.height) / 2.0 - var squareImage = self - - if size.width != size.height { - let squareDimension = min(size.width, size.height) - let squareSize = CGSize(width: squareDimension, height: squareDimension) - squareImage = af_imageAspectScaledToFillSize(squareSize) - } - - UIGraphicsBeginImageContextWithOptions(squareImage.size, false, 0.0) - - let clippingPath = UIBezierPath( - roundedRect: CGRect(origin: CGPointZero, size: squareImage.size), - cornerRadius: radius - ) - - clippingPath.addClip() - - squareImage.drawInRect(CGRect(origin: CGPointZero, size: squareImage.size)) - - let roundedImage = UIGraphicsGetImageFromCurrentImageContext() - UIGraphicsEndImageContext() - - return roundedImage - } -} - -#if os(iOS) || os(tvOS) - -// MARK: - Core Image Filters - -extension UIImage { - /** - Returns a new version of the image using a CoreImage filter with the specified name and parameters. - - - parameter filterName: The name of the CoreImage filter to use on the new image. - - parameter filterParameters: The parameters to apply to the CoreImage filter. - - - returns: A new image object, or `nil` if the filter failed for any reason. - */ - public func af_imageWithAppliedCoreImageFilter( - filterName: String, - filterParameters: [String: AnyObject]? = nil) -> UIImage? - { - var image: CoreImage.CIImage? = CIImage - - if image == nil, let CGImage = self.CGImage { - image = CoreImage.CIImage(CGImage: CGImage) - } - - guard let coreImage = image else { return nil } - - let context = CIContext(options: [kCIContextPriorityRequestLow: true]) - - var parameters: [String: AnyObject] = filterParameters ?? [:] - parameters[kCIInputImageKey] = coreImage - - guard let filter = CIFilter(name: filterName, withInputParameters: parameters) else { return nil } - guard let outputImage = filter.outputImage else { return nil } - - let cgImageRef = context.createCGImage(outputImage, fromRect: outputImage.extent) - - return UIImage(CGImage: cgImageRef, scale: scale, orientation: imageOrientation) - } -} - -#endif diff --git a/Carthage/Checkouts/AlamofireImage/Source/UIImageView+AlamofireImage.swift b/Carthage/Checkouts/AlamofireImage/Source/UIImageView+AlamofireImage.swift deleted file mode 100644 index 17f28e6..0000000 --- a/Carthage/Checkouts/AlamofireImage/Source/UIImageView+AlamofireImage.swift +++ /dev/null @@ -1,373 +0,0 @@ -// UIImageView+AlamofireImage.swift -// -// Copyright (c) 2015-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 Alamofire -import Foundation -import UIKit - -extension UIImageView { - - // MARK: - ImageTransition - - /// Used to wrap all `UIView` animation transition options alongside a duration. - public enum ImageTransition { - case None - case CrossDissolve(NSTimeInterval) - case CurlDown(NSTimeInterval) - case CurlUp(NSTimeInterval) - case FlipFromBottom(NSTimeInterval) - case FlipFromLeft(NSTimeInterval) - case FlipFromRight(NSTimeInterval) - case FlipFromTop(NSTimeInterval) - case Custom( - duration: NSTimeInterval, - animationOptions: UIViewAnimationOptions, - animations: (UIImageView, Image) -> Void, - completion: (Bool -> Void)? - ) - - /// The duration of the image transition in seconds. - public var duration: NSTimeInterval { - switch self { - case None: - return 0.0 - case CrossDissolve(let duration): - return duration - case CurlDown(let duration): - return duration - case CurlUp(let duration): - return duration - case FlipFromBottom(let duration): - return duration - case FlipFromLeft(let duration): - return duration - case FlipFromRight(let duration): - return duration - case FlipFromTop(let duration): - return duration - case Custom(let duration, _, _, _): - return duration - } - } - - /// The animation options of the image transition. - public var animationOptions: UIViewAnimationOptions { - switch self { - case None: - return .TransitionNone - case CrossDissolve: - return .TransitionCrossDissolve - case CurlDown: - return .TransitionCurlDown - case CurlUp: - return .TransitionCurlUp - case FlipFromBottom: - return .TransitionFlipFromBottom - case FlipFromLeft: - return .TransitionFlipFromLeft - case FlipFromRight: - return .TransitionFlipFromRight - case FlipFromTop: - return .TransitionFlipFromTop - case Custom(_, let animationOptions, _, _): - return animationOptions - } - } - - /// The animation options of the image transition. - public var animations: ((UIImageView, Image) -> Void) { - switch self { - case Custom(_, _, let animations, _): - return animations - default: - return { $0.image = $1 } - } - } - - /// The completion closure associated with the image transition. - public var completion: (Bool -> Void)? { - switch self { - case Custom(_, _, _, let completion): - return completion - default: - return nil - } - } - } - - // MARK: - Private - AssociatedKeys - - private struct AssociatedKeys { - static var ImageDownloaderKey = "af_UIImageView.ImageDownloader" - static var SharedImageDownloaderKey = "af_UIImageView.SharedImageDownloader" - static var ActiveRequestReceiptKey = "af_UIImageView.ActiveRequestReceipt" - } - - // MARK: - Associated Properties - - /// The instance image downloader used to download all images. If this property is `nil`, the `UIImageView` will - /// fallback on the `af_sharedImageDownloader` for all downloads. The most common use case for needing to use a - /// custom instance image downloader is when images are behind different basic auth credentials. - public var af_imageDownloader: ImageDownloader? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ImageDownloaderKey) as? ImageDownloader - } - set(downloader) { - objc_setAssociatedObject(self, &AssociatedKeys.ImageDownloaderKey, downloader, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - /// The shared image downloader used to download all images. By default, this is the default `ImageDownloader` - /// instance backed with an `AutoPurgingImageCache` which automatically evicts images from the cache when the memory - /// capacity is reached or memory warning notifications occur. The shared image downloader is only used if the - /// `af_imageDownloader` is `nil`. - public class var af_sharedImageDownloader: ImageDownloader { - get { - if let downloader = objc_getAssociatedObject(self, &AssociatedKeys.SharedImageDownloaderKey) as? ImageDownloader { - return downloader - } else { - return ImageDownloader.defaultInstance - } - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.SharedImageDownloaderKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - var af_activeRequestReceipt: RequestReceipt? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ActiveRequestReceiptKey) as? RequestReceipt - } - set { - objc_setAssociatedObject(self, &AssociatedKeys.ActiveRequestReceiptKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } - - // MARK: - Image Download - - /** - Asynchronously downloads an image from the specified URL, applies the specified image filter to the downloaded - image and sets it once finished while executing the image transition. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - The `completion` closure is called after the image download and filtering are complete, but before the start of - the image transition. Please note it is no longer the responsibility of the `completion` closure to set the - image. It will be set automatically. If you require a second notification after the image transition completes, - use a `.Custom` image transition with a `completion` closure. The `.Custom` `completion` closure is called when - the image transition is finished. - - - parameter URL: The URL used for the image request. - - parameter placeholderImage: The image to be set initially until the image request finished. If - `nil`, the image view will not change its image until the image - request finishes. Defaults to `nil`. - - parameter filter: The image filter applied to the image after the image request is - finished. Defaults to `nil`. - - parameter imageTransition: The image transition animation applied to the image when set. - Defaults to `.None`. - - parameter runImageTransitionIfCached: Whether to run the image transition if the image is cached. Defaults - to `false`. - - parameter completion: A closure to be executed when the image request finishes. The closure - has no return value and takes three arguments: the original request, - the response from the server and the result containing either the - image or the error that occurred. If the image was returned from the - image cache, the response will be `nil`. Defaults to `nil`. - */ - public func af_setImageWithURL( - URL: NSURL, - placeholderImage: UIImage? = nil, - filter: ImageFilter? = nil, - imageTransition: ImageTransition = .None, - runImageTransitionIfCached: Bool = false, - completion: (Response -> Void)? = nil) - { - af_setImageWithURLRequest( - URLRequestWithURL(URL), - placeholderImage: placeholderImage, - filter: filter, - imageTransition: imageTransition, - runImageTransitionIfCached: runImageTransitionIfCached, - completion: completion - ) - } - - /** - Asynchronously downloads an image from the specified URL Request, applies the specified image filter to the downloaded - image and sets it once finished while executing the image transition. - - If the image is cached locally, the image is set immediately. Otherwise the specified placehoder image will be - set immediately, and then the remote image will be set once the image request is finished. - - The `completion` closure is called after the image download and filtering are complete, but before the start of - the image transition. Please note it is no longer the responsibility of the `completion` closure to set the - image. It will be set automatically. If you require a second notification after the image transition completes, - use a `.Custom` image transition with a `completion` closure. The `.Custom` `completion` closure is called when - the image transition is finished. - - - parameter URLRequest: The URL request. - - parameter placeholderImage: The image to be set initially until the image request finished. If - `nil`, the image view will not change its image until the image - request finishes. Defaults to `nil`. - - parameter filter: The image filter applied to the image after the image request is - finished. Defaults to `nil`. - - parameter imageTransition: The image transition animation applied to the image when set. - Defaults to `.None`. - - parameter runImageTransitionIfCached: Whether to run the image transition if the image is cached. Defaults - to `false`. - - parameter completion: A closure to be executed when the image request finishes. The closure - has no return value and takes three arguments: the original request, - the response from the server and the result containing either the - image or the error that occurred. If the image was returned from the - image cache, the response will be `nil`. Defaults to `nil`. - */ - public func af_setImageWithURLRequest( - URLRequest: URLRequestConvertible, - placeholderImage: UIImage? = nil, - filter: ImageFilter? = nil, - imageTransition: ImageTransition = .None, - runImageTransitionIfCached: Bool = false, - completion: (Response -> Void)? = nil) - { - guard !isURLRequestURLEqualToActiveRequestURL(URLRequest) else { return } - - af_cancelImageRequest() - - let imageDownloader = af_imageDownloader ?? UIImageView.af_sharedImageDownloader - let imageCache = imageDownloader.imageCache - - // Use the image from the image cache if it exists - if let image = imageCache?.imageForRequest(URLRequest.URLRequest, withAdditionalIdentifier: filter?.identifier) { - let response = Response( - request: URLRequest.URLRequest, - response: nil, - data: nil, - result: .Success(image) - ) - - completion?(response) - - if runImageTransitionIfCached { - let tinyDelay = dispatch_time(DISPATCH_TIME_NOW, Int64(0.001 * Float(NSEC_PER_SEC))) - - // Need to let the runloop cycle for the placeholder image to take affect - dispatch_after(tinyDelay, dispatch_get_main_queue()) { - self.runImageTransition(imageTransition, withImage: image) - } - } else { - self.image = image - } - - return - } - - // Set the placeholder since we're going to have to download - if let placeholderImage = placeholderImage { self.image = placeholderImage } - - // Generate a unique download id to check whether the active request has changed while downloading - let downloadID = NSUUID().UUIDString - - // Download the image, then run the image transition or completion handler - let requestReceipt = imageDownloader.downloadImage( - URLRequest: URLRequest, - receiptID: downloadID, - filter: filter, - completion: { [weak self] response in - guard let strongSelf = self else { return } - - completion?(response) - - guard - strongSelf.isURLRequestURLEqualToActiveRequestURL(response.request) && - strongSelf.af_activeRequestReceipt?.receiptID == downloadID - else { - return - } - - if let image = response.result.value { - strongSelf.runImageTransition(imageTransition, withImage: image) - } - - strongSelf.af_activeRequestReceipt = nil - } - ) - - af_activeRequestReceipt = requestReceipt - } - - // MARK: - Image Download Cancellation - - /** - Cancels the active download request, if one exists. - */ - public func af_cancelImageRequest() { - guard let activeRequestReceipt = af_activeRequestReceipt else { return } - - let imageDownloader = af_imageDownloader ?? UIImageView.af_sharedImageDownloader - imageDownloader.cancelRequestForRequestReceipt(activeRequestReceipt) - - af_activeRequestReceipt = nil - } - - // MARK: - Image Transition - - /** - Runs the image transition on the image view with the specified image. - - - parameter imageTransition: The image transition to ran on the image view. - - parameter image: The image to use for the image transition. - */ - public func runImageTransition(imageTransition: ImageTransition, withImage image: Image) { - UIView.transitionWithView( - self, - duration: imageTransition.duration, - options: imageTransition.animationOptions, - animations: { - imageTransition.animations(self, image) - }, - completion: imageTransition.completion - ) - } - - // MARK: - Private - URL Request Helper Methods - - private func URLRequestWithURL(URL: NSURL) -> NSURLRequest { - let mutableURLRequest = NSMutableURLRequest(URL: URL) - - for mimeType in Request.acceptableImageContentTypes { - mutableURLRequest.addValue(mimeType, forHTTPHeaderField: "Accept") - } - - return mutableURLRequest - } - - private func isURLRequestURLEqualToActiveRequestURL(URLRequest: URLRequestConvertible?) -> Bool { - if let - currentRequest = af_activeRequestReceipt?.request.task.originalRequest - where currentRequest.URLString == URLRequest?.URLRequest.URLString - { - return true - } - - return false - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/BaseTestCase.swift b/Carthage/Checkouts/AlamofireImage/Tests/BaseTestCase.swift deleted file mode 100644 index 6acfcf3..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/BaseTestCase.swift +++ /dev/null @@ -1,76 +0,0 @@ -// BaseTestCase.swift -// -// Copyright (c) 2015-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 Alamofire -import AlamofireImage -import Foundation -import XCTest - -class BaseTestCase : XCTestCase { - let timeout = 5.0 - var manager: Manager! - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - manager = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - - let defaultHeaders = Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders - configuration.HTTPAdditionalHeaders = defaultHeaders - - return configuration - }() - - return Manager(configuration: configuration) - }() - } - - override func tearDown() { - super.tearDown() - - manager.session.finishTasksAndInvalidate() - manager = nil - } - - // MARK: - Resources - - func URLForResource(fileName: String, withExtension: String) -> NSURL { - let bundle = NSBundle(forClass: BaseTestCase.self) - return bundle.URLForResource(fileName, withExtension: withExtension)! - } - - func imageForResource(fileName: String, withExtension ext: String) -> Image { - let URL = URLForResource(fileName, withExtension: ext) - let data = NSData(contentsOfURL: URL)! - #if os(iOS) || os(tvOS) - let image = Image.af_threadSafeImageWithData(data, scale: UIScreen.mainScreen().scale)! - #elseif os(OSX) - let image = Image(data: data)! - #endif - - return image - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/ImageCacheTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/ImageCacheTests.swift deleted file mode 100644 index 94fd046..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/ImageCacheTests.swift +++ /dev/null @@ -1,368 +0,0 @@ -// ImageCacheTests.swift -// -// Copyright (c) 2015-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. - -@testable import Alamofire -@testable import AlamofireImage -import Foundation -import XCTest - -class ImageCacheTestCase: BaseTestCase { - var cache: AutoPurgingImageCache! - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - cache = { - let memoryCapacity: UInt64 = 100 * 1024 * 1024 // 10 MB - let preferredSizeAfterPurge: UInt64 = 60 * 1024 * 1024 // 4 MB - - return AutoPurgingImageCache( - memoryCapacity: memoryCapacity, - preferredMemoryUsageAfterPurge: preferredSizeAfterPurge - ) - }() - } - - // MARK: - Initialization Tests - - func testThatCacheCanBeInitializedAndDeinitialized() { - // Given - var cache: AutoPurgingImageCache? = AutoPurgingImageCache() - - // When - cache = nil - - // Then - XCTAssertNil(cache, "cache should be nil after deinit") - } - - // MARK: - Add Image Tests - - func testThatItCanAddImageToCacheWithIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let cachedImage = cache.imageWithIdentifier(identifier) - - // Then - XCTAssertNotNil(cachedImage, "cached image should not be nil") - XCTAssertEqual(cachedImage, image, "cached image should be equal to image") - } - - func testThatItCanAddImageToCacheWithRequestIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let request = URLRequest(.GET, "https://images.example.com/animals") - let identifier = "-unicorn" - - // When - cache.addImage(image, forRequest: request, withAdditionalIdentifier: identifier) - let cachedImage = cache.imageForRequest(request, withAdditionalIdentifier: identifier) - - // Then - XCTAssertNotNil(cachedImage, "cached image should not be nil") - XCTAssertEqual(cachedImage, image, "cached image should be equal to image") - } - - func testThatAddingImageToCacheWithDuplicateIdentifierReplacesCachedImage() { - // Given - let unicornImage = imageForResource("unicorn", withExtension: "png") - let pirateImage = imageForResource("pirate", withExtension: "jpg") - let identifier = "animal" - - // When - cache.addImage(unicornImage, withIdentifier: identifier) - let cachedImage1 = cache.imageWithIdentifier(identifier) - - cache.addImage(pirateImage, withIdentifier: identifier) - let cachedImage2 = cache.imageWithIdentifier(identifier) - - // Then - XCTAssertNotNil(cachedImage1, "cached image 1 should not be nil") - XCTAssertNotNil(cachedImage2, "cached image 2 should not be nil") - - XCTAssertEqual(cachedImage1, unicornImage, "cached image 1 should be equal to unicorn image") - XCTAssertEqual(cachedImage2, pirateImage, "cached image 2 should be equal to pirate image") - XCTAssertNotEqual(cachedImage1, cachedImage2, "cached image 1 should not be equal to cached image 2") - } - - func testThatAddingImageToCacheWithDuplicateRequestIdentifierReplacesCachedImage() { - // Given - let unicornImage = imageForResource("unicorn", withExtension: "png") - let pirateImage = imageForResource("pirate", withExtension: "jpg") - let request = URLRequest(.GET, "https://images.example.com/animals") - let identifier = "animal" - - // When - cache.addImage(unicornImage, forRequest: request, withAdditionalIdentifier: identifier) - let cachedImage1 = cache.imageForRequest(request, withAdditionalIdentifier: identifier) - - cache.addImage(pirateImage, forRequest: request, withAdditionalIdentifier: identifier) - let cachedImage2 = cache.imageForRequest(request, withAdditionalIdentifier: identifier) - - // Then - XCTAssertNotNil(cachedImage1, "cached image 1 should not be nil") - XCTAssertNotNil(cachedImage2, "cached image 2 should not be nil") - - XCTAssertEqual(cachedImage1, unicornImage, "cached image 1 should be equal to unicorn image") - XCTAssertEqual(cachedImage2, pirateImage, "cached image 2 should be equal to pirate image") - XCTAssertNotEqual(cachedImage1, cachedImage2, "cached image 1 should not be equal to cached image 2") - } - - // MARK: - Remove Image Tests - - func testThatItCanRemoveImageFromCacheWithIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let cachedImageExists = cache.imageWithIdentifier(identifier) != nil - - cache.removeImageWithIdentifier(identifier) - let cachedImageExistsAfterRemoval = cache.imageWithIdentifier(identifier) != nil - - // Then - XCTAssertTrue(cachedImageExists, "cached image exists should be true") - XCTAssertFalse(cachedImageExistsAfterRemoval, "cached image exists after removal should be false") - } - - func testThatItCanRemoveImageFromCacheWithRequestIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let request = URLRequest(.GET, "https://images.example.com/animals") - let identifier = "unicorn" - - // When - cache.addImage(image, forRequest: request, withAdditionalIdentifier: identifier) - let cachedImageExists = cache.imageForRequest(request, withAdditionalIdentifier: identifier) != nil - - cache.removeImageForRequest(request, withAdditionalIdentifier: identifier) - let cachedImageExistsAfterRemoval = cache.imageForRequest(request, withAdditionalIdentifier: identifier) != nil - - // Then - XCTAssertTrue(cachedImageExists, "cached image exists should be true") - XCTAssertFalse(cachedImageExistsAfterRemoval, "cached image exists after removal should be false") - } - - func testThatItCanRemoveAllImagesFromCache() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let cachedImageExists = cache.imageWithIdentifier(identifier) != nil - - cache.removeAllImages() - let cachedImageExistsAfterRemoval = cache.imageWithIdentifier(identifier) != nil - - // Then - XCTAssertTrue(cachedImageExists, "cached image exists should be true") - XCTAssertFalse(cachedImageExistsAfterRemoval, "cached image exists after removal should be false") - } - -#if os(iOS) - - func testThatItRemovesAllImagesFromCacheWhenReceivingMemoryWarningNotification() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let cachedImageExists = cache.imageWithIdentifier(identifier) != nil - - NSNotificationCenter.defaultCenter().postNotificationName( - UIApplicationDidReceiveMemoryWarningNotification, - object: nil - ) - - let cachedImageExistsAfterNotification = cache.imageWithIdentifier(identifier) != nil - - // Then - XCTAssertTrue(cachedImageExists, "cached image exists should be true") - XCTAssertFalse(cachedImageExistsAfterNotification, "cached image exists after notification should be false") - } - -#endif - - // MARK: - Fetch Image Tests - - func testThatItCanFetchImageFromCacheWithIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - let cachedImageBeforeAdd = cache.imageWithIdentifier(identifier) - cache.addImage(image, withIdentifier: identifier) - let cachedImageAfterAdd = cache.imageWithIdentifier(identifier) - - // Then - XCTAssertNil(cachedImageBeforeAdd, "cached image before add should be nil") - XCTAssertNotNil(cachedImageAfterAdd, "cached image after add should not be nil") - } - - func testThatItCanFetchImageFromCacheWithRequestIdentifier() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let request = URLRequest(.GET, "https://images.example.com/animals") - let identifier = "unicorn" - - // When - let cachedImageBeforeAdd = cache.imageForRequest(request, withAdditionalIdentifier: identifier) - cache.addImage(image, forRequest: request, withAdditionalIdentifier: identifier) - let cachedImageAfterAdd = cache.imageForRequest(request, withAdditionalIdentifier: identifier) - - // Then - XCTAssertNil(cachedImageBeforeAdd, "cached image before add should be nil") - XCTAssertNotNil(cachedImageAfterAdd, "cached image after add should not be nil") - } - - // MARK: - Memory Usage Tests - - func testThatItIncrementsMemoryUsageWhenAddingImageToCache() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - let initialMemoryUsage = cache.memoryUsage - cache.addImage(image, withIdentifier: identifier) - let currentMemoryUsage = cache.memoryUsage - - // Then - XCTAssertEqual(initialMemoryUsage, 0, "initial memory usage should be 0") - XCTAssertEqual(currentMemoryUsage, 164000, "current memory usage should be 164000") - } - - func testThatItDecrementsMemoryUsageWhenRemovingImageFromCache() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let initialMemoryUsage = cache.memoryUsage - cache.removeImageWithIdentifier(identifier) - let currentMemoryUsage = cache.memoryUsage - - // Then - XCTAssertEqual(initialMemoryUsage, 164000, "initial memory usage should be 164000") - XCTAssertEqual(currentMemoryUsage, 0, "current memory usage should be 0") - } - - func testThatItDecrementsMemoryUsageWhenRemovingAllImagesFromCache() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - cache.addImage(image, withIdentifier: identifier) - let initialMemoryUsage = cache.memoryUsage - cache.removeAllImages() - let currentMemoryUsage = cache.memoryUsage - - // Then - XCTAssertEqual(initialMemoryUsage, 164000, "initial memory usage should be 164000") - XCTAssertEqual(currentMemoryUsage, 0, "current memory usage should be 0") - } - - // MARK: - Purging Tests - - func testThatItPurgesImagesWhenMemoryCapacityIsReached() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - var memoryUsage: [UInt64] = [] - - // When - for index in 1...640 { - cache.addImage(image, withIdentifier: "\(identifier)-\(index)") - memoryUsage.append(cache.memoryUsage) - } - - memoryUsage = Array(memoryUsage.dropFirst(638)) - - // Then - XCTAssertEqual(memoryUsage[0], 104796000, "memory usage prior to purge does not match expected value") - XCTAssertEqual(memoryUsage[1], 62812000, "memory usage after purge does not match expected value") - } - - func testThatItPrioritizesImagesWithOldestLastAccessDatesDuringPurge() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - for index in 1...640 { - cache.addImage(image, withIdentifier: "\(identifier)-\(index)") - } - - // Then - for index in 1...257 { - let cachedImage = cache.imageWithIdentifier("\(identifier)-\(index)") - XCTAssertNil(cachedImage, "cached image with identifier: \"\(identifier)-\(index)\" should be nil") - } - - for index in 258...640 { - let cachedImage = cache.imageWithIdentifier("\(identifier)-\(index)") - XCTAssertNotNil(cachedImage, "cached image with identifier: \"\(identifier)-\(index)\" should not be nil") - } - } - - func testThatAccessingCachedImageUpdatesLastAccessDate() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let identifier = "unicorn" - - // When - for index in 1...639 { - cache.addImage(image, withIdentifier: "\(identifier)-\(index)") - } - - cache.imageWithIdentifier("\(identifier)-1") - cache.addImage(image, withIdentifier: "\(identifier)-640") - - // Then - let firstCachedImage = cache.imageWithIdentifier("\(identifier)-1") - XCTAssertNotNil(firstCachedImage, "first cached image should not be nil") - - for index in 2...258 { - let cachedImage = cache.imageWithIdentifier("\(identifier)-\(index)") - XCTAssertNil(cachedImage, "cached image with identifier: \"\(identifier)-\(index)\" should be nil") - } - - for index in 259...640 { - let cachedImage = cache.imageWithIdentifier("\(identifier)-\(index)") - XCTAssertNotNil(cachedImage, "cached image with identifier: \"\(identifier)-\(index)\" should not be nil") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/ImageDownloaderTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/ImageDownloaderTests.swift deleted file mode 100644 index cb94c57..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/ImageDownloaderTests.swift +++ /dev/null @@ -1,859 +0,0 @@ -// ImageDownloaderTests.swift -// -// Copyright (c) 2015-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. - -@testable import Alamofire -@testable import AlamofireImage -import Foundation -import XCTest - -private class ThreadCheckFilter: ImageFilter { - var calledOnMainQueue = false - - init() {} - - var filter: Image -> Image { - return { image in - self.calledOnMainQueue = NSThread.isMainThread() - return image - } - } -} - -// MARK: - - -#if os(iOS) - -private class TestCircleFilter: ImageFilter { - var filterOperationCompleted = false - - var filter: Image -> Image { - return { image in - self.filterOperationCompleted = true - return image.af_imageRoundedIntoCircle() - } - } -} - -#endif - -// MARK: - - -class ImageDownloaderTestCase: BaseTestCase { - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - ImageDownloader.defaultURLCache().removeAllCachedResponses() - } - - // MARK: - Initialization Tests - - func testThatImageDownloaderSingletonCanBeInitialized() { - // Given, When - let downloader = ImageDownloader.defaultInstance - - // Then - XCTAssertNotNil(downloader, "downloader should not be nil") - } - - func testThatImageDownloaderCanBeInitializedAndDeinitialized() { - // Given - var downloader: ImageDownloader? = ImageDownloader() - - // When - downloader = nil - - // Then - XCTAssertNil(downloader, "downloader should be nil") - } - - func testThatImageDownloaderCanBeInitializedWithManagerInstanceAndDeinitialized() { - // Given - var downloader: ImageDownloader? = ImageDownloader(sessionManager: Manager()) - - // When - downloader = nil - - // Then - XCTAssertNil(downloader, "downloader should be nil") - } - - func testThatImageDownloaderCanBeInitializedAndDeinitializedWithActiveDownloads() { - // Given - var downloader: ImageDownloader? = ImageDownloader() - - // When - downloader?.downloadImage(URLRequest: URLRequest(.GET, "https://httpbin.org/image/png")) { _ in - // No-op - } - - downloader = nil - - // Then - XCTAssertNil(downloader, "downloader should be nil") - } - - // MARK: - Image Download Tests - - func testThatItCanDownloadAnImage() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - var response: Response? - - // When - downloader.downloadImage(URLRequest: download) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertNotNil(response?.result, "result should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be a success case") - } - - func testThatItCanDownloadMultipleImagesSimultaneously() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - let expectation1 = expectationWithDescription("download 1 should succeed") - let expectation2 = expectationWithDescription("download 2 should succeed") - - var result1: Result? - var result2: Result? - - // When - downloader.downloadImage(URLRequest: download1) { closureResponse in - result1 = closureResponse.result - expectation1.fulfill() - } - - downloader.downloadImage(URLRequest: download2) { closureResponse in - result2 = closureResponse.result - expectation2.fulfill() - } - - let activeRequestCount = downloader.activeRequestCount - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(activeRequestCount, 2, "active request count should be 2") - - XCTAssertNotNil(result1, "result 1 should not be nil") - XCTAssertNotNil(result2, "result 2 should not be nil") - - XCTAssertTrue(result1?.isSuccess ?? false, "result 1 should be a success case") - XCTAssertTrue(result2?.isSuccess ?? false, "result 2 should be a success case") - } - - func testThatItCanEnqueueMultipleImages() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - let expectation = expectationWithDescription("both downloads should succeed") - var completedDownloads = 0 - - var results: [Result] = [] - - // When - downloader.downloadImages(URLRequests: [download1, download2], filter: nil) { closureResponse in - results.append(closureResponse.result) - - completedDownloads += 1 - if completedDownloads == 2 { expectation.fulfill() } - } - - let activeRequestCount = downloader.activeRequestCount - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(activeRequestCount, 2, "active request count should be 2") - - XCTAssertTrue(results[0].isSuccess, "the first result should be a success case") - XCTAssertTrue(results[1].isSuccess, "the second result should be a success case") - } - - func testThatItDoesNotExceedTheMaximumActiveDownloadsLimit() { - // Given - let downloader = ImageDownloader(maximumActiveDownloads: 1) - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1) { _ in - // No-op - } - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2) { _ in - // No-op - } - - let activeRequestCount = downloader.activeRequestCount - requestReceipt1?.request.cancel() - requestReceipt2?.request.cancel() - - // Then - XCTAssertEqual(activeRequestCount, 1, "active request count should be 1") - } - - func testThatItCallsTheCompletionHandlerEvenWhenDownloadFails() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/get") - let expectation = expectationWithDescription("download request should fail") - - var response: Response? - - // When - downloader.downloadImage(URLRequest: download) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be a failure case") - } - - func testThatItCanDownloadImagesWithDisabledURLCacheInSessionConfiguration() { - // Given - let downloader: ImageDownloader = { - let configuration: NSURLSessionConfiguration = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.URLCache = nil - - return configuration - }() - - let downloader = ImageDownloader(configuration: configuration) - return downloader - }() - - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - var response: Response? - - // When - downloader.downloadImage(URLRequest: download) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be a success case") - } - -#if os(iOS) - - // MARK: - Image Download Tests (iOS Only) - - func testThatItCanDownloadImageAndApplyImageFilter() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let scaledSize = CGSize(width: 100, height: 60) - let filter = ScaledToSizeFilter(size: scaledSize) - - let expectation = expectationWithDescription("image download should succeed") - - var response: Response? - - // When - downloader.downloadImage(URLRequest: download, filter: filter) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be a success case") - - if let image = response?.result.value { - XCTAssertEqual(image.size, scaledSize, "image size does not match expected value") - } - } - - func testThatItCanAppendFilterAndCompletionHandlerToExistingDownload() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let filter1 = ScaledToSizeFilter(size: CGSize(width: 50, height: 50)) - let filter2 = ScaledToSizeFilter(size: CGSize(width: 75, height: 75)) - - let expectation1 = expectationWithDescription("download request 1 should succeed") - let expectation2 = expectationWithDescription("download request 2 should succeed") - - var result1: Result? - var result2: Result? - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1, filter: filter1) { closureResponse in - result1 = closureResponse.result - expectation1.fulfill() - } - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2, filter: filter2) { closureResponse in - result2 = closureResponse.result - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(requestReceipt1?.request.task, requestReceipt2?.request.task, "request 1 and 2 should be equal") - - XCTAssertNotNil(result1, "result 1 should not be nil") - XCTAssertNotNil(result2, "result 2 should not be nil") - - XCTAssertTrue(result1?.isSuccess ?? false, "result 1 should be a success case") - XCTAssertTrue(result2?.isSuccess ?? false, "result 2 should be a success case") - - if let image = result1?.value { - XCTAssertEqual(image.size, CGSize(width: 50, height: 50), "image size does not match expected value") - } - - if let image = result2?.value { - XCTAssertEqual(image.size, CGSize(width: 75, height: 75), "image size does not match expected value") - } - } - - func testThatDownloadsWithMultipleResponseHandlersOnlyRunDuplicateImageFiltersOnce() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let filter1 = TestCircleFilter() - let filter2 = TestCircleFilter() - - let expectation1 = expectationWithDescription("download request 1 should succeed") - let expectation2 = expectationWithDescription("download request 2 should succeed") - - var result1: Result? - var result2: Result? - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1, filter: filter1) { closureResponse in - result1 = closureResponse.result - expectation1.fulfill() - } - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2, filter: filter2) { closureResponse in - result2 = closureResponse.result - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(requestReceipt1?.request.task, requestReceipt2?.request.task, "tasks 1 and 2 should be equal") - - XCTAssertNotNil(result1, "result 1 should not be nil") - XCTAssertNotNil(result2, "result 2 should not be nil") - - XCTAssertTrue(result1?.isSuccess ?? false, "result 1 should be a success case") - XCTAssertTrue(result2?.isSuccess ?? false, "result 2 should be a success case") - - XCTAssertTrue(filter1.filterOperationCompleted, "the filter 1 filter operation completed flag should be true") - XCTAssertFalse(filter2.filterOperationCompleted, "the filter 2 filter operation completed flag should be false") - } - -#endif - - // MARK: - Cancellation Tests - - func testThatCancellingDownloadCallsCompletionWithCancellationError() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation = expectationWithDescription("download request should succeed") - - var response: Response? - - // When - let requestReceipt = downloader.downloadImage(URLRequest: download) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - downloader.cancelRequestForRequestReceipt(requestReceipt!) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response, "response should not be nil") - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNil(response?.response, "response should be nil") - XCTAssertNil(response?.data, "data should be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be a failure case") - - if let error = response?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCancelled, "error code should be cancelled") - } - } - - func testThatCancellingDownloadWithMultipleResponseHandlersCancelsFirstYetAllowsSecondToComplete() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation1 = expectationWithDescription("download request 1 should succeed") - let expectation2 = expectationWithDescription("download request 2 should succeed") - - var response1: Response? - var response2: Response? - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1) { closureResponse in - response1 = closureResponse - expectation1.fulfill() - } - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2) { closureResponse in - response2 = closureResponse - expectation2.fulfill() - } - - downloader.cancelRequestForRequestReceipt(requestReceipt1!) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertEqual(requestReceipt1?.request.task, requestReceipt2?.request.task, "tasks 1 and 2 should be equal") - - XCTAssertNotNil(response1, "response 1 should not be nil") - XCTAssertNotNil(response1?.request, "response 1 request should not be nil") - XCTAssertNil(response1?.response, "response 1 response should be nil") - XCTAssertNil(response1?.data, "response 1 data should be nil") - XCTAssertTrue(response1?.result.isFailure ?? false, "response 1 result should be a failure case") - - if let error = response1?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCancelled, "error code should be cancelled") - } - - XCTAssertNotNil(response2, "response 2 should not be nil") - XCTAssertNotNil(response2?.request, "response 2 request should not be nil") - XCTAssertNotNil(response2?.response, "response 2 response should not be nil") - XCTAssertNotNil(response2?.data, "response 2 data should not be nil") - XCTAssertTrue(response2?.result.isSuccess ?? false, "response 2 result should be a success case") - } - - // MARK: - Authentication Tests - - func testThatItDoesNotAttachAuthenticationCredentialToRequestIfItDoesNotExist() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - // When - let requestReceipt = downloader.downloadImage(URLRequest: download) { _ in - // No-op - } - - let credential = requestReceipt?.request.delegate.credential - requestReceipt?.request.cancel() - - // Then - XCTAssertNil(credential, "credential should be nil") - } - - func testThatItAttachsUsernamePasswordCredentialToRequestIfItExists() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - // When - downloader.addAuthentication(user: "foo", password: "bar") - - let requestReceipt = downloader.downloadImage(URLRequest: download) { _ in - // No-op - } - - let credential = requestReceipt?.request.delegate.credential - requestReceipt?.request.cancel() - - // Then - XCTAssertNotNil(credential, "credential should not be nil") - } - - func testThatItAttachsAuthenticationCredentialToRequestIfItExists() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - // When - let credential = NSURLCredential(user: "foo", password: "bar", persistence: .ForSession) - downloader.addAuthentication(usingCredential: credential) - - let requestReceipt = downloader.downloadImage(URLRequest: download) { _ in - // No-op - } - - let requestCredential = requestReceipt?.request.delegate.credential - requestReceipt?.request.cancel() - - // Then - XCTAssertNotNil(requestCredential, "request credential should not be nil") - } - - // MARK: - Threading Tests - - func testThatItAlwaysCallsTheCompletionHandlerOnTheMainQueue() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation = expectationWithDescription("download request should succeed") - - var calledOnMainQueue = false - - // When - downloader.downloadImage(URLRequest: download) { _ in - calledOnMainQueue = NSThread.isMainThread() - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(calledOnMainQueue, "completion handler should be called on main queue") - } - - func testThatItNeverCallsTheImageFilterOnTheMainQueue() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let filter = ThreadCheckFilter() - - let expectation = expectationWithDescription("download request should succeed") - - // When - downloader.downloadImage(URLRequest: download, filter: filter) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertFalse(filter.calledOnMainQueue, "filter should not be called on main queue") - } - - // MARK: - Image Caching Tests - - func testThatCachedImageIsReturnedIfAllowedByCachePolicy() { - // Given - let downloader = ImageDownloader() - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation1 = expectationWithDescription("image download should succeed") - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1) { _ in - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let download2 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - download2.cachePolicy = .ReturnCacheDataElseLoad - - let expectation2 = expectationWithDescription("image download should succeed") - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2) { _ in - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(requestReceipt1, "request receipt 1 should not be nil") - XCTAssertNil(requestReceipt2, "request receipt 2 should be nil") - } - - func testThatCachedImageIsNotReturnedIfNotAllowedByCachePolicy() { - // Given - let downloader = ImageDownloader() - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation1 = expectationWithDescription("image download should succeed") - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download1) { _ in - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let download2 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - download2.cachePolicy = .ReloadIgnoringLocalCacheData - - let expectation2 = expectationWithDescription("image download should succeed") - - let requestReceipt2 = downloader.downloadImage(URLRequest: download2) { _ in - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(requestReceipt1, "request receipt 1 should not be nil") - XCTAssertNotNil(requestReceipt2, "request receipt 2 should not be nil") - } - - func testThatItCanDownloadImagesWhenNoImageCacheIsAvailable() { - // Given - let downloader = ImageDownloader(imageCache: nil) - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - var response: Response? - - // When - downloader.downloadImage(URLRequest: download) { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be a success case") - } - - func testThatItAutomaticallyCachesDownloadedImageIfCacheIsAvailable() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - - let expectation1 = expectationWithDescription("image download should succeed") - - var result1: Result? - var result2: Result? - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download) { closureResponse in - result1 = closureResponse.result - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation2 = expectationWithDescription("image download should succeed") - - let requestReceipt2 = downloader.downloadImage(URLRequest: download) { closureResponse in - result2 = closureResponse.result - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(requestReceipt1, "request receipt 1 should not be nil") - XCTAssertNil(requestReceipt2, "request receipt 2 should be nil") - - XCTAssertNotNil(result1, "result 1 should not be nil") - XCTAssertNotNil(result2, "result 2 should not be nil") - - XCTAssertTrue(result1?.isSuccess ?? false, "result 1 should be a success case") - XCTAssertTrue(result2?.isSuccess ?? false, "result 2 should be a success case") - - if let image1 = result1?.value, let image2 = result2?.value { - XCTAssertEqual(image1, image2, "images 1 and 2 should be equal") - } - } - -#if os(iOS) - - func testThatFilteredImageIsStoredInCacheIfCacheIsAvailable() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let size = CGSize(width: 20, height: 20) - let filter = ScaledToSizeFilter(size: size) - - let expectation1 = expectationWithDescription("image download should succeed") - - var result1: Result? - var result2: Result? - - // When - let requestReceipt1 = downloader.downloadImage(URLRequest: download, filter: filter) { closureResponse in - result1 = closureResponse.result - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation2 = expectationWithDescription("image download should succeed") - - let requestReceipt2 = downloader.downloadImage(URLRequest: download, filter: filter) { closureResponse in - result2 = closureResponse.result - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(requestReceipt1, "request receipt 1 should not be nil") - XCTAssertNil(requestReceipt2, "request receipt 2 should be nil") - - XCTAssertNotNil(result1, "result 1 should not be nil") - XCTAssertNotNil(result2, "result 2 should not be nil") - - XCTAssertTrue(result1?.isSuccess ?? false, "result 1 should be a success case") - XCTAssertTrue(result2?.isSuccess ?? false, "result 2 should be a success case") - - if let image1 = result1?.value, let image2 = result2?.value { - XCTAssertEqual(image1, image2, "images 1 and 2 should be equal") - XCTAssertEqual(image1.size, size, "image size should match expected size") - XCTAssertEqual(image2.size, size, "image size should match expected size") - } else { - XCTFail("images should not be nil") - } - } - -#endif - - // MARK: - Internal Logic Tests - - func testThatStartingRequestIncrementsActiveRequestCount() { - // Given - let downloader = ImageDownloader() - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let request = downloader.sessionManager.request(download) - - // When - let activeRequestCountBefore = downloader.activeRequestCount - downloader.startRequest(request) - let activeRequestCountAfter = downloader.activeRequestCount - - request.cancel() - - // Then - XCTAssertEqual(activeRequestCountBefore, 0, "active request count before should be 0") - XCTAssertEqual(activeRequestCountAfter, 1, "active request count after should be 1") - } - - func testThatEnqueueRequestInsertsRequestAtTheBackOfTheQueueWithFIFODownloadPrioritization() { - // Given - let downloader = ImageDownloader() - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - let request1 = downloader.sessionManager.request(download1) - let request2 = downloader.sessionManager.request(download2) - - // When - downloader.enqueueRequest(request1) - downloader.enqueueRequest(request2) - - let queuedRequests = downloader.queuedRequests - - // Then - XCTAssertEqual(queuedRequests.count, 2, "queued requests count should be 1") - XCTAssertEqual(queuedRequests[0].task, request1.task, "first queued request should be request 1") - XCTAssertEqual(queuedRequests[1].task, request2.task, "second queued request should be request 2") - } - - func testThatEnqueueRequestInsertsRequestAtTheFrontOfTheQueueWithLIFODownloadPrioritization() { - // Given - let downloader = ImageDownloader(downloadPrioritization: .LIFO) - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - let request1 = downloader.sessionManager.request(download1) - let request2 = downloader.sessionManager.request(download2) - - // When - downloader.enqueueRequest(request1) - downloader.enqueueRequest(request2) - - let queuedRequests = downloader.queuedRequests - - // Then - XCTAssertEqual(queuedRequests.count, 2, "queued requests count should be 1") - XCTAssertEqual(queuedRequests[0].task, request2.task, "first queued request should be request 2") - XCTAssertEqual(queuedRequests[1].task, request1.task, "second queued request should be request 1") - } - - func testThatDequeueRequestAlwaysRemovesRequestFromTheFrontOfTheQueue() { - // Given - let downloader = ImageDownloader(downloadPrioritization: .FIFO) - - let download1 = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let download2 = URLRequest(.GET, "https://httpbin.org/image/png") - - let request1 = downloader.sessionManager.request(download1) - let request2 = downloader.sessionManager.request(download2) - - // When - downloader.enqueueRequest(request1) - downloader.enqueueRequest(request2) - downloader.dequeueRequest() - - let queuedRequests = downloader.queuedRequests - - // Then - XCTAssertEqual(queuedRequests.count, 1, "queued requests count should be 1") - XCTAssertEqual(queuedRequests[0].task, request2.task, "queued request should be request 2") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/ImageFilterTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/ImageFilterTests.swift deleted file mode 100644 index bc52984..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/ImageFilterTests.swift +++ /dev/null @@ -1,296 +0,0 @@ -// ImageFilterTests.swift -// -// Copyright (c) 2015-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 AlamofireImage -import Foundation -import UIKit -import XCTest - -class ImageFilterTestCase: BaseTestCase { - let squareSize = CGSize(width: 50, height: 50) - let largeSquareSize = CGSize(width: 100, height: 100) - let scale = Int(round(UIScreen.mainScreen().scale)) - - // MARK: - ImageFilter Protocol Extension Identifiers - - func testThatImageFilterIdentifierIsImplemented() { - // Given - let filter = CircleFilter() - - // When - let identifier = filter.identifier - - // Then - XCTAssertEqual(identifier, "CircleFilter", "identifier does not match expected value") - } - - func testThatImageFilterWhereSelfIsSizableIdentifierIsImplemented() { - // Given - let filter = ScaledToSizeFilter(size: CGSize(width: 50.3333334, height: 60.879)) - - // When - let identifier = filter.identifier - - // Then - XCTAssertEqual(identifier, "ScaledToSizeFilter-size:(50x61)", "identifier does not match expected value") - } - - func testThatImageFilterWhereSelfIsRoundableIdentifierIsImplemented() { - // Given - let filter = RoundedCornersFilter(radius: 12) - - // When - let identifier = filter.identifier - - // Then - let expectedIdentifier = "RoundedCornersFilter-radius:(12)-divided:(false)" - XCTAssertEqual(identifier, expectedIdentifier, "identifier does not match expected value") - } - - // MARK: - CompositeImageFilter Protocol Extension Identifiers - - func testThatCompositeImageFilterIdentifierIsImplemented() { - // Given - let filter = ScaledToSizeWithRoundedCornersFilter(size: CGSize(width: 200, height: 100), radius: 20.0123) - - // When - let identifier = filter.identifier - - // Then - let expectedIdentifier = "ScaledToSizeFilter-size:(200x100)_RoundedCornersFilter-radius:(20)-divided:(false)" - XCTAssertEqual(identifier, expectedIdentifier, "identifier does not match expected value") - } - - // MARK: - DynamicImageFilter Tests - - func testThatDynamicImageFilterIdentifierIsImplemented() { - // Given - let identifier = "DynamicFilter" - - // When - let filter = DynamicImageFilter(identifier) { $0 } - - // Then - XCTAssertEqual(filter.identifier, identifier, "identifier does not match expected value") - } - - func testThatDynamicImageFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = DynamicImageFilter("DynamicScaleToSizeFilter") { image in - return image.af_imageScaledToSize(CGSize(width: 50.0, height: 50.0)) - } - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-scaled-50x50-@\(scale)x", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - // MARK: - DynamicCompositeImageFilter Tests - - func testThatDynamicCompositeImageFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = DynamicCompositeImageFilter( - ScaledToSizeFilter(size: largeSquareSize), - RoundedCornersFilter(radius: 20) - ) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource( - "pirate-scaled.to.size.with.rounded.corners-100x100x20-@\(scale)x", - withExtension: "png" - ) - - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - // MARK: - Single Pass Image Filter Tests - - func testThatScaledToSizeFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = ScaledToSizeFilter(size: squareSize) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-scaled-50x50-@\(scale)x", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatAspectScaledToFitSizeFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = AspectScaledToFitSizeFilter(size: squareSize) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-aspect.scaled.to.fit-50x50-@\(scale)x", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatAspectScaledToFillSizeFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = AspectScaledToFillSizeFilter(size: squareSize) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-aspect.scaled.to.fill-50x50-@\(scale)x", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatRoundedCornersFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = RoundedCornersFilter(radius: 20, divideRadiusByImageScale: true) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-radius-20", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - - let expectedIdentifier = "RoundedCornersFilter-radius:(20)-divided:(true)" - XCTAssertEqual(filter.identifier, expectedIdentifier, "filter identifier does not match") - } - - func testThatCircleFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = CircleFilter() - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource("pirate-circle", withExtension: "png") - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatBlurFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("unicorn", withExtension: "png") - let filter = BlurFilter(blurRadius: 8) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage: UIImage - - if #available(iOS 9.0, *) { - expectedFilteredImage = imageForResource("unicorn-blurred-8-ios-9", withExtension: "png") - } else if #available(iOS 8.3, *) { - expectedFilteredImage = imageForResource("unicorn-blurred-8-ios-8.3", withExtension: "png") - } else { - expectedFilteredImage = imageForResource("unicorn-blurred-8-ios-8.1", withExtension: "png") - } - - let pixelsMatch = filteredImage.af_isEqualToImage(expectedFilteredImage) - - XCTAssertTrue(pixelsMatch, "pixels match should be true") - } - - // MARK: - Composite Image Filter Tests - - func testThatScaledToSizeWithRoundedCornersFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = ScaledToSizeWithRoundedCornersFilter(size: largeSquareSize, radius: 20) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource( - "pirate-scaled.to.size.with.rounded.corners-100x100x20-@\(scale)x", - withExtension: "png" - ) - - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatAspectScaledToFillSizeWithRoundedCornersFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = AspectScaledToFillSizeWithRoundedCornersFilter(size: largeSquareSize, radius: 20) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource( - "pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@\(scale)x", - withExtension: "png" - ) - - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatScaledToSizeCircleFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = ScaledToSizeCircleFilter(size: largeSquareSize) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource( - "pirate-scaled.to.size.circle-100x100-@\(scale)x", - withExtension: "png" - ) - - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } - - func testThatAspectScaledToFillSizeCircleFilterReturnsCorrectFilteredImage() { - // Given - let image = imageForResource("pirate", withExtension: "jpg") - let filter = AspectScaledToFillSizeCircleFilter(size: largeSquareSize) - - // When - let filteredImage = filter.filter(image) - - // Then - let expectedFilteredImage = imageForResource( - "pirate-aspect.scaled.to.fill.size.circle-100x100-@\(scale)x", - withExtension: "png" - ) - - XCTAssertTrue(filteredImage.af_isEqualToImage(expectedFilteredImage), "filtered image pixels do not match") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Info.plist b/Carthage/Checkouts/AlamofireImage/Tests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Carthage/Checkouts/AlamofireImage/Tests/RequestTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/RequestTests.swift deleted file mode 100644 index 5261b2a..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/RequestTests.swift +++ /dev/null @@ -1,376 +0,0 @@ -// RequestTests.swift -// -// Copyright (c) 2015-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 Alamofire -@testable import AlamofireImage -import Foundation -import XCTest - -class RequestTestCase: BaseTestCase { - var acceptableImageContentTypes: Set! - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - acceptableImageContentTypes = Request.acceptableImageContentTypes - } - - override func tearDown() { - super.tearDown() - Request.acceptableImageContentTypes = acceptableImageContentTypes - } - - // MARK: - Image Content Type Tests - - func testThatAddingAcceptableImageContentTypesInsertsThemIntoTheGlobalList() { - // Given - let contentTypes: Set = ["image/jpg", "binary/octet-stream"] - - // When - let beforeCount = Request.acceptableImageContentTypes.count - Request.addAcceptableImageContentTypes(contentTypes) - let afterCount = Request.acceptableImageContentTypes.count - - // Then - XCTAssertEqual(beforeCount, 10, "before count should be 10") - XCTAssertEqual(afterCount, 12, "after count should be 12") - } - - // MARK: - Image Serialization Tests - - func testThatImageResponseSerializerCanDownloadPNGImage() { - // Given - let URLString = "https://httpbin.org/image/png" - let expectation = expectationWithDescription("Request should return PNG response image") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be success") - - if let image = response?.result.value { - #if os(iOS) - let screenScale = UIScreen.mainScreen().scale - let expectedSize = CGSize(width: CGFloat(100) / screenScale, height: CGFloat(100) / screenScale) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - XCTAssertEqual(image.scale, screenScale, "image scale does not match expected value") - #elseif os(OSX) - let expectedSize = CGSize(width: 100.0, height: 100.0) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - #endif - } else { - XCTFail("result image should not be nil") - } - } - - func testThatImageResponseSerializerCanDownloadJPGImage() { - // Given - let URLString = "https://httpbin.org/image/jpeg" - let expectation = expectationWithDescription("Request should return JPG response image") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be success") - - if let image = response?.result.value { - #if os(iOS) - let screenScale = UIScreen.mainScreen().scale - let expectedSize = CGSize(width: CGFloat(239) / screenScale, height: CGFloat(178) / screenScale) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - XCTAssertEqual(image.scale, screenScale, "image scale does not match expected value") - #elseif os(OSX) - let expectedSize = CGSize(width: 239.0, height: 178.0) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - #endif - } else { - XCTFail("result image should not be nil") - } - } - - func testThatImageResponseSerializerCanDownloadImageFromFileURL() { - // Given - let URL = URLForResource("apple", withExtension: "jpg") - let expectation = expectationWithDescription("Request should return JPG response image") - - var response: Response? - - // When - manager.request(.GET, URL) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNil(response?.response, "response should be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be success") - - if let image = response?.result.value { - #if os(iOS) - let screenScale = UIScreen.mainScreen().scale - let expectedSize = CGSize(width: CGFloat(180) / screenScale, height: CGFloat(260) / screenScale) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - XCTAssertEqual(image.scale, screenScale, "image scale does not match expected value") - #elseif os(OSX) - let expectedSize = CGSize(width: 180.0, height: 260.0) - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - #endif - } else { - XCTFail("result image should not be nil") - } - } - -#if os(iOS) - - // MARK: - Image Inflation Tests - - func testThatImageResponseSerializerCanDownloadAndInflatePNGImage() { - // Given - let URLString = "https://httpbin.org/image/png" - let expectation = expectationWithDescription("Request should return PNG response image") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be success") - - if let image = response?.result.value { - let screenScale = UIScreen.mainScreen().scale - let expectedSize = CGSize(width: CGFloat(100) / screenScale, height: CGFloat(100) / screenScale) - - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - XCTAssertEqual(image.scale, screenScale, "image scale does not match expected value") - } else { - XCTFail("result image should not be nil") - } - } - - func testThatImageResponseSerializerCanDownloadAndInflateJPGImage() { - // Given - let URLString = "https://httpbin.org/image/jpeg" - let expectation = expectationWithDescription("Request should return JPG response image") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isSuccess ?? false, "result should be success") - - if let image = response?.result.value { - let screenScale = UIScreen.mainScreen().scale - let expectedSize = CGSize(width: CGFloat(239) / screenScale, height: CGFloat(178) / screenScale) - - XCTAssertEqual(image.size, expectedSize, "image size does not match expected value") - XCTAssertEqual(image.scale, screenScale, "image scale does not match expected value") - } else { - XCTFail("result image should not be nil") - } - } - -#endif - - // MARK: - Image Serialization Error Tests - - func testThatAttemptingToDownloadImageFromBadURLReturnsFailureResult() { - // Given - let URLString = "https://invalid.for.sure" - let expectation = expectationWithDescription("Request should fail with bad URL") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNil(response?.response, "response should be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be failure") - XCTAssertNotNil(response?.result.error, "result error should not be nil") - } - - func testThatAttemptingToDownloadUnsupportedImageTypeReturnsFailureResult() { - // Given - let URLString = "https://httpbin.org/image/webp" - let expectation = expectationWithDescription("Request should return webp response image") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be failure") - XCTAssertNotNil(response?.result.error, "result error should not be nil") - - if let error = response?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCannotDecodeContentData, "error code should be -1016") - } - } - - func testThatAttemptingToSerializeEmptyDataReturnsFailureResult() { - // Given - let URLString = "https://httpbin.org/bytes/0" - let expectation = expectationWithDescription("Request should download no bytes") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be failure") - XCTAssertNotNil(response?.result.error, "result error should not be nil") - - if let error = response?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCannotDecodeContentData, "error code should be -1016") - } - } - - func testThatAttemptingToSerializeRandomStreamDataReturnsFailureResult() { - // Given - let randomBytes = 4 * 1024 * 1024 - let URLString = "https://httpbin.org/bytes/\(randomBytes)" - let expectation = expectationWithDescription("Request should download random bytes") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be failure") - XCTAssertNotNil(response?.result.error, "result error should not be nil") - - if let error = response?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCannotDecodeContentData, "error code should be -1016") - } - } - - func testThatAttemptingToSerializeJSONResponseIntoImageReturnsFailureResult() { - // Given - let URLString = "https://httpbin.org/get" - let expectation = expectationWithDescription("Request should return JSON") - - var response: Response? - - // When - manager.request(.GET, URLString) - .responseImage { closureResponse in - response = closureResponse - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(response?.request, "request should not be nil") - XCTAssertNotNil(response?.response, "response should not be nil") - XCTAssertTrue(response?.result.isFailure ?? false, "result should be failure") - XCTAssertNotNil(response?.result.error, "result error should not be nil") - - if let error = response?.result.error { - XCTAssertEqual(error.domain, Error.Domain, "error domain should be com.alamofire.error") - XCTAssertEqual(error.code, NSURLErrorCannotDecodeContentData, "error code should be -1016") - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png deleted file mode 100644 index eb18310..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png deleted file mode 100644 index 846da8f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png deleted file mode 100644 index 188e631..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill Circle/pirate-aspect.scaled.to.fill.size.circle-100x100-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png deleted file mode 100644 index 4b49009..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png deleted file mode 100644 index 1ca7bbd..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png deleted file mode 100644 index 4b95be1..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill with Rounded Corners/pirate-aspect.scaled.to.fill.size.with.rounded.corners-100x100x20-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@1x.png deleted file mode 100644 index 644c008..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@2x.png deleted file mode 100644 index 5cc92c2..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@3x.png deleted file mode 100644 index 24455f5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@1x.png deleted file mode 100644 index ecee557..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@2x.png deleted file mode 100644 index 64e67a6..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@3x.png deleted file mode 100644 index c466894..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@1x.png deleted file mode 100644 index 292fe48..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@2x.png deleted file mode 100644 index 700b49a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@3x.png deleted file mode 100644 index 5139b38..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/apple-aspect.scaled.to.fill-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@1x.png deleted file mode 100644 index 7b878d4..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@2x.png deleted file mode 100644 index 42227ef..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@3x.png deleted file mode 100644 index beceaa2..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@1x.png deleted file mode 100644 index cbcc8f0..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@2x.png deleted file mode 100644 index 473558d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@3x.png deleted file mode 100644 index 9dd8cac..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@1x.png deleted file mode 100644 index 2c5d01f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@2x.png deleted file mode 100644 index 92fb038..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@3x.png deleted file mode 100644 index 25cdff4..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/pirate-aspect.scaled.to.fill-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@1x.png deleted file mode 100644 index 22a3f72..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@2x.png deleted file mode 100644 index 052290d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@3x.png deleted file mode 100644 index d5e1222..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@1x.png deleted file mode 100644 index 8422413..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@2x.png deleted file mode 100644 index 63c2e5d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@3x.png deleted file mode 100644 index 651bd64..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@1x.png deleted file mode 100644 index 4a8161e..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@2x.png deleted file mode 100644 index 3b01170..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@3x.png deleted file mode 100644 index 53e6ed7..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/rainbow-aspect.scaled.to.fill-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@1x.png deleted file mode 100644 index dfd8ecf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@2x.png deleted file mode 100644 index 5d31709..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@3x.png deleted file mode 100644 index 913cbc0..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@1x.png deleted file mode 100644 index 585aa67..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@2x.png deleted file mode 100644 index a270897..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@3x.png deleted file mode 100644 index b927054..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@1x.png deleted file mode 100644 index 9e9d305..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@2x.png deleted file mode 100644 index 73a7a36..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@3x.png deleted file mode 100644 index 118a91a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fill/unicorn-aspect.scaled.to.fill-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@1x.png deleted file mode 100644 index e88d606..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@2x.png deleted file mode 100644 index 4fe04a1..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@3x.png deleted file mode 100644 index fc9f52f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@1x.png deleted file mode 100644 index 841cecf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@2x.png deleted file mode 100644 index 8ca7bdf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@3x.png deleted file mode 100644 index ce2b8f7..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@1x.png deleted file mode 100644 index 273a99b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@2x.png deleted file mode 100644 index 2cc957d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@3x.png deleted file mode 100644 index edc7994..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/apple-aspect.scaled.to.fit-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@1x.png deleted file mode 100644 index 69243f2..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@2x.png deleted file mode 100644 index a9ec631..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@3x.png deleted file mode 100644 index f2e7f28..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@1x.png deleted file mode 100644 index bba089e..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@2x.png deleted file mode 100644 index c409f9a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@3x.png deleted file mode 100644 index 984e9f3..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@1x.png deleted file mode 100644 index 284040b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@2x.png deleted file mode 100644 index dab4130..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@3x.png deleted file mode 100644 index abb66eb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/pirate-aspect.scaled.to.fit-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@1x.png deleted file mode 100644 index 0727ace..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@2x.png deleted file mode 100644 index 2b3c3b6..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@3x.png deleted file mode 100644 index 7176234..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@1x.png deleted file mode 100644 index 4d2344f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@2x.png deleted file mode 100644 index 02e2b16..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@3x.png deleted file mode 100644 index eb0cb68..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@1x.png deleted file mode 100644 index 21eac07..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@2x.png deleted file mode 100644 index 3a829d2..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@3x.png deleted file mode 100644 index 00f8115..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/rainbow-aspect.scaled.to.fit-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@1x.png deleted file mode 100644 index 77f82fe..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@2x.png deleted file mode 100644 index 5db17dd..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@3x.png deleted file mode 100644 index 259bf54..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@1x.png deleted file mode 100644 index 89fc330..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@2x.png deleted file mode 100644 index 92050f0..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@3x.png deleted file mode 100644 index fff4802..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@1x.png deleted file mode 100644 index c064572..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@2x.png deleted file mode 100644 index 1df94be..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@3x.png deleted file mode 100644 index 0b8ce2a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Aspect Scaled to Fit/unicorn-aspect.scaled.to.fit-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/apple-circle.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/apple-circle.png deleted file mode 100644 index 8b82b5c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/apple-circle.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/pirate-circle.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/pirate-circle.png deleted file mode 100644 index e19c028..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/pirate-circle.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/rainbow-circle.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/rainbow-circle.png deleted file mode 100644 index 678f0f8..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/rainbow-circle.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/unicorn-circle.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/unicorn-circle.png deleted file mode 100644 index 8778c81..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Circle/unicorn-circle.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.1.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.1.png deleted file mode 100644 index 5e6a6e5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.1.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.3.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.3.png deleted file mode 100644 index f8cd2d1..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-8.3.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-9.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-9.png deleted file mode 100644 index 1c00db7..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-blurred-8-ios-9.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-sepia.tone.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-sepia.tone.png deleted file mode 100644 index 70101d9..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Core Image Filters/unicorn-sepia.tone.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/apple-radius-20.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/apple-radius-20.png deleted file mode 100644 index ec50baf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/apple-radius-20.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/pirate-radius-20.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/pirate-radius-20.png deleted file mode 100644 index 520a35a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/pirate-radius-20.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/rainbow-radius-20.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/rainbow-radius-20.png deleted file mode 100644 index 34690ab..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/rainbow-radius-20.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/unicorn-radius-20.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/unicorn-radius-20.png deleted file mode 100644 index acfd36a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Radius/unicorn-radius-20.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@1x.png deleted file mode 100644 index 0762211..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@2x.png deleted file mode 100644 index 8e73819..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@3x.png deleted file mode 100644 index 02c4978..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled to Size Circle/pirate-scaled.to.size.circle-100x100-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png deleted file mode 100644 index 921bd66..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png deleted file mode 100644 index 46f6a6b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png deleted file mode 100644 index 6fdfdfc..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled with Rounded Corners/pirate-scaled.to.size.with.rounded.corners-100x100x20-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@1x.png deleted file mode 100644 index 2000cc4..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@2x.png deleted file mode 100644 index b348679..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@3x.png deleted file mode 100644 index c54dc2e..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@1x.png deleted file mode 100644 index 4dc3f46..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@2x.png deleted file mode 100644 index 7ab10c4..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@3x.png deleted file mode 100644 index 29f2ec3..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@1x.png deleted file mode 100644 index 9178db0..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@2x.png deleted file mode 100644 index e8d9920..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@3x.png deleted file mode 100644 index b87c7e1..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/apple-scaled-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@1x.png deleted file mode 100644 index 89d713a..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@2x.png deleted file mode 100644 index 9286f27..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@3x.png deleted file mode 100644 index 252396f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@1x.png deleted file mode 100644 index 449ce45..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@2x.png deleted file mode 100644 index 4f67224..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@3x.png deleted file mode 100644 index aef272d..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@1x.png deleted file mode 100644 index f4078bb..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@2x.png deleted file mode 100644 index f268253..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@3x.png deleted file mode 100644 index ac21395..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/pirate-scaled-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@1x.png deleted file mode 100644 index b8ff731..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@2x.png deleted file mode 100644 index 7d7fa1c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@3x.png deleted file mode 100644 index c0779bf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@1x.png deleted file mode 100644 index 060692c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@2x.png deleted file mode 100644 index cbd7379..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@3x.png deleted file mode 100644 index 6b7982f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@1x.png deleted file mode 100644 index 5134dcf..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@2x.png deleted file mode 100644 index 6a1320b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@3x.png deleted file mode 100644 index 9af2745..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/rainbow-scaled-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@1x.png deleted file mode 100644 index 1926a8b..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@2x.png deleted file mode 100644 index 7415c71..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@3x.png deleted file mode 100644 index 211ad17..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-30x60-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@1x.png deleted file mode 100644 index 0c611ed..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@2x.png deleted file mode 100644 index dfa260f..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@3x.png deleted file mode 100644 index 51d30af..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-50x50-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@1x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@1x.png deleted file mode 100644 index c2d709c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@1x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@2x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@2x.png deleted file mode 100644 index 58234c5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@2x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@3x.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@3x.png deleted file mode 100644 index 5ffc5b3..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Modified Images/Scaled/unicorn-scaled-60x30-@3x.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/apple.jpg b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/apple.jpg deleted file mode 100644 index 55877c5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/apple.jpg and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/huge_map.jpg b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/huge_map.jpg deleted file mode 100644 index 720ee17..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/huge_map.jpg and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/pirate.jpg b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/pirate.jpg deleted file mode 100644 index 6578d7c..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/pirate.jpg and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/rainbow.jpg b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/rainbow.jpg deleted file mode 100644 index 9122468..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/rainbow.jpg and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/unicorn.png b/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/unicorn.png deleted file mode 100644 index bc504e5..0000000 Binary files a/Carthage/Checkouts/AlamofireImage/Tests/Resources/Original Images/unicorn.png and /dev/null differ diff --git a/Carthage/Checkouts/AlamofireImage/Tests/UIButtonTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/UIButtonTests.swift deleted file mode 100644 index 45ab040..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/UIButtonTests.swift +++ /dev/null @@ -1,888 +0,0 @@ -// UIButtonTests.swift -// -// Copyright (c) 2015-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. - -@testable import Alamofire -@testable import AlamofireImage -import UIKit -import XCTest - -private class TestButton: UIButton { - var imageObserver: (Void -> Void)? - - required init(imageObserver: (Void -> Void)? = nil) { - self.imageObserver = imageObserver - super.init(frame: CGRectZero) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func setBackgroundImage(image: UIImage?, forState state: UIControlState) { - super.setBackgroundImage(image, forState: state) - imageObserver?() - } - - override func setImage(image: UIImage?, forState state: UIControlState) { - super.setImage(image, forState: state) - imageObserver?() - } -} - -// MARK: - - -class UIButtonTests: BaseTestCase { - let URL = NSURL(string: "https://httpbin.org/image/jpeg")! - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - ImageDownloader.defaultURLCache().removeAllCachedResponses() - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - UIButton.af_sharedImageDownloader = ImageDownloader.defaultInstance - } - - // MARK: - Image Download - - func testThatImageCanBeDownloadedFromURL() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let button = TestButton { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete) - } - - func testThatBackgroundImageCanBeDownloadedFromURL() { - // Given - let expectation = expectationWithDescription("background image should download successfully") - var backgroundImageDownloadComplete = false - - let button = TestButton { - backgroundImageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(backgroundImageDownloadComplete) - } - - func testThatImageCanBeCancelledAndDownloadedFromURL () { - // Given - let expectation = expectationWithDescription("image should cancel and download successfully") - let button = UIButton() - var result: Result? - - // When - button.af_setImageForState(.Normal, URL: URL) - button.af_cancelImageRequestForState(.Normal) - button.af_setImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil) { response in - result = response.result - expectation.fulfill() - } - - // Then - waitForExpectationsWithTimeout(timeout, handler: nil) - XCTAssertNotNil(result?.value) - } - - func testThatBackgroundImageCanBeCancelledAndDownloadedFromURL () { - // Given - let expectation = expectationWithDescription("background image should cancel and download successfully") - let button = UIButton() - var result: Result? - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL) - button.af_cancelBackgroundImageRequestForState(.Normal) - button.af_setBackgroundImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil) { response in - result = response.result - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(result?.value) - } - - func testThatActiveImageRequestReceiptIsNilAfterImageDownloadCompletes() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let button = TestButton { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete) - XCTAssertNil(button.backgroundImageRequestReceiptForState(.Normal)) - } - - func testThatActiveBackgroundImageRequestReceiptIsNilAfterImageDownloadCompletes() { - // Given - let expectation = expectationWithDescription("background image should download successfully") - var backgroundImageDownloadComplete = false - - let button = TestButton { - backgroundImageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(backgroundImageDownloadComplete) - XCTAssertNil(button.backgroundImageRequestReceiptForState(.Normal)) - } - - func testThatMultipleImageRequestReceiptStatesCanBeDownloadedInParallel() { - // Given - let button = TestButton() - var _URL = URL - - // When - let expectation1 = expectationWithDescription("background image should download successfully") - var normalStateImageDownloadComplete = false - button.af_setImageForState(.Normal, URL: _URL) - button.imageObserver = { - normalStateImageDownloadComplete = true - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation2 = expectationWithDescription("background image should download successfully") - var selectedStateImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setImageForState(.Selected, URL: _URL) - button.imageObserver = { - selectedStateImageDownloadComplete = true - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation3 = expectationWithDescription("background image should download successfully") - var highlightedStateImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setImageForState(.Highlighted, URL: _URL) - button.imageObserver = { - highlightedStateImageDownloadComplete = true - expectation3.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation4 = expectationWithDescription("background image should download successfully") - var disabledStateImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setImageForState(.Disabled, URL: _URL) - button.imageObserver = { - disabledStateImageDownloadComplete = true - expectation4.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(normalStateImageDownloadComplete) - XCTAssertNotNil(button.imageForState(.Normal)) - - XCTAssertTrue(selectedStateImageDownloadComplete) - XCTAssertNotNil(button.imageForState(.Selected)) - - XCTAssertTrue(highlightedStateImageDownloadComplete) - XCTAssertNotNil(button.imageForState(.Highlighted)) - - XCTAssertTrue(disabledStateImageDownloadComplete) - XCTAssertNotNil(button.imageForState(.Disabled)) - } - - func testThatMultipleBackgroundImageRequestReceiptStatesCanBeDownloadedInParallel() { - // Given - let button = TestButton() - var _URL = URL - - // When - let expectation1 = expectationWithDescription("background image should download successfully") - var normalStateBackgroundImageDownloadComplete = false - button.af_setBackgroundImageForState(.Normal, URL: _URL) - button.imageObserver = { - normalStateBackgroundImageDownloadComplete = true - expectation1.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - let expectation2 = expectationWithDescription("background image should download successfully") - var selectedStateBackgroundImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setBackgroundImageForState(.Selected, URL: _URL) - button.imageObserver = { - selectedStateBackgroundImageDownloadComplete = true - expectation2.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation3 = expectationWithDescription("background image should download successfully") - var highlightedStateBackgroundImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setBackgroundImageForState(.Highlighted, URL: _URL) - button.imageObserver = { - highlightedStateBackgroundImageDownloadComplete = true - expectation3.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation4 = expectationWithDescription("background image should download successfully") - var disabledStateBackgroundImageDownloadComplete = false - _URL = NSURL(string: "https://httpbin.org/image/jpeg?random=\(random())")! - - button.af_setBackgroundImageForState(.Disabled, URL: _URL) - button.imageObserver = { - disabledStateBackgroundImageDownloadComplete = true - expectation4.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(normalStateBackgroundImageDownloadComplete) - XCTAssertNotNil(button.backgroundImageForState(.Normal)) - - XCTAssertTrue(selectedStateBackgroundImageDownloadComplete) - XCTAssertNotNil(button.backgroundImageForState(.Selected)) - - XCTAssertTrue(highlightedStateBackgroundImageDownloadComplete) - XCTAssertNotNil(button.backgroundImageForState(.Highlighted)) - - XCTAssertTrue(disabledStateBackgroundImageDownloadComplete) - XCTAssertNotNil(button.backgroundImageForState(.Disabled)) - } - - // MARK: - Image Downloaders - - func testThatImageDownloaderOverridesSharedImageDownloader() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let button = TestButton { - imageDownloadComplete = true - expectation.fulfill() - } - - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - let imageDownloader = ImageDownloader(configuration: configuration) - button.af_imageDownloader = imageDownloader - - // When - button.af_setImageForState(.Normal, URL: URL) - let activeRequestCount = imageDownloader.activeRequestCount - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete) - XCTAssertNil(button.imageRequestReceiptForState(.Normal), "active request receipt should be nil after download completes") - XCTAssertEqual(activeRequestCount, 1, "active request count should be 1") - } - - // MARK: - Image Cache - - func testThatImageCanBeLoadedFromImageCache() { - // Given - let button = UIButton() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, URL.absoluteString) - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - button.af_setImageForState(.Normal, URL: URL) - button.af_cancelImageRequestForState(.Normal) - - // Then - XCTAssertNotNil(button.imageForState(.Normal), "button image should not be nil") - } - - func testThatSharedImageCacheCanBeReplaced() { - // Given - let imageDownloader = ImageDownloader() - - // When - let firstEqualityCheck = UIButton.af_sharedImageDownloader === imageDownloader - UIButton.af_sharedImageDownloader = imageDownloader - let secondEqualityCheck = UIButton.af_sharedImageDownloader === imageDownloader - - // Then - XCTAssertFalse(firstEqualityCheck, "first equality check should be false") - XCTAssertTrue(secondEqualityCheck, "second equality check should be true") - } - - // MARK: - Placeholder Images - - func testThatPlaceholderImageIsDisplayedUntilImageIsDownloadedFromURL() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let expectation = expectationWithDescription("image should download successfully") - - var imageDownloadComplete = false - var finalImageEqualsPlaceholderImage = false - - let button = TestButton () - - // When - button.af_setImageForState(.Normal, URL: URL, placeHolderImage: placeholderImage) - let initialImageEqualsPlaceholderImage = button.imageForState(.Normal) === placeholderImage - - button.imageObserver = { - imageDownloadComplete = true - finalImageEqualsPlaceholderImage = button.imageForState(.Normal) === placeholderImage - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete) - XCTAssertTrue(initialImageEqualsPlaceholderImage, "initial image should equal placeholder image") - XCTAssertFalse(finalImageEqualsPlaceholderImage, "final image should not equal placeholder image") - } - - func testThatBackgroundPlaceholderImageIsDisplayedUntilImageIsDownloadedFromURL() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let expectation = expectationWithDescription("image should download successfully") - - var backgroundImageDownloadComplete = false - var finalBackgroundImageEqualsPlaceholderImage = false - - let button = TestButton () - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL, placeHolderImage: placeholderImage) - let initialImageEqualsPlaceholderImage = button.backgroundImageForState(.Normal) === placeholderImage - - button.imageObserver = { - backgroundImageDownloadComplete = true - finalBackgroundImageEqualsPlaceholderImage = button.backgroundImageForState(.Normal) === placeholderImage - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(backgroundImageDownloadComplete) - XCTAssertTrue(initialImageEqualsPlaceholderImage, "initial image should equal placeholder image") - XCTAssertFalse(finalBackgroundImageEqualsPlaceholderImage, "final image should not equal placeholder image") - } - - func testThatImagePlaceholderIsNeverDisplayedIfCachedImageIsAvailable() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let button = UIButton() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, URL.absoluteString) - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - button.af_setImageForState(.Normal, URL: URL, placeHolderImage: placeholderImage) - - // Then - XCTAssertNotNil(button.imageForState(.Normal), "button image should not be nil") - XCTAssertFalse(button.imageForState(.Normal) === placeholderImage, "button image should not equal placeholder image") - } - - func testThatBackgroundPlaceholderIsNeverDisplayedIfCachedImageIsAvailable() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let button = UIButton() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, URL.absoluteString) - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL, placeHolderImage: placeholderImage) - - // Then - XCTAssertNotNil(button.backgroundImageForState(.Normal), "button background image should not be nil") - XCTAssertFalse(button.backgroundImageForState(.Normal) === placeholderImage, "button background image should not equal placeholder image") - } - - // MARK: - Completion Handler - - func testThatCompletionHandlerIsCalledWhenImageDownloadSucceeds() { - // Given - let button = UIButton() - - let URLRequest: NSURLRequest = { - let request = NSMutableURLRequest(URL: URL) - request.addValue("image/*", forHTTPHeaderField: "Accept") - return request - }() - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setImageForState(.Normal, URLRequest: URLRequest, placeholderImage: nil) { response in - completionHandlerCalled = true - result = response.result - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNotNil(button.imageForState(.Normal), "button image should be not be nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - func testThatCompletionHandlerIsCalledWhenBackgroundImageDownloadSucceeds() { - // Given - let button = UIButton() - - let URLRequest: NSURLRequest = { - let request = NSMutableURLRequest(URL: URL) - request.addValue("image/*", forHTTPHeaderField: "Accept") - return request - }() - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setBackgroundImageForState(.Normal, URLRequest: URLRequest, placeholderImage: nil) { response in - completionHandlerCalled = true - result = response.result - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNotNil(button.backgroundImageForState(.Normal), "button background image should be not be nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - func testThatCompletionHandlerIsCalledWhenImageDownloadFails() { - // Given - let button = UIButton() - let URLRequest = NSURLRequest(URL: NSURL(string: "really-bad-domain")!) - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setImageForState(.Normal, URLRequest: URLRequest, placeholderImage: nil) { response in - completionHandlerCalled = true - result = response.result - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNil(button.imageForState(.Normal), "button image should be nil") - XCTAssertTrue(result?.isFailure ?? false, "result should be a failure case") - } - - func testThatCompletionHandlerIsCalledWhenBackgroundImageDownloadFails() { - // Given - let button = UIButton() - let URLRequest = NSURLRequest(URL: NSURL(string: "really-bad-domain")!) - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setBackgroundImageForState(.Normal, URLRequest: URLRequest, placeholderImage: nil) { response in - completionHandlerCalled = true - result = response.result - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNil(button.backgroundImageForState(.Normal), "button background image should be nil") - XCTAssertTrue(result?.isFailure ?? false, "result should be a failure case") - } - - // MARK: - Cancellation - - func testThatImageDownloadCanBeCancelled() { - // Given - let button = UIButton() - let URLRequest = NSURLRequest(URL: NSURL(string: "domain-name-does-not-exist")!) - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setImageForState( - .Normal, - URLRequest: URLRequest, - placeholderImage: nil, - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - expectation.fulfill() - } - ) - - button.af_cancelImageRequestForState(.Normal) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled) - XCTAssertNil(button.imageForState(.Normal)) - XCTAssertTrue(result?.isFailure ?? false) - } - - func testThatBackgroundImageDownloadCanBeCancelled() { - // Given - let button = UIButton() - let URLRequest = NSURLRequest(URL: NSURL(string: "domain-name-does-not-exist")!) - - let expectation = expectationWithDescription("background image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - button.af_setBackgroundImageForState( - .Normal, - URLRequest: URLRequest, - placeholderImage: nil, - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - expectation.fulfill() - } - ) - - button.af_cancelBackgroundImageRequestForState(.Normal) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled) - XCTAssertNil(button.backgroundImageForState(.Normal)) - XCTAssertTrue(result?.isFailure ?? false) - } - - func testThatActiveImageRequestIsAutomaticallyCancelledBySettingNewURL() { - // Given - let button = UIButton() - let expectation = expectationWithDescription("image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - button.af_setImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion1Called = true - } - ) - - button.af_setImageForState( - .Normal, - URLRequest: NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/png")!), - placeholderImage: nil, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called) - XCTAssertTrue(completion2Called) - XCTAssertNotNil(button.imageForState(.Normal)) - XCTAssertTrue(result?.isSuccess ?? false) - } - - func testThatActiveBackgroundImageRequestIsAutomaticallyCancelledBySettingNewURL() { - // Given - let button = UIButton() - let expectation = expectationWithDescription("background image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - button.af_setBackgroundImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion1Called = true - } - ) - - button.af_setBackgroundImageForState( - .Normal, - URLRequest: NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/png")!), - placeholderImage: nil, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called) - XCTAssertTrue(completion2Called) - XCTAssertNotNil(button.backgroundImageForState(.Normal)) - XCTAssertTrue(result?.isSuccess ?? false) - } - - func testThatActiveImageRequestCanBeCancelledAndRestartedSuccessfully() { - // Given - let button = UIButton() - let expectation = expectationWithDescription("image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - button.af_setImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion1Called = true - } - ) - - button.af_cancelImageRequestForState(.Normal) - - button.af_setImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called) - XCTAssertTrue(completion2Called) - XCTAssertNotNil(button.imageForState(.Normal)) - XCTAssertTrue(result?.isSuccess ?? false) - } - - func testThatActiveBackgroundImageRequestCanBeCancelledAndRestartedSuccessfully() { - // Given - let button = UIButton() - let expectation = expectationWithDescription("background image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - button.af_setBackgroundImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion1Called = true - } - ) - - button.af_cancelBackgroundImageRequestForState(.Normal) - - button.af_setBackgroundImageForState( - .Normal, - URLRequest: NSURLRequest(URL: URL), - placeholderImage: nil, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called) - XCTAssertTrue(completion2Called) - XCTAssertNotNil(button.backgroundImageForState(.Normal)) - XCTAssertTrue(result?.isSuccess ?? false) - } - - // MARK: - Redirects - - func testThatImageBehindRedirectCanBeDownloaded() { - // Given - let redirectURLString = "https://httpbin.org/image/png" - let URL = NSURL(string: "https://httpbin.org/redirect-to?url=\(redirectURLString)")! - - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let button = TestButton { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(button.imageForState(.Normal), "button image should not be nil") - } - - func testThatBackgroundImageBehindRedirectCanBeDownloaded() { - // Given - let redirectURLString = "https://httpbin.org/image/png" - let URL = NSURL(string: "https://httpbin.org/redirect-to?url=\(redirectURLString)")! - - let expectation = expectationWithDescription("image should download successfully") - var backgroundImageDownloadComplete = false - - let button = TestButton { - backgroundImageDownloadComplete = true - expectation.fulfill() - } - - // When - button.af_setBackgroundImageForState(.Normal, URL: URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(backgroundImageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(button.backgroundImageForState(.Normal), "button background image should not be nil") - } - - // MARK: - Accept Header - - func testThatAcceptHeaderMatchesAcceptableContentTypes() { - // Given - let button = UIButton() - - // When - button.af_setImageForState(.Normal, URL: URL) - let acceptField = button.imageRequestReceiptForState(.Normal)?.request.request?.allHTTPHeaderFields?["Accept"] - button.af_cancelImageRequestForState(.Normal) - - // Then - XCTAssertNotNil(acceptField) - - if let acceptField = acceptField { - XCTAssertEqual(acceptField, Request.acceptableImageContentTypes.joinWithSeparator(",")) - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/UIImage+AlamofireImageTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/UIImage+AlamofireImageTests.swift deleted file mode 100644 index 81c97c8..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/UIImage+AlamofireImageTests.swift +++ /dev/null @@ -1,115 +0,0 @@ -// UIImage+AlamofireImageTests.swift -// -// Copyright (c) 2015-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 Foundation -import UIKit - -extension UIImage { - func af_isEqualToImage(image: UIImage, withinTolerance tolerance: UInt8 = 3) -> Bool { - guard CGSizeEqualToSize(size, image.size) else { return false } - - let image1 = af_imageWithPNGRepresentation().af_renderedImage() - let image2 = image.af_imageWithPNGRepresentation().af_renderedImage() - - guard let rendered1 = image1, let rendered2 = image2 else { return false } - - let pixelData1 = CGDataProviderCopyData(CGImageGetDataProvider(rendered1.CGImage)) - let pixelData2 = CGDataProviderCopyData(CGImageGetDataProvider(rendered2.CGImage)) - - guard let validPixelData1 = pixelData1, let validPixelData2 = pixelData2 else { return false } - - let data1: UnsafePointer = CFDataGetBytePtr(validPixelData1) - let data2: UnsafePointer = CFDataGetBytePtr(validPixelData2) - - let length1: Int = CFDataGetLength(validPixelData1) - let length2: Int = CFDataGetLength(validPixelData2) - - guard length1 == length2 else { return false } - - for index in 0.. UIImage? { - // Do not attempt to render animated images - guard images == nil else { return nil } - - // Do not attempt to render if not backed by a CGImage - guard let imageRef = CGImageCreateCopy(CGImage) else { return nil } - - let width = CGImageGetWidth(imageRef) - let height = CGImageGetHeight(imageRef) - let bitsPerComponent = CGImageGetBitsPerComponent(imageRef) - - // Do not attempt to render if too large or has more than 8-bit components - guard width * height <= 4096 * 4096 && bitsPerComponent <= 8 else { return nil } - - let bytesPerRow: Int = 0 - let colorSpace = CGColorSpaceCreateDeviceRGB() - var bitmapInfo = CGImageGetBitmapInfo(imageRef) - - // Fix alpha channel issues if necessary - let alpha = (bitmapInfo.rawValue & CGBitmapInfo.AlphaInfoMask.rawValue) - - if alpha == CGImageAlphaInfo.None.rawValue { - bitmapInfo.remove(.AlphaInfoMask) - bitmapInfo = CGBitmapInfo(rawValue: bitmapInfo.rawValue | CGImageAlphaInfo.NoneSkipFirst.rawValue) - } else if !(alpha == CGImageAlphaInfo.NoneSkipFirst.rawValue) || !(alpha == CGImageAlphaInfo.NoneSkipLast.rawValue) { - bitmapInfo.remove(.AlphaInfoMask) - bitmapInfo = CGBitmapInfo(rawValue: bitmapInfo.rawValue | CGImageAlphaInfo.PremultipliedFirst.rawValue) - } - - // Render the image - let context = CGBitmapContextCreate(nil, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo.rawValue) - CGContextDrawImage(context, CGRectMake(0.0, 0.0, CGFloat(width), CGFloat(height)), imageRef) - - // Make sure the inflation was successful - guard let renderedImageRef = CGBitmapContextCreateImage(context) else { return nil } - - let renderedImage = UIImage(CGImage: renderedImageRef, scale: scale, orientation: imageOrientation) - - return renderedImage - } - - /** - Modifies the underlying UIImage data to use a PNG representation. - - This is important in verifying pixel data between two images. If one has been exported out with PNG - compression and another has not, the image data between the two images will never be equal. This helper - method helps ensure comparisons will be valid. - - - returns: The PNG representation image. - */ - func af_imageWithPNGRepresentation() -> UIImage { - let data = UIImagePNGRepresentation(self)! - let image = UIImage(data: data, scale: UIScreen.mainScreen().scale)! - - return image - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/UIImageTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/UIImageTests.swift deleted file mode 100644 index c66a77f..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/UIImageTests.swift +++ /dev/null @@ -1,392 +0,0 @@ -// UIImageTests.swift -// -// Copyright (c) 2015-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 AlamofireImage -import Foundation -import UIKit -import XCTest - -class UIImageTestCase: BaseTestCase { - - // MARK: - Properties - - var appleImage: UIImage { return imageForResource("apple", withExtension: "jpg") } - var pirateImage: UIImage { return imageForResource("pirate", withExtension: "jpg") } - var rainbowImage: UIImage { return imageForResource("rainbow", withExtension: "jpg") } - var unicornImage: UIImage { return imageForResource("unicorn", withExtension: "png") } - - let scale = Int(round(UIScreen.mainScreen().scale)) - - let squareSize = CGSize(width: 50, height: 50) - let horizontalRectangularSize = CGSize(width: 60, height: 30) - let verticalRectangularSize = CGSize(width: 30, height: 60) - - // MARK: - Initialization Tests - - func testThatHundredsOfLargeImagesCanBeInitializedAcrossMultipleThreads() { - // Given - let URL = URLForResource("huge_map", withExtension: "jpg") - let data = NSData(contentsOfURL: URL)! - - let lock = NSLock() - var images: [UIImage?] = [] - let totalIterations = 1_500 - - // When - for _ in 0.. CGSize { - let dimension = min(image.size.width, image.size.height) - return CGSize(width: dimension, height: dimension) - } - - // MARK: - Core Image Filters - - func testThatImageWithAppliedGaussianBlurFilterReturnsBlurredImage() { - // Given - let parameters: [String: AnyObject] = ["inputRadius": 8] - - // When - let blurredImage = unicornImage.af_imageWithAppliedCoreImageFilter("CIGaussianBlur", filterParameters: parameters) - - // Then - if let blurredImage = blurredImage { - let expectedBlurredImage: UIImage - - if #available(iOS 9.0, *) { - expectedBlurredImage = imageForResource("unicorn-blurred-8-ios-9", withExtension: "png") - } else if #available(iOS 8.3, *) { - expectedBlurredImage = imageForResource("unicorn-blurred-8-ios-8.3", withExtension: "png") - } else { - expectedBlurredImage = imageForResource("unicorn-blurred-8-ios-8.1", withExtension: "png") - } - - let pixelsMatch = blurredImage.af_isEqualToImage(expectedBlurredImage) - - XCTAssertTrue(pixelsMatch, "pixels match should be true") - } else { - XCTFail("blurred image should not be nil") - } - } - - func testThatImageWithAppliedSepiaToneFilterReturnsSepiaImage() { - // Given, When - let sepiaImage = unicornImage.af_imageWithAppliedCoreImageFilter("CISepiaTone") - - // Then - if let sepiaImage = sepiaImage { - let expectedSepiaImage = imageForResource("unicorn-sepia.tone", withExtension: "png") - XCTAssertTrue(sepiaImage.af_isEqualToImage(expectedSepiaImage), "sepia image pixels do not match") - } else { - XCTFail("sepia image should not be nil") - } - } - - func testThatInvalidCoreImageFilterReturnsNil() { - // Given - let filterName = "SomeFilterThatDoesNotExist" - - // When - let filteredImage = unicornImage.af_imageWithAppliedCoreImageFilter(filterName) - - // Then - XCTAssertNil(filteredImage, "filtered image should be nil") - } -} diff --git a/Carthage/Checkouts/AlamofireImage/Tests/UIImageViewTests.swift b/Carthage/Checkouts/AlamofireImage/Tests/UIImageViewTests.swift deleted file mode 100644 index f57cb74..0000000 --- a/Carthage/Checkouts/AlamofireImage/Tests/UIImageViewTests.swift +++ /dev/null @@ -1,708 +0,0 @@ -// UIImageViewTests.swift -// -// Copyright (c) 2015-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. - -@testable import Alamofire -@testable import AlamofireImage -import Foundation -import UIKit -import XCTest - -private class TestImageView: UIImageView { - var imageObserver: (Void -> Void)? - - convenience init(imageObserver: (Void -> Void)? = nil) { - self.init(frame: CGRectZero) - self.imageObserver = imageObserver - } - - override init(frame: CGRect) { - super.init(frame: frame) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override var image: UIImage? { - get { - return super.image - } - set { - super.image = newValue - imageObserver?() - } - } -} - -// MARK: - - -class UIImageViewTestCase: BaseTestCase { - let URL = NSURL(string: "https://httpbin.org/image/jpeg")! - - // MARK: - Setup and Teardown - - override func setUp() { - super.setUp() - - ImageDownloader.defaultURLCache().removeAllCachedResponses() - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - UIImageView.af_sharedImageDownloader = ImageDownloader.defaultInstance - } - - // MARK: - Image Download - - func testThatImageCanBeDownloadedFromURL() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - } - - func testThatImageDownloadSucceedsWhenDuplicateRequestIsSentToImageView() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL) - imageView.af_setImageWithURL(URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - func testThatActiveRequestIsNilAfterImageDownloadCompletes() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNil(imageView.af_activeRequestReceipt, "active request receipt should be nil after download completes") - } - - // MARK: - Image Downloaders - - func testThatImageDownloaderOverridesSharedImageDownloader() { - // Given - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() - let imageDownloader = ImageDownloader(configuration: configuration) - imageView.af_imageDownloader = imageDownloader - - // When - imageView.af_setImageWithURL(URL) - let activeRequestCount = imageDownloader.activeRequestCount - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNil(imageView.af_activeRequestReceipt, "active request receipt should be nil after download completes") - XCTAssertEqual(activeRequestCount, 1, "active request count should be 1") - } - - // MARK: - Image Cache - - func testThatImageCanBeLoadedFromImageCacheFromRequestIdentifierIfAvailable() { - // Given - let imageView = UIImageView() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - imageView.af_setImageWithURL(URL) - imageView.af_cancelImageRequest() - - // Then - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - func testThatImageCanBeLoadedFromImageCacheFromRequestAndFilterIdentifierIfAvailable() { - // Given - let imageView = UIImageView() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download, filter: CircleFilter()) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - imageView.af_setImageWithURL(URL, filter: CircleFilter()) - imageView.af_cancelImageRequest() - - // Then - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - func testThatSharedImageCacheCanBeReplaced() { - // Given - let imageDownloader = ImageDownloader() - - // When - let firstEqualityCheck = UIImageView.af_sharedImageDownloader === imageDownloader - UIImageView.af_sharedImageDownloader = imageDownloader - let secondEqualityCheck = UIImageView.af_sharedImageDownloader === imageDownloader - - // Then - XCTAssertFalse(firstEqualityCheck, "first equality check should be false") - XCTAssertTrue(secondEqualityCheck, "second equality check should be true") - } - - // MARK: - Placeholder Images - - func testThatPlaceholderImageIsDisplayedUntilImageIsDownloadedFromURL() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let expectation = expectationWithDescription("image should download successfully") - - var imageDownloadComplete = false - var finalImageEqualsPlaceholderImage = false - - let imageView = TestImageView() - - // When - imageView.af_setImageWithURL(URL, placeholderImage: placeholderImage) - let initialImageEqualsPlaceholderImage = imageView.image === placeholderImage - - imageView.imageObserver = { - imageDownloadComplete = true - finalImageEqualsPlaceholderImage = imageView.image === placeholderImage - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertTrue(initialImageEqualsPlaceholderImage, "initial image should equal placeholder image") - XCTAssertFalse(finalImageEqualsPlaceholderImage, "final image should not equal placeholder image") - } - - func testThatPlaceholderIsNeverDisplayedIfCachedImageIsAvailable() { - // Given - let placeholderImage = imageForResource("pirate", withExtension: "jpg") - let imageView = UIImageView() - - let downloader = ImageDownloader.defaultInstance - let download = URLRequest(.GET, "https://httpbin.org/image/jpeg") - let expectation = expectationWithDescription("image download should succeed") - - downloader.downloadImage(URLRequest: download) { _ in - expectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // When - imageView.af_setImageWithURL(URL, placeholderImage: placeholderImage) - - // Then - XCTAssertNotNil(imageView.image, "image view image should not be nil") - XCTAssertFalse(imageView.image === placeholderImage, "image view should not equal placeholder image") - } - - // MARK: - Image Filters - - func testThatImageFilterCanBeAppliedToDownloadedImageBeforeBeingDisplayed() { - // Given - let size = CGSize(width: 20, height: 20) - let filter = ScaledToSizeFilter(size: size) - - let expectation = expectationWithDescription("image download should succeed") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL, filter: filter) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil") - - if let image = imageView.image { - XCTAssertEqual(image.size, size, "image size does not match expected value") - } - } - - // MARK: - Image Transitions - - func testThatImageTransitionIsAppliedAfterImageDownloadIsComplete() { - // Given - let expectation = expectationWithDescription("image download should succeed") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL, placeholderImage: nil, filter: nil, imageTransition: .CrossDissolve(0.5)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - func testThatAllImageTransitionsCanBeApplied() { - // Given - let imageView = TestImageView() - var imageTransitionsComplete = false - - // When - let expectation1 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation1.fulfill() } - imageView.af_setImageWithURL(URL, imageTransition: .None) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation2 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation2.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .CrossDissolve(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation3 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation3.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .CurlDown(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation4 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation4.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .CurlUp(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation5 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation5.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .FlipFromBottom(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation6 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation6.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .FlipFromLeft(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation7 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { expectation7.fulfill() } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .FlipFromRight(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation8 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { - expectation8.fulfill() - } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL(URL, imageTransition: .FlipFromTop(0.1)) - waitForExpectationsWithTimeout(timeout, handler: nil) - - let expectation9 = expectationWithDescription("image download should succeed") - imageView.imageObserver = { - imageTransitionsComplete = true - expectation9.fulfill() - } - ImageDownloader.defaultInstance.imageCache?.removeAllImages() - imageView.af_setImageWithURL( - URL, - imageTransition: .Custom( - duration: 0.5, - animationOptions: UIViewAnimationOptions(), - animations: { $0.image = $1 }, - completion: nil - ) - ) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageTransitionsComplete, "image transitions complete should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - // MARK: - Completion Handler - - func testThatCompletionHandlerIsCalledWhenImageDownloadSucceeds() { - // Given - let imageView = UIImageView() - - let URLRequest: NSURLRequest = { - let request = NSMutableURLRequest(URL: URL) - request.addValue("image/*", forHTTPHeaderField: "Accept") - return request - }() - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - imageView.af_setImageWithURLRequest( - URLRequest, - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNotNil(imageView.image, "image view image should be not be nil when completion handler is not nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - func testThatCompletionHandlerIsCalledWhenImageDownloadFails() { - // Given - let imageView = UIImageView() - let URLRequest = NSURLRequest(URL: NSURL(string: "domain-name-does-not-exist")!) - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - imageView.af_setImageWithURLRequest( - URLRequest, - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNil(imageView.image, "image view image should be nil when completion handler is not nil") - XCTAssertTrue(result?.isFailure ?? false, "result should be a failure case") - } - - func testThatCompletionHandlerAndCustomTransitionHandlerAreBothCalled() { - // Given - let imageView = UIImageView() - - let completionExpectation = expectationWithDescription("image download should succeed") - let transitionExpectation = expectationWithDescription("image transition should complete") - - var completionHandlerCalled = false - var transitionCompletionHandlerCalled = false - - var result: Result? - - // When - imageView.af_setImageWithURL( - URL, - placeholderImage: nil, - filter: nil, - imageTransition: .Custom( - duration: 0.1, - animationOptions: UIViewAnimationOptions(), - animations: { $0.image = $1 }, - completion: { _ in - transitionCompletionHandlerCalled = true - transitionExpectation.fulfill() - } - ), - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - - completionExpectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertTrue(transitionCompletionHandlerCalled, "transition completion handler called should be true") - XCTAssertNotNil(imageView.image, "image view image should be not be nil when completion handler is not nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - func testThatImageIsSetWhenReturnedFromCacheAndCompletionHandlerSet() { - // Given - let imageView = UIImageView() - let URLRequest: NSURLRequest = { - let request = NSMutableURLRequest(URL: URL) - request.addValue("image/*", forHTTPHeaderField: "Accept") - return request - }() - - let downloadExpectation = expectationWithDescription("image download should succeed") - - // When - UIImageView.af_sharedImageDownloader.downloadImage(URLRequest: URLRequest) { _ in - downloadExpectation.fulfill() - } - - waitForExpectationsWithTimeout(timeout, handler: nil) - - let cachedExpectation = expectationWithDescription("image should be cached") - var result: Result? - - imageView.af_setImageWithURLRequest( - URLRequest, - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - result = closureResponse.result - cachedExpectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertNotNil(result?.value, "result value should not be nil") - XCTAssertEqual(result?.value, imageView.image, "result value should be equal to image view image") - } - - // MARK: - Cancellation - - func testThatImageDownloadCanBeCancelled() { - // Given - let imageView = UIImageView() - let URLRequest = NSURLRequest(URL: NSURL(string: "domain-name-does-not-exist")!) - - let expectation = expectationWithDescription("image download should succeed") - - var completionHandlerCalled = false - var result: Result? - - // When - imageView.af_setImageWithURLRequest( - URLRequest, - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - completionHandlerCalled = true - result = closureResponse.result - expectation.fulfill() - } - ) - - imageView.af_cancelImageRequest() - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completionHandlerCalled, "completion handler called should be true") - XCTAssertNil(imageView.image, "image view image should be nil when completion handler is not nil") - XCTAssertTrue(result?.isFailure ?? false, "result should be a failure case") - } - - func testThatActiveRequestIsAutomaticallyCancelledBySettingNewURL() { - // Given - let imageView = UIImageView() - let expectation = expectationWithDescription("image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - imageView.af_setImageWithURLRequest( - NSURLRequest(URL: URL), - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { _ in - completion1Called = true - } - ) - - imageView.af_setImageWithURLRequest( - NSURLRequest(URL: NSURL(string: "https://httpbin.org/image/png")!), - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called, "completion 1 called should be true") - XCTAssertTrue(completion2Called, "completion 2 called should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil when completion handler is not nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - func testThatActiveRequestCanBeCancelledAndRestartedSuccessfully() { - // Given - let imageView = UIImageView() - let expectation = expectationWithDescription("image download should succeed") - - var completion1Called = false - var completion2Called = false - var result: Result? - - // When - imageView.af_setImageWithURLRequest( - NSURLRequest(URL: URL), - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { _ in - completion1Called = true - } - ) - - imageView.af_cancelImageRequest() - - imageView.af_setImageWithURLRequest( - NSURLRequest(URL: URL), - placeholderImage: nil, - filter: nil, - imageTransition: .None, - completion: { closureResponse in - completion2Called = true - result = closureResponse.result - expectation.fulfill() - } - ) - - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(completion1Called, "completion 1 called should be true") - XCTAssertTrue(completion2Called, "completion 2 called should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil when completion handler is not nil") - XCTAssertTrue(result?.isSuccess ?? false, "result should be a success case") - } - - // MARK: - Redirects - - func testThatImageBehindRedirectCanBeDownloaded() { - // Given - let redirectURLString = "https://httpbin.org/image/png" - let URL = NSURL(string: "https://httpbin.org/redirect-to?url=\(redirectURLString)")! - - let expectation = expectationWithDescription("image should download successfully") - var imageDownloadComplete = false - - let imageView = TestImageView { - imageDownloadComplete = true - expectation.fulfill() - } - - // When - imageView.af_setImageWithURL(URL) - waitForExpectationsWithTimeout(timeout, handler: nil) - - // Then - XCTAssertTrue(imageDownloadComplete, "image download complete should be true") - XCTAssertNotNil(imageView.image, "image view image should not be nil") - } - - // MARK: - Accept Header - - func testThatAcceptHeaderMatchesAcceptableContentTypes() { - // Given - let imageView = UIImageView() - - // When - imageView.af_setImageWithURL(URL) - let acceptField = imageView.af_activeRequestReceipt?.request.request?.allHTTPHeaderFields?["Accept"] - imageView.af_cancelImageRequest() - - // Then - XCTAssertNotNil(acceptField) - - if let acceptField = acceptField { - XCTAssertEqual(acceptField, Request.acceptableImageContentTypes.joinWithSeparator(",")) - } - } -} diff --git a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.pbxproj b/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.pbxproj deleted file mode 100644 index 1465fe5..0000000 --- a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.pbxproj +++ /dev/null @@ -1,551 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4C3006D31AACEBC20029EA50 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C3006CE1AACEBC20029EA50 /* Images.xcassets */; }; - 4C3006D41AACEBC20029EA50 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3006CF1AACEBC20029EA50 /* AppDelegate.swift */; }; - 4C5AD6C71AACEE7C006EB75F /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C5AD6C51AACEE7C006EB75F /* LaunchScreen.xib */; }; - 4C8290761B925826005E24C8 /* Gravatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8290751B925826005E24C8 /* Gravatar.swift */; settings = {ASSET_TAGS = (); }; }; - 4CE5AA9D1B9BDD6B003530D6 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE5AA901B9BDD48003530D6 /* Alamofire.framework */; }; - 4CE5AA9E1B9BDD6B003530D6 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4CE5AA901B9BDD48003530D6 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4CE5AAA21B9BDD70003530D6 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6CA2511B9BDCAF00AC6AD7 /* AlamofireImage.framework */; }; - 4CE5AAA31B9BDD70003530D6 /* AlamofireImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4C6CA2511B9BDCAF00AC6AD7 /* AlamofireImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4CF743C11AAD756500C2C725 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CF743BE1AAD756500C2C725 /* ImageCell.swift */; }; - 4CF743C21AAD756500C2C725 /* ImagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CF743BF1AAD756500C2C725 /* ImagesViewController.swift */; }; - 4CF743C31AAD756500C2C725 /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CF743C01AAD756500C2C725 /* ImageViewController.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4C6CA2501B9BDCAF00AC6AD7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C9043771AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS"; - }; - 4C6CA2521B9BDCAF00AC6AD7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CE611321AABC24E00D35044; - remoteInfo = "AlamofireImage OSX"; - }; - 4C6CA2541B9BDCAF00AC6AD7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C4D4EC11B92976900C96855; - remoteInfo = "AlamofireImage watchOS"; - }; - 4C6CA2561B9BDCAF00AC6AD7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4C9043821AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS Tests"; - }; - 4C6CA2581B9BDCAF00AC6AD7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CE611471AABC5C900D35044; - remoteInfo = "AlamofireImage OSX Tests"; - }; - 4CE5AA8F1B9BDD48003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 4CE5AA911B9BDD48003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4CE5AA931B9BDD48003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 4CE5AA951B9BDD48003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = "Alamofire iOS Tests"; - }; - 4CE5AA971B9BDD48003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 4CE5AA9F1B9BDD6B003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 4CE5AAA41B9BDD70003530D6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 4C9043761AABBFC5001B4E60; - remoteInfo = "AlamofireImage iOS"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 4CE5AAA11B9BDD6B003530D6 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 4CE5AA9E1B9BDD6B003530D6 /* Alamofire.framework in Embed Frameworks */, - 4CE5AAA31B9BDD70003530D6 /* AlamofireImage.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 4C3006C71AACEBB60029EA50 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = SOURCE_ROOT; }; - 4C3006CE1AACEBC20029EA50 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = SOURCE_ROOT; }; - 4C3006CF1AACEBC20029EA50 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; - 4C5AD6C61AACEE7C006EB75F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Example/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; - 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = AlamofireImage.xcodeproj; sourceTree = ""; }; - 4C8290751B925826005E24C8 /* Gravatar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Gravatar.swift; path = Example/Gravatar.swift; sourceTree = SOURCE_ROOT; }; - 4C8290771B92582E005E24C8 /* iOS-Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "iOS-Example-Bridging-Header.h"; path = "Example/iOS-Example-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; - 4CDA9E5C1AACEB740077861B /* AFImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFImage.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Carthage/Checkouts/Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; - 4CF743BE1AAD756500C2C725 /* ImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageCell.swift; path = Example/ImageCell.swift; sourceTree = SOURCE_ROOT; }; - 4CF743BF1AAD756500C2C725 /* ImagesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImagesViewController.swift; path = Example/ImagesViewController.swift; sourceTree = SOURCE_ROOT; }; - 4CF743C01AAD756500C2C725 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageViewController.swift; path = Example/ImageViewController.swift; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 4CDA9E591AACEB740077861B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CE5AA9D1B9BDD6B003530D6 /* Alamofire.framework in Frameworks */, - 4CE5AAA21B9BDD70003530D6 /* AlamofireImage.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 4C6CA2491B9BDCAF00AC6AD7 /* Products */ = { - isa = PBXGroup; - children = ( - 4C6CA2511B9BDCAF00AC6AD7 /* AlamofireImage.framework */, - 4C6CA2531B9BDCAF00AC6AD7 /* AlamofireImage.framework */, - 4C6CA2551B9BDCAF00AC6AD7 /* AlamofireImage.framework */, - 4C6CA2571B9BDCAF00AC6AD7 /* AlamofireImage iOS Tests.xctest */, - 4C6CA2591B9BDCAF00AC6AD7 /* AlamofireImage OSX Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 4CDA9E531AACEB740077861B = { - isa = PBXGroup; - children = ( - 4CDA9E5E1AACEB740077861B /* Source */, - 4CDA9E5D1AACEB740077861B /* Products */, - 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */, - 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */, - ); - sourceTree = ""; - }; - 4CDA9E5D1AACEB740077861B /* Products */ = { - isa = PBXGroup; - children = ( - 4CDA9E5C1AACEB740077861B /* AFImage.app */, - ); - name = Products; - sourceTree = ""; - }; - 4CDA9E5E1AACEB740077861B /* Source */ = { - isa = PBXGroup; - children = ( - 4C3006CF1AACEBC20029EA50 /* AppDelegate.swift */, - 4C8290751B925826005E24C8 /* Gravatar.swift */, - 4CF743BE1AAD756500C2C725 /* ImageCell.swift */, - 4CF743C01AAD756500C2C725 /* ImageViewController.swift */, - 4CF743BF1AAD756500C2C725 /* ImagesViewController.swift */, - 4CDA9E5F1AACEB740077861B /* Supporting Files */, - ); - name = Source; - path = "iOS Example"; - sourceTree = ""; - }; - 4CDA9E5F1AACEB740077861B /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 4C8290771B92582E005E24C8 /* iOS-Example-Bridging-Header.h */, - 4C5AD6C51AACEE7C006EB75F /* LaunchScreen.xib */, - 4C3006CE1AACEBC20029EA50 /* Images.xcassets */, - 4C3006C71AACEBB60029EA50 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 4CE5AA881B9BDD48003530D6 /* Products */ = { - isa = PBXGroup; - children = ( - 4CE5AA901B9BDD48003530D6 /* Alamofire.framework */, - 4CE5AA921B9BDD48003530D6 /* Alamofire.framework */, - 4CE5AA941B9BDD48003530D6 /* Alamofire.framework */, - 4CE5AA961B9BDD48003530D6 /* Alamofire iOS Tests.xctest */, - 4CE5AA981B9BDD48003530D6 /* Alamofire OSX Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 4CDA9E5B1AACEB740077861B /* iOS Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4CDA9E7B1AACEB740077861B /* Build configuration list for PBXNativeTarget "iOS Example" */; - buildPhases = ( - 4CDA9E581AACEB740077861B /* Sources */, - 4CDA9E591AACEB740077861B /* Frameworks */, - 4CDA9E5A1AACEB740077861B /* Resources */, - 4CE5AAA11B9BDD6B003530D6 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 4CE5AAA01B9BDD6B003530D6 /* PBXTargetDependency */, - 4CE5AAA51B9BDD70003530D6 /* PBXTargetDependency */, - ); - name = "iOS Example"; - productName = "iOS Example"; - productReference = 4CDA9E5C1AACEB740077861B /* AFImage.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 4CDA9E541AACEB740077861B /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = Alamofire; - TargetAttributes = { - 4CDA9E5B1AACEB740077861B = { - CreatedOnToolsVersion = 6.2; - }; - }; - }; - buildConfigurationList = 4CDA9E571AACEB740077861B /* Build configuration list for PBXProject "iOS Example" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 4CDA9E531AACEB740077861B; - productRefGroup = 4CDA9E5D1AACEB740077861B /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 4CE5AA881B9BDD48003530D6 /* Products */; - ProjectRef = 4CE5AA871B9BDD48003530D6 /* Alamofire.xcodeproj */; - }, - { - ProductGroup = 4C6CA2491B9BDCAF00AC6AD7 /* Products */; - ProjectRef = 4C6CA2481B9BDCAF00AC6AD7 /* AlamofireImage.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 4CDA9E5B1AACEB740077861B /* iOS Example */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 4C6CA2511B9BDCAF00AC6AD7 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 4C6CA2501B9BDCAF00AC6AD7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4C6CA2531B9BDCAF00AC6AD7 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 4C6CA2521B9BDCAF00AC6AD7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4C6CA2551B9BDCAF00AC6AD7 /* AlamofireImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = AlamofireImage.framework; - remoteRef = 4C6CA2541B9BDCAF00AC6AD7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4C6CA2571B9BDCAF00AC6AD7 /* AlamofireImage iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "AlamofireImage iOS Tests.xctest"; - remoteRef = 4C6CA2561B9BDCAF00AC6AD7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4C6CA2591B9BDCAF00AC6AD7 /* AlamofireImage OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "AlamofireImage OSX Tests.xctest"; - remoteRef = 4C6CA2581B9BDCAF00AC6AD7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AA901B9BDD48003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AA8F1B9BDD48003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AA921B9BDD48003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AA911B9BDD48003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AA941B9BDD48003530D6 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4CE5AA931B9BDD48003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AA961B9BDD48003530D6 /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = 4CE5AA951B9BDD48003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4CE5AA981B9BDD48003530D6 /* Alamofire OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire OSX Tests.xctest"; - remoteRef = 4CE5AA971B9BDD48003530D6 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 4CDA9E5A1AACEB740077861B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C5AD6C71AACEE7C006EB75F /* LaunchScreen.xib in Resources */, - 4C3006D31AACEBC20029EA50 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 4CDA9E581AACEB740077861B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4CF743C21AAD756500C2C725 /* ImagesViewController.swift in Sources */, - 4C3006D41AACEBC20029EA50 /* AppDelegate.swift in Sources */, - 4C8290761B925826005E24C8 /* Gravatar.swift in Sources */, - 4CF743C31AAD756500C2C725 /* ImageViewController.swift in Sources */, - 4CF743C11AAD756500C2C725 /* ImageCell.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4CE5AAA01B9BDD6B003530D6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Alamofire iOS"; - targetProxy = 4CE5AA9F1B9BDD6B003530D6 /* PBXContainerItemProxy */; - }; - 4CE5AAA51B9BDD70003530D6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "AlamofireImage iOS"; - targetProxy = 4CE5AAA41B9BDD70003530D6 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 4C5AD6C51AACEE7C006EB75F /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 4C5AD6C61AACEE7C006EB75F /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 4CDA9E791AACEB740077861B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OBJC_BRIDGING_HEADER = "Example/iOS-Example-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 4CDA9E7A1AACEB740077861B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OBJC_BRIDGING_HEADER = "Example/iOS-Example-Bridging-Header.h"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 4CDA9E7C1AACEB740077861B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AFImage; - PROVISIONING_PROFILE = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 4CDA9E7D1AACEB740077861B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = AFImage; - PROVISIONING_PROFILE = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4CDA9E571AACEB740077861B /* Build configuration list for PBXProject "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CDA9E791AACEB740077861B /* Debug */, - 4CDA9E7A1AACEB740077861B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4CDA9E7B1AACEB740077861B /* Build configuration list for PBXNativeTarget "iOS Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4CDA9E7C1AACEB740077861B /* Debug */, - 4CDA9E7D1AACEB740077861B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 4CDA9E541AACEB740077861B /* Project object */; -} diff --git a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bfe77a2..0000000 --- a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme deleted file mode 100644 index 2587b92..0000000 --- a/Carthage/Checkouts/AlamofireImage/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index e69de29..ac0183b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,35 @@ +# RIGImageGallery + +[![Version](https://img.shields.io/cocoapods/v/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery) +[![License](https://img.shields.io/cocoapods/l/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery) +[![Platform](https://img.shields.io/cocoapods/p/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) + +RIGImageGallery is an image gallery for iOS written in Swift. + +The goal is to offer sensible defaults that takes care of most of building an image gallery automatically, and offer easy block based customization.. + +## Installation with CocoaPods + +RIGImageGallery is available through [CocoaPods](http://cocoapods.org). To install +it, simply add the following line to your Podfile: + +```ruby +pod 'RIGImageGallery' +``` + +## Installation with Carthage + +RIGImageGallery is also compatible with [Carthage](https://github.com/Carthage/Carthage). To install it, simply add the following line to your Cartfile: + +```ogdl +github "Raizlabs/RIGImageGallery" +``` + +## Author + +Michael Skiba, mike.skiba@raizlabs.com + +## License + +RIGImageGallery is available under the MIT license. See the LICENSE file for more info. diff --git a/RIGImageGallery.podspec b/RIGImageGallery.podspec index 957ba8a..8b1d1a1 100644 --- a/RIGImageGallery.podspec +++ b/RIGImageGallery.podspec @@ -1,24 +1,24 @@ Pod::Spec.new do |s| s.name = "RIGImageGallery" - s.version = "0.0.1" + s.version = "0.1.0" s.summary = "An image gallery view controller designed to work with the Raizlabs Interface Guidelines for iOS." s.description = <<-DESC - An image gallery view controller designed to work with the Raizlabs Interface Guidelines for iOS. + RIGImageGallery is an image gallery for iOS written in Swift. - Includes pinch to zoom, swiping between images, and tap to hide scrollbars. + The goal is to offer sensible defaults that takes care of most of building an image gallery automatically, and offer easy block based customization. DESC s.homepage = "https://github.com/raizlabs/RIGImageGallery" - s.license = 'MIT' + s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { "Michael Skiba" => "mike.skiba@raizlabs.com" } s.source = { :git => "https://github.com/raizlabs/RIGImageGallery.git", :tag => s.version.to_s } + s.social_media_url = 'https://twitter.com/ateliercw' - s.platform = :ios, '9.0' - s.requires_arc = true + s.ios.deployment_target = '9.0' s.source_files = 'RIGImageGallery', 'RIGImageGallery/**/*' - s.frameworks = ["Foundation", "UIKit"] + s.frameworks = 'Foundation', 'UIKit' end diff --git a/RIGImageGallery.xcodeproj/project.pbxproj b/RIGImageGallery.xcodeproj/project.pbxproj index e7fd0f3..03e26b8 100644 --- a/RIGImageGallery.xcodeproj/project.pbxproj +++ b/RIGImageGallery.xcodeproj/project.pbxproj @@ -7,13 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 72060F531D2FFA6C001281E0 /* AutoCenteringScrollViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72060F521D2FFA6C001281E0 /* AutoCenteringScrollViewTests.swift */; }; + 72060F551D2FFA6C001281E0 /* RIGImageGallery.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72BA26521C6B985900F1FE22 /* RIGImageGallery.framework */; }; + 7255D7D11D35246C0060479A /* TestingExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7255D7D01D35246C0060479A /* TestingExtensions.swift */; }; + 7255D7D31D352D6D0060479A /* ImageGalleryViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7255D7D21D352D6D0060479A /* ImageGalleryViewControllerTests.swift */; }; 72A8280C1C68F24500B25CEE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72A8280B1C68F24500B25CEE /* AppDelegate.swift */; }; 72A8280E1C68F24500B25CEE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72A8280D1C68F24500B25CEE /* ViewController.swift */; }; - 72A828111C68F24500B25CEE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 72A8280F1C68F24500B25CEE /* Main.storyboard */; }; 72A828131C68F24500B25CEE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 72A828121C68F24500B25CEE /* Assets.xcassets */; }; 72A828161C68F24500B25CEE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 72A828141C68F24500B25CEE /* LaunchScreen.storyboard */; }; - 72A8282B1C69346100B25CEE /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72A8281D1C68F2BF00B25CEE /* AlamofireImage.framework */; }; - 72A8282C1C69346300B25CEE /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72A8281C1C68F2BF00B25CEE /* Alamofire.framework */; }; 72BA26551C6B985900F1FE22 /* RIGImageGallery.h in Headers */ = {isa = PBXBuildFile; fileRef = 72BA26541C6B985900F1FE22 /* RIGImageGallery.h */; settings = {ATTRIBUTES = (Public, ); }; }; 72BA26591C6B985900F1FE22 /* RIGImageGallery.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 72BA26521C6B985900F1FE22 /* RIGImageGallery.framework */; }; 72BA265A1C6B985900F1FE22 /* RIGImageGallery.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 72BA26521C6B985900F1FE22 /* RIGImageGallery.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -21,9 +22,17 @@ 72BA26631C6B987200F1FE22 /* RIGImageGalleryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BA265F1C6B987200F1FE22 /* RIGImageGalleryViewController.swift */; }; 72BA26641C6B987200F1FE22 /* RIGImageGalleryItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BA26601C6B987200F1FE22 /* RIGImageGalleryItem.swift */; }; 72BA26651C6B987200F1FE22 /* RIGSingleImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BA26611C6B987200F1FE22 /* RIGSingleImageViewController.swift */; }; + 72FE02CC1D356C8500738265 /* SingleImageViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72FE02CB1D356C8500738265 /* SingleImageViewControllerTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 72060F561D2FFA6C001281E0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 72A827F01C68F17900B25CEE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 72BA26511C6B985900F1FE22; + remoteInfo = RIGImageGallery; + }; 72BA26571C6B985900F1FE22 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 72A827F01C68F17900B25CEE /* Project object */; @@ -48,15 +57,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 72060F501D2FFA6C001281E0 /* RIGImageGalleryTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RIGImageGalleryTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 72060F521D2FFA6C001281E0 /* AutoCenteringScrollViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoCenteringScrollViewTests.swift; sourceTree = ""; }; + 72060F541D2FFA6C001281E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7255D7D01D35246C0060479A /* TestingExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestingExtensions.swift; sourceTree = ""; }; + 7255D7D21D352D6D0060479A /* ImageGalleryViewControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGalleryViewControllerTests.swift; sourceTree = ""; }; 72A828091C68F24500B25CEE /* RIGImageGalleryDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RIGImageGalleryDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 72A8280B1C68F24500B25CEE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 72A8280D1C68F24500B25CEE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 72A828101C68F24500B25CEE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 72A828121C68F24500B25CEE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 72A828151C68F24500B25CEE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 72A828171C68F24500B25CEE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 72A8281C1C68F2BF00B25CEE /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; - 72A8281D1C68F2BF00B25CEE /* AlamofireImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AlamofireImage.framework; path = Carthage/Build/iOS/AlamofireImage.framework; sourceTree = ""; }; 72BA26521C6B985900F1FE22 /* RIGImageGallery.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RIGImageGallery.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 72BA26541C6B985900F1FE22 /* RIGImageGallery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RIGImageGallery.h; sourceTree = ""; }; 72BA26561C6B985900F1FE22 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -64,16 +75,23 @@ 72BA265F1C6B987200F1FE22 /* RIGImageGalleryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RIGImageGalleryViewController.swift; sourceTree = ""; }; 72BA26601C6B987200F1FE22 /* RIGImageGalleryItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RIGImageGalleryItem.swift; sourceTree = ""; }; 72BA26611C6B987200F1FE22 /* RIGSingleImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RIGSingleImageViewController.swift; sourceTree = ""; }; + 72FE02CB1D356C8500738265 /* SingleImageViewControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleImageViewControllerTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 72060F4D1D2FFA6C001281E0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 72060F551D2FFA6C001281E0 /* RIGImageGallery.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 72A828061C68F24500B25CEE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 72A8282B1C69346100B25CEE /* AlamofireImage.framework in Frameworks */, 72BA26591C6B985900F1FE22 /* RIGImageGallery.framework in Frameworks */, - 72A8282C1C69346300B25CEE /* Alamofire.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -87,13 +105,33 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 72060F511D2FFA6C001281E0 /* RIGImageGalleryTests */ = { + isa = PBXGroup; + children = ( + 72060F5B1D2FFA9C001281E0 /* Assets */, + 72060F521D2FFA6C001281E0 /* AutoCenteringScrollViewTests.swift */, + 7255D7D21D352D6D0060479A /* ImageGalleryViewControllerTests.swift */, + 72FE02CB1D356C8500738265 /* SingleImageViewControllerTests.swift */, + 7255D7D01D35246C0060479A /* TestingExtensions.swift */, + ); + path = RIGImageGalleryTests; + sourceTree = ""; + }; + 72060F5B1D2FFA9C001281E0 /* Assets */ = { + isa = PBXGroup; + children = ( + 72060F541D2FFA6C001281E0 /* Info.plist */, + ); + path = Assets; + sourceTree = ""; + }; 72A827EF1C68F17900B25CEE = { isa = PBXGroup; children = ( - 72A828041C68F1C100B25CEE /* Frameworks */, 72A827FA1C68F17900B25CEE /* Products */, 72BA26531C6B985900F1FE22 /* RIGImageGallery */, 72A8280A1C68F24500B25CEE /* RIGImageGalleryDemo */, + 72060F511D2FFA6C001281E0 /* RIGImageGalleryTests */, ); sourceTree = ""; }; @@ -102,43 +140,66 @@ children = ( 72A828091C68F24500B25CEE /* RIGImageGalleryDemo.app */, 72BA26521C6B985900F1FE22 /* RIGImageGallery.framework */, + 72060F501D2FFA6C001281E0 /* RIGImageGalleryTests.xctest */, ); name = Products; sourceTree = ""; }; - 72A828041C68F1C100B25CEE /* Frameworks */ = { + 72A8280A1C68F24500B25CEE /* RIGImageGalleryDemo */ = { isa = PBXGroup; children = ( - 72A8281C1C68F2BF00B25CEE /* Alamofire.framework */, - 72A8281D1C68F2BF00B25CEE /* AlamofireImage.framework */, + 72E3A5B91D2FE4D600E9C023 /* App Delegate */, + 72E3A5BB1D2FE4EC00E9C023 /* Assets */, + 72E3A5BA1D2FE4E300E9C023 /* View Controller */, ); - name = Frameworks; + path = RIGImageGalleryDemo; sourceTree = ""; }; - 72A8280A1C68F24500B25CEE /* RIGImageGalleryDemo */ = { + 72BA26531C6B985900F1FE22 /* RIGImageGallery */ = { + isa = PBXGroup; + children = ( + 72E3A5BF1D2FE52100E9C023 /* Assets */, + 72BA265E1C6B987200F1FE22 /* RIGAutoCenteringScrollView.swift */, + 72BA26601C6B987200F1FE22 /* RIGImageGalleryItem.swift */, + 72BA265F1C6B987200F1FE22 /* RIGImageGalleryViewController.swift */, + 72BA26611C6B987200F1FE22 /* RIGSingleImageViewController.swift */, + ); + path = RIGImageGallery; + sourceTree = ""; + }; + 72E3A5B91D2FE4D600E9C023 /* App Delegate */ = { isa = PBXGroup; children = ( 72A8280B1C68F24500B25CEE /* AppDelegate.swift */, + ); + path = "App Delegate"; + sourceTree = ""; + }; + 72E3A5BA1D2FE4E300E9C023 /* View Controller */ = { + isa = PBXGroup; + children = ( 72A8280D1C68F24500B25CEE /* ViewController.swift */, - 72A8280F1C68F24500B25CEE /* Main.storyboard */, + ); + path = "View Controller"; + sourceTree = ""; + }; + 72E3A5BB1D2FE4EC00E9C023 /* Assets */ = { + isa = PBXGroup; + children = ( 72A828121C68F24500B25CEE /* Assets.xcassets */, - 72A828141C68F24500B25CEE /* LaunchScreen.storyboard */, 72A828171C68F24500B25CEE /* Info.plist */, + 72A828141C68F24500B25CEE /* LaunchScreen.storyboard */, ); - path = RIGImageGalleryDemo; + path = Assets; sourceTree = ""; }; - 72BA26531C6B985900F1FE22 /* RIGImageGallery */ = { + 72E3A5BF1D2FE52100E9C023 /* Assets */ = { isa = PBXGroup; children = ( 72BA26561C6B985900F1FE22 /* Info.plist */, - 72BA265E1C6B987200F1FE22 /* RIGAutoCenteringScrollView.swift */, 72BA26541C6B985900F1FE22 /* RIGImageGallery.h */, - 72BA26601C6B987200F1FE22 /* RIGImageGalleryItem.swift */, - 72BA265F1C6B987200F1FE22 /* RIGImageGalleryViewController.swift */, - 72BA26611C6B987200F1FE22 /* RIGSingleImageViewController.swift */, ); - path = RIGImageGallery; + path = Assets; sourceTree = ""; }; /* End PBXGroup section */ @@ -155,6 +216,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 72060F4F1D2FFA6C001281E0 /* RIGImageGalleryTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 72060F581D2FFA6C001281E0 /* Build configuration list for PBXNativeTarget "RIGImageGalleryTests" */; + buildPhases = ( + 72060F4C1D2FFA6C001281E0 /* Sources */, + 72060F4D1D2FFA6C001281E0 /* Frameworks */, + 72060F4E1D2FFA6C001281E0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 72060F571D2FFA6C001281E0 /* PBXTargetDependency */, + ); + name = RIGImageGalleryTests; + productName = RIGImageGalleryTests; + productReference = 72060F501D2FFA6C001281E0 /* RIGImageGalleryTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 72A828081C68F24500B25CEE /* RIGImageGalleryDemo */ = { isa = PBXNativeTarget; buildConfigurationList = 72A828181C68F24500B25CEE /* Build configuration list for PBXNativeTarget "RIGImageGalleryDemo" */; @@ -162,7 +241,6 @@ 72A828051C68F24500B25CEE /* Sources */, 72A828061C68F24500B25CEE /* Frameworks */, 72A828071C68F24500B25CEE /* Resources */, - 72A8281B1C68F28000B25CEE /* Carthage */, 72BA263B1C6B97A500F1FE22 /* Embed Frameworks */, ); buildRules = ( @@ -199,10 +277,13 @@ 72A827F01C68F17900B25CEE /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; + LastSwiftUpdateCheck = 0730; LastUpgradeCheck = 0720; ORGANIZATIONNAME = Raizlabs; TargetAttributes = { + 72060F4F1D2FFA6C001281E0 = { + CreatedOnToolsVersion = 7.3.1; + }; 72A828081C68F24500B25CEE = { CreatedOnToolsVersion = 7.2.1; DevelopmentTeam = 336S848KQ4; @@ -228,18 +309,25 @@ targets = ( 72A828081C68F24500B25CEE /* RIGImageGalleryDemo */, 72BA26511C6B985900F1FE22 /* RIGImageGallery */, + 72060F4F1D2FFA6C001281E0 /* RIGImageGalleryTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 72060F4E1D2FFA6C001281E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 72A828071C68F24500B25CEE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 72A828161C68F24500B25CEE /* LaunchScreen.storyboard in Resources */, 72A828131C68F24500B25CEE /* Assets.xcassets in Resources */, - 72A828111C68F24500B25CEE /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -252,26 +340,18 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 72A8281B1C68F28000B25CEE /* Carthage */ = { - isa = PBXShellScriptBuildPhase; +/* Begin PBXSourcesBuildPhase section */ + 72060F4C1D2FFA6C001281E0 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ); - inputPaths = ( - "$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework", - "$(SRCROOT)/Carthage/Build/iOS/AlamofireImage.framework", - ); - name = Carthage; - outputPaths = ( + 7255D7D31D352D6D0060479A /* ImageGalleryViewControllerTests.swift in Sources */, + 7255D7D11D35246C0060479A /* TestingExtensions.swift in Sources */, + 72FE02CC1D356C8500738265 /* SingleImageViewControllerTests.swift in Sources */, + 72060F531D2FFA6C001281E0 /* AutoCenteringScrollViewTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/local/bin/carthage copy-frameworks"; }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ 72A828051C68F24500B25CEE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -295,6 +375,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 72060F571D2FFA6C001281E0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 72BA26511C6B985900F1FE22 /* RIGImageGallery */; + targetProxy = 72060F561D2FFA6C001281E0 /* PBXContainerItemProxy */; + }; 72BA26581C6B985900F1FE22 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 72BA26511C6B985900F1FE22 /* RIGImageGallery */; @@ -303,25 +388,42 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 72A8280F1C68F24500B25CEE /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 72A828101C68F24500B25CEE /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; 72A828141C68F24500B25CEE /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 72A828151C68F24500B25CEE /* Base */, ); name = LaunchScreen.storyboard; + path = .; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 72060F591D2FFA6C001281E0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + INFOPLIST_FILE = RIGImageGalleryTests/Assets/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RIGImageGalleryTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 72060F5A1D2FFA6C001281E0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + INFOPLIST_FILE = RIGImageGalleryTests/Assets/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RIGImageGalleryTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 72A827FF1C68F17900B25CEE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -418,11 +520,8 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "$(SRCROOT)/RIGImageGalleryDemo/Info.plist"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/RIGImageGalleryDemo/Assets/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RigImageGalleryDemo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -437,11 +536,8 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "$(SRCROOT)/RIGImageGalleryDemo/Info.plist"; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/RIGImageGalleryDemo/Assets/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RigImageGalleryDemo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -459,7 +555,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = RIGImageGallery/Info.plist; + INFOPLIST_FILE = RIGImageGallery/Assets/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RIGImageGallery; @@ -479,7 +575,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = RIGImageGallery/Info.plist; + INFOPLIST_FILE = RIGImageGallery/Assets/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.raizlabs.RIGImageGallery; @@ -491,6 +587,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 72060F581D2FFA6C001281E0 /* Build configuration list for PBXNativeTarget "RIGImageGalleryTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 72060F591D2FFA6C001281E0 /* Debug */, + 72060F5A1D2FFA6C001281E0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 72A827F31C68F17900B25CEE /* Build configuration list for PBXProject "RIGImageGallery" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/RIGImageGallery.xcodeproj/xcshareddata/xcschemes/RIGImageGallery.xcscheme b/RIGImageGallery.xcodeproj/xcshareddata/xcschemes/RIGImageGallery.xcscheme index b1a1f04..01cb3ca 100644 --- a/RIGImageGallery.xcodeproj/xcshareddata/xcschemes/RIGImageGallery.xcscheme +++ b/RIGImageGallery.xcodeproj/xcshareddata/xcschemes/RIGImageGallery.xcscheme @@ -26,9 +26,29 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + + + + + diff --git a/Carthage/Checkouts/AlamofireImage/Source/Info.plist b/RIGImageGallery/Assets/Info.plist similarity index 97% rename from Carthage/Checkouts/AlamofireImage/Source/Info.plist rename to RIGImageGallery/Assets/Info.plist index a5d169c..abe61f5 100644 --- a/Carthage/Checkouts/AlamofireImage/Source/Info.plist +++ b/RIGImageGallery/Assets/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.3.1 + 0.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/RIGImageGallery/RIGImageGallery.h b/RIGImageGallery/Assets/RIGImageGallery.h similarity index 100% rename from RIGImageGallery/RIGImageGallery.h rename to RIGImageGallery/Assets/RIGImageGallery.h diff --git a/RIGImageGallery/Info.plist b/RIGImageGallery/Info.plist deleted file mode 100644 index d3de8ee..0000000 --- a/RIGImageGallery/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/RIGImageGallery/RIGAutoCenteringScrollView.swift b/RIGImageGallery/RIGAutoCenteringScrollView.swift index e8dbfba..f9a4ce2 100644 --- a/RIGImageGallery/RIGAutoCenteringScrollView.swift +++ b/RIGImageGallery/RIGAutoCenteringScrollView.swift @@ -65,12 +65,12 @@ class RIGAutoCenteringScrollView: UIScrollView { extension RIGAutoCenteringScrollView { - func toggleZoom() { + func toggleZoom(animated animated: Bool = true) { if zoomScale != minimumZoomScale { - setZoomScale(minimumZoomScale, animated: true) + setZoomScale(minimumZoomScale, animated: animated) } else { - setZoomScale(maximumZoomScale, animated: true) + setZoomScale(maximumZoomScale, animated: animated) } } diff --git a/RIGImageGallery/RIGImageGalleryItem.swift b/RIGImageGallery/RIGImageGalleryItem.swift index 19b3947..0967f66 100644 --- a/RIGImageGallery/RIGImageGalleryItem.swift +++ b/RIGImageGallery/RIGImageGalleryItem.swift @@ -8,20 +8,26 @@ import UIKit -public class RIGImageGalleryItem: NSObject { +/** + * RIGImageGalleryItem stores an image, placeholder Image, and title to associate with each image + */ +public struct RIGImageGalleryItem: Equatable { - public let image: UIImage? - public let placeholderImage: UIImage? - public let title: String? - - public func updateImage(image:UIImage?) -> RIGImageGalleryItem { - return RIGImageGalleryItem(image: image, placeholderImage: placeholderImage, title: title) - } + /// The image to display + public var image: UIImage? + /// A placeholder image to display if the display image is nil or becomes nil + public var placeholderImage: UIImage? + /// The title of the image + public var title: String? public init(image: UIImage? = nil, placeholderImage: UIImage? = nil, title: String? = nil) { self.image = image self.placeholderImage = placeholderImage self.title = title } - + +} + +public func == (lhs: RIGImageGalleryItem, rhs: RIGImageGalleryItem) -> Bool { + return lhs.image === rhs.image && lhs.placeholderImage === rhs.placeholderImage && lhs.title == rhs.title } diff --git a/RIGImageGallery/RIGImageGalleryViewController.swift b/RIGImageGallery/RIGImageGalleryViewController.swift index d4563f7..eb783e4 100644 --- a/RIGImageGallery/RIGImageGalleryViewController.swift +++ b/RIGImageGallery/RIGImageGalleryViewController.swift @@ -8,64 +8,81 @@ import UIKit -@objc public protocol RIGPhotoViewControllerDelegate { +public class RIGImageGalleryViewController: UIPageViewController { - func dismissPhotoViewer() - optional func showDismissForTraitCollection(traitCollection: UITraitCollection) -> Bool - optional func actionForGalleryItem(galleryItem: RIGImageGalleryItem) - optional func handleGalleryIndexUpdate(newIndex: Int) + /// An optional closure to execute if the action button is tapped + public var actionButtonHandler: ((gallery: RIGImageGalleryViewController, item:RIGImageGalleryItem) -> ())? -} + /// An optional closure to allow cutom trait collection change handling + public var traitCollectionChangeHandler: (RIGImageGalleryViewController -> ())? { + didSet { + traitCollectionChangeHandler?(self) + } + } -public class RIGImageGalleryViewController: UIPageViewController { + /// An optional closure to execute when the active index is updated + public var indexUpdateHandler: (Int -> ())? - private var navigationBarsHidden: Bool = false - private var zoomRecognizer = UITapGestureRecognizer() - private var toggleBarRecognizer = UITapGestureRecognizer() - private var currentImageViewController: RIGSingleImageViewController? + /// An optional closure to handle dismissing the gallery, if this is nil the view will call `dismissViewControllerAnimated(true, completion: nil)`, if this is non-nil, the view controller will not dismiss itself + public var dismissHandler: (RIGImageGalleryViewController -> ())? - public var photoViewDelegate: RIGPhotoViewControllerDelegate? { + /// An optional closure to handle updating the count text + public var countUpdateHandler: ((gallery: RIGImageGalleryViewController, position: Int, total: Int) -> ())? { didSet { - configureActionButton() + updateCountText() } } - public var placeholder: UIImage? = nil + /// The array of images to display. The view controller will automatically handle updates public var images: [RIGImageGalleryItem] = [] { didSet { - for childView in childViewControllers { - if let indexedView = childView as? RIGSingleImageViewController - where indexedView.viewIndex < images.count { - indexedView.viewerItem = images[indexedView.viewIndex] - indexedView.scrollView.baseInsets = scrollViewInset - } - } - updateCountText() + handleImagesUpdate(oldValue: oldValue) } } - public var doneButton: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Done, target: nil, action: nil) { + /// The bar button item to use for the left side of the screen, `didSet` adds the correct target and action to ensure that `dismissHandler` is called when the button is pressed + public var doneButton: UIBarButtonItem? = UIBarButtonItem(barButtonSystemItem: .Done, target: nil, action: nil) { didSet { configureDoneButton() } } - public var actionButton: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Action, target: nil, action: nil) { + /// The bar button item to use for the right side of the screen, `didSet` adds the correct target and action to ensure that `actionButtonHandler` is called + public var actionButton: UIBarButtonItem? { didSet { configureActionButton() } } + /// The index of the image currently bieng displayed public private(set) var currentImage: Int = 0 { didSet { - photoViewDelegate?.handleGalleryIndexUpdate?(currentImage) + indexUpdateHandler?(currentImage) updateCountText() } } + private var navigationBarsHidden = false + private var zoomRecognizer = UITapGestureRecognizer() + private var toggleBarRecognizer = UITapGestureRecognizer() + private var currentImageViewController: RIGSingleImageViewController? { + return viewControllers?.first as? RIGSingleImageViewController + } + private var showDoneButton = true + + /** + Changes the current image bieng displayed + + - parameter currentImage: The index of the image in `images` to display + - parameter animated: A flag that determines if this should be an animated or non-animated transition + */ public func setCurrentImage(currentImage: Int, animated: Bool) { - let newView = rigImageViewWithImage(images[currentImage]) - newView.viewIndex = currentImage + guard currentImage >= 0 && currentImage < images.count else { + self.currentImage = 0 + setViewControllers([UIViewController()], direction: .Forward, animated: animated, completion: nil) + return + } + let newView = RIGSingleImageViewController(viewerItem: images[currentImage]) let direction: UIPageViewControllerNavigationDirection if self.currentImage < currentImage { direction = .Forward @@ -77,6 +94,7 @@ public class RIGImageGalleryViewController: UIPageViewController { setViewControllers([newView], direction: direction, animated: animated, completion: nil) } + /// The label used to display the current position in the array public let countLabel: UILabel = { let counter = UILabel() counter.textColor = .whiteColor() @@ -84,28 +102,53 @@ public class RIGImageGalleryViewController: UIPageViewController { return counter }() - public init() { - super.init(transitionStyle: .Scroll, navigationOrientation: .Horizontal, options: [UIPageViewControllerOptionInterPageSpacingKey: 20]) + /** + A convenience initializer to return a configured empty RIGImageGalleryViewController + + - returns: the RIGImageGalleryViewController + */ + public convenience init() { + self.init(images: []) + } + + /** + A convenience initializer to return a configured RIGImageGalleryViewController with an array of images + + - parameter images: The images to use in the gallery + + - returns: the RIGImageGalleryViewController + */ + public convenience init(images: [RIGImageGalleryItem]) { + self.init(transitionStyle: .Scroll, navigationOrientation: .Horizontal, options: [UIPageViewControllerOptionInterPageSpacingKey: 20]) + self.images = images + } + + + public override init(transitionStyle style: UIPageViewControllerTransitionStyle, navigationOrientation: UIPageViewControllerNavigationOrientation, options: [String : AnyObject]?) { + super.init(transitionStyle: style, navigationOrientation: navigationOrientation, options: options) dataSource = self delegate = self automaticallyAdjustsScrollViewInsets = false + handleImagesUpdate(oldValue: []) + configureDoneButton() + configureActionButton() } - public required init?(coder aDecoder: NSCoder) { + required public init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } public override func viewDidLoad() { + super.viewDidLoad() configureDoneButton() - zoomRecognizer.addTarget(self, action: "toggleZoom:") + zoomRecognizer.addTarget(self, action: #selector(toggleZoom(_:))) zoomRecognizer.numberOfTapsRequired = 2 zoomRecognizer.delegate = self - toggleBarRecognizer.addTarget(self, action: "toggleBarVisiblity:") + toggleBarRecognizer.addTarget(self, action: #selector(toggleBarVisiblity(_:))) toggleBarRecognizer.delegate = self view.addGestureRecognizer(zoomRecognizer) view.addGestureRecognizer(toggleBarRecognizer) view.backgroundColor = UIColor.blackColor() - countLabel.sizeToFit() toolbarItems = [ @@ -119,9 +162,7 @@ public class RIGImageGalleryViewController: UIPageViewController { super.viewWillAppear(animated) updateBarStatus(animated: false) if currentImage < images.count { - let photoPage = rigImageViewWithImage(images[currentImage]) - photoPage.viewIndex = currentImage - currentImageViewController = photoPage + let photoPage = RIGSingleImageViewController(viewerItem: images[currentImage]) setViewControllers([photoPage], direction: .Forward, animated: false, completion: nil) } } @@ -137,7 +178,7 @@ public class RIGImageGalleryViewController: UIPageViewController { public override func traitCollectionDidChange(previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - configureDoneButton() + traitCollectionChangeHandler?(self) } } @@ -173,18 +214,9 @@ extension RIGImageGalleryViewController { currentImageViewController?.scrollView.toggleZoom() } - func updateBarStatus(animated animated: Bool) { - navigationController?.setToolbarHidden(navigationBarsHidden, animated: animated) - navigationController?.setNavigationBarHidden(navigationBarsHidden, animated: animated) - setNeedsStatusBarAppearanceUpdate() - UIView.animateWithDuration(0.15) { - self.currentImageViewController?.scrollView.baseInsets = self.scrollViewInset - } - } - func dismissPhotoView(sender: UIBarButtonItem) { - if let pDelegate = photoViewDelegate { - pDelegate.dismissPhotoViewer() + if dismissHandler != nil { + dismissHandler?(self) } else { dismissViewControllerAnimated(true, completion: nil) @@ -193,7 +225,7 @@ extension RIGImageGalleryViewController { func performAction(sender: UIBarButtonItem) { if let item = currentImageViewController?.viewerItem { - photoViewDelegate?.actionForGalleryItem?(item) + actionButtonHandler?(gallery: self, item: item) } } @@ -203,22 +235,20 @@ extension RIGImageGalleryViewController: UIPageViewControllerDataSource { public func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? { - guard let index = (viewController as? RIGSingleImageViewController)?.viewIndex.successor() + guard let index = indexOf(viewController: viewController)?.successor() where index < images.count else { return nil } - let zoomView = rigImageViewWithImage(images[index]) - zoomView.viewIndex = index + let zoomView = RIGSingleImageViewController(viewerItem: images[index]) return zoomView } public func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? { - guard let index = (viewController as? RIGSingleImageViewController)?.viewIndex.predecessor() + guard let index = indexOf(viewController: viewController)?.predecessor() where index >= 0 else { return nil } - let zoomView = rigImageViewWithImage(images[index]) - zoomView.viewIndex = index + let zoomView = RIGSingleImageViewController(viewerItem: images[index]) return zoomView } @@ -235,8 +265,7 @@ extension RIGImageGalleryViewController: UIPageViewControllerDelegate { } public func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { - currentImageViewController = viewControllers?.first as? RIGSingleImageViewController - if let index = currentImageViewController?.viewIndex { + if let index = viewControllers?.first.flatMap({ indexOf(viewController: $0) }) { currentImage = index } } @@ -246,32 +275,43 @@ extension RIGImageGalleryViewController: UIPageViewControllerDelegate { private extension RIGImageGalleryViewController { - func configureDoneButton() { - doneButton.target = self - doneButton.action = "dismissPhotoView:" - if photoViewDelegate?.showDismissForTraitCollection?(traitCollection) ?? true { - navigationItem.leftBarButtonItem = doneButton - } - else { - navigationItem.leftBarButtonItem = nil + func indexOf(viewController viewController: UIViewController, imagesArray: [RIGImageGalleryItem]? = nil) -> Int? { + guard let item = (viewController as? RIGSingleImageViewController)?.viewerItem else { + return nil } + return (imagesArray ?? images).indexOf(item) + } + + func configureDoneButton() { + doneButton?.target = self + doneButton?.action = #selector(dismissPhotoView(_:)) + navigationItem.leftBarButtonItem = doneButton } func configureActionButton() { - actionButton.target = self - actionButton.action = "performAction:" - if photoViewDelegate?.actionForGalleryItem != nil { - navigationItem.rightBarButtonItem = actionButton - } - else { - navigationItem.rightBarButtonItem = nil + actionButton?.target = self + actionButton?.action = #selector(performAction(_:)) + navigationItem.rightBarButtonItem = actionButton + } + + func updateBarStatus(animated animated: Bool) { + navigationController?.setToolbarHidden(navigationBarsHidden, animated: animated) + navigationController?.setNavigationBarHidden(navigationBarsHidden, animated: animated) + setNeedsStatusBarAppearanceUpdate() + UIView.animateWithDuration(0.15) { + self.currentImageViewController?.scrollView.baseInsets = self.scrollViewInset } } - private func rigImageViewWithImage(image: RIGImageGalleryItem) -> RIGSingleImageViewController { - let imageView = RIGSingleImageViewController() - imageView.viewerItem = image - return imageView + func handleImagesUpdate(oldValue oldValue: [RIGImageGalleryItem]) { + for viewController in childViewControllers { + if let index = indexOf(viewController: viewController, imagesArray: oldValue), + childView = viewController as? RIGSingleImageViewController where index < images.count { + childView.viewerItem = images[index] + childView.scrollView.baseInsets = scrollViewInset + } + } + updateCountText() } private var scrollViewInset: UIEdgeInsets { @@ -280,7 +320,13 @@ private extension RIGImageGalleryViewController { } private func updateCountText() { - countLabel.text = "\(currentImage.successor()) of \(images.count)" + if countUpdateHandler != nil { + countUpdateHandler?(gallery: self, position: currentImage, total: images.count) + } + else { + countLabel.text = nil + } countLabel.sizeToFit() } + } diff --git a/RIGImageGallery/RIGSingleImageViewController.swift b/RIGImageGallery/RIGSingleImageViewController.swift index a77c948..6f3ad43 100644 --- a/RIGImageGallery/RIGSingleImageViewController.swift +++ b/RIGImageGallery/RIGSingleImageViewController.swift @@ -10,23 +10,20 @@ import UIKit class RIGSingleImageViewController: UIViewController { - var viewIndex:Int = 0 - var viewerItem: RIGImageGalleryItem? { didSet { - if viewerItem?.image != nil { - scrollView.allowZoom = true - scrollView.zoomImage = viewerItem?.image - } - else { - scrollView.allowZoom = false - scrollView.zoomImage = viewerItem?.placeholderImage - } + viewerItemUpdated() } } let scrollView = RIGAutoCenteringScrollView() + convenience init(viewerItem: RIGImageGalleryItem) { + self.init() + self.viewerItem = viewerItem + viewerItemUpdated() + } + override func loadView() { automaticallyAdjustsScrollViewInsets = false view = scrollView @@ -44,3 +41,12 @@ class RIGSingleImageViewController: UIViewController { } } + +private extension RIGSingleImageViewController { + + func viewerItemUpdated() { + scrollView.allowZoom = viewerItem?.image != nil + scrollView.zoomImage = viewerItem?.image ?? viewerItem?.placeholderImage + } + +} diff --git a/RIGImageGalleryDemo/App Delegate/AppDelegate.swift b/RIGImageGalleryDemo/App Delegate/AppDelegate.swift new file mode 100644 index 0000000..5ccfc64 --- /dev/null +++ b/RIGImageGalleryDemo/App Delegate/AppDelegate.swift @@ -0,0 +1,40 @@ +// +// AppDelegate.swift +// RigPhotoViewerDemo +// +// Created by Michael Skiba on 2/8/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + window = UIWindow(frame: UIScreen.mainScreen().bounds) + + window?.rootViewController = UINavigationController.init(rootViewController: ViewController()) + window?.makeKeyAndVisible() + return true + } + + func applicationWillResignActive(application: UIApplication) { + } + + func applicationDidEnterBackground(application: UIApplication) { + } + + func applicationWillEnterForeground(application: UIApplication) { + } + + func applicationDidBecomeActive(application: UIApplication) { + } + + func applicationWillTerminate(application: UIApplication) { + } + +} diff --git a/RIGImageGalleryDemo/AppDelegate.swift b/RIGImageGalleryDemo/AppDelegate.swift deleted file mode 100644 index 6cbb6ae..0000000 --- a/RIGImageGalleryDemo/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// RigPhotoViewerDemo -// -// Created by Michael Skiba on 2/8/16. -// Copyright © 2016 Raizlabs. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - 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) { - // 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) { - // 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) { - // 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) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/RIGImageGalleryDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/RIGImageGalleryDemo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index eeea76c..0000000 --- a/RIGImageGalleryDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/AppIcon.appiconset/Contents.json b/RIGImageGalleryDemo/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Carthage/Checkouts/Alamofire/Example/Resources/Images.xcassets/AppIcon.appiconset/Contents.json rename to RIGImageGalleryDemo/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/RIGImageGalleryDemo/Assets.xcassets/Contents.json b/RIGImageGalleryDemo/Assets/Assets.xcassets/Contents.json similarity index 100% rename from RIGImageGalleryDemo/Assets.xcassets/Contents.json rename to RIGImageGalleryDemo/Assets/Assets.xcassets/Contents.json diff --git a/RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/Contents.json b/RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/Contents.json similarity index 100% rename from RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/Contents.json rename to RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/Contents.json diff --git a/RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder.png b/RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder.png similarity index 100% rename from RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder.png rename to RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder.png diff --git a/RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder@2x.png b/RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder@2x.png similarity index 100% rename from RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder@2x.png rename to RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder@2x.png diff --git a/RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder@3x.png b/RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder@3x.png similarity index 100% rename from RIGImageGalleryDemo/Assets.xcassets/placeholder.imageset/placeholder@3x.png rename to RIGImageGalleryDemo/Assets/Assets.xcassets/placeholder.imageset/placeholder@3x.png diff --git a/RIGImageGalleryDemo/Base.lproj/LaunchScreen.storyboard b/RIGImageGalleryDemo/Assets/Base.lproj/LaunchScreen.storyboard similarity index 82% rename from RIGImageGalleryDemo/Base.lproj/LaunchScreen.storyboard rename to RIGImageGalleryDemo/Assets/Base.lproj/LaunchScreen.storyboard index 2e721e1..ebf48f6 100644 --- a/RIGImageGalleryDemo/Base.lproj/LaunchScreen.storyboard +++ b/RIGImageGalleryDemo/Assets/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -15,7 +16,6 @@ - diff --git a/RIGImageGalleryDemo/Info.plist b/RIGImageGalleryDemo/Assets/Info.plist similarity index 96% rename from RIGImageGalleryDemo/Info.plist rename to RIGImageGalleryDemo/Assets/Info.plist index 40c6215..eabb3ae 100644 --- a/RIGImageGalleryDemo/Info.plist +++ b/RIGImageGalleryDemo/Assets/Info.plist @@ -24,8 +24,6 @@ UILaunchStoryboardName LaunchScreen - UIMainStoryboardFile - Main UIRequiredDeviceCapabilities armv7 diff --git a/RIGImageGalleryDemo/Base.lproj/Main.storyboard b/RIGImageGalleryDemo/Base.lproj/Main.storyboard deleted file mode 100644 index 82c10ca..0000000 --- a/RIGImageGalleryDemo/Base.lproj/Main.storyboard +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RIGImageGalleryDemo/View Controller/ViewController.swift b/RIGImageGalleryDemo/View Controller/ViewController.swift new file mode 100644 index 0000000..ff5de35 --- /dev/null +++ b/RIGImageGalleryDemo/View Controller/ViewController.swift @@ -0,0 +1,137 @@ +// +// ViewController.swift +// RigPhotoViewerDemo +// +// Created by Michael Skiba on 2/8/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import UIKit +import RIGImageGallery + +class ViewController: UIViewController { + + private let imageSession = NSURLSession(configuration: .defaultSessionConfiguration()) + + override func loadView() { + view = UIView() + view.backgroundColor = .whiteColor() + navigationItem.title = NSLocalizedString("RIG Image Gallery", comment: "Main screen title") + + let galleryButton = UIButton(type: .System) + galleryButton.translatesAutoresizingMaskIntoConstraints = false + galleryButton.addTarget(self, action: #selector(ViewController.showGallery(_:)), forControlEvents: .TouchUpInside) + galleryButton.setTitle(NSLocalizedString("Show Gallery", comment: "Show gallery button title"), forState: .Normal) + + let stackView = UIStackView(arrangedSubviews: [galleryButton]) + stackView.alignment = .Center + stackView.axis = .Vertical + stackView.layoutMarginsRelativeArrangement = true + stackView.layoutMargins = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10) + stackView.distribution = .Fill + stackView.spacing = 10 + view.addSubview(stackView) + + stackView.translatesAutoresizingMaskIntoConstraints = false + let constraints: [NSLayoutConstraint] = [ + stackView.leadingAnchor.constraintEqualToAnchor(view.leadingAnchor), + stackView.trailingAnchor.constraintEqualToAnchor(view.trailingAnchor), + stackView.bottomAnchor.constraintLessThanOrEqualToAnchor(bottomLayoutGuide.topAnchor), + stackView.topAnchor.constraintEqualToAnchor(topLayoutGuide.bottomAnchor), + ] + + NSLayoutConstraint.activateConstraints(constraints) + } + +} + +private extension ViewController { + + @objc func showGallery(sender: UIButton) { + let photoViewController = loadImages() + photoViewController.dismissHandler = dismissPhotoViewer + photoViewController.actionButtonHandler = actionButtonHandler + photoViewController.actionButton = UIBarButtonItem(barButtonSystemItem: .Action, target: nil, action: nil) + photoViewController.traitCollectionChangeHandler = traitCollectionChangeHandler + photoViewController.countUpdateHandler = updateCount + let navigationController = navBarWrappedViewController(photoViewController) + presentViewController(navigationController, animated: true, completion: nil) + } + +} + +private extension ViewController { + + func dismissPhotoViewer(_ :RIGImageGalleryViewController) { + dismissViewControllerAnimated(true, completion: nil) + } + + func actionButtonHandler(_: RIGImageGalleryViewController,galleryItem: RIGImageGalleryItem) { + } + + func updateCount(gallery: RIGImageGalleryViewController, position: Int, total: Int) { + gallery.countLabel.text = "\(position.successor()) of \(total)" + } + + func traitCollectionChangeHandler(photoView: RIGImageGalleryViewController) { + let isPhone = UITraitCollection(userInterfaceIdiom: .Phone) + let isCompact = UITraitCollection(verticalSizeClass: .Compact) + let allTraits = UITraitCollection(traitsFromCollections: [isPhone, isCompact]) + photoView.doneButton = photoView.traitCollection.containsTraitsInCollection(allTraits) ? nil : UIBarButtonItem(barButtonSystemItem: .Done, target: nil, action: nil) + } + +} + +private extension ViewController { + + static let urls: [NSURL] = [ + NSURL(string: "https://placehold.it/1920x1080"), + NSURL(string: "https://placehold.it/1080x1920"), + NSURL(string: "https://placehold.it/350x150"), + NSURL(string: "https://placehold.it/150x350"), + ].flatMap { $0 } + + func loadImages() -> RIGImageGalleryViewController { + + let urls = self.dynamicType.urls + + let rigItems = urls.map { _ in + RIGImageGalleryItem(placeholderImage: UIImage(named: "placeholder") ?? UIImage()) + } + + let rigController = RIGImageGalleryViewController(images: rigItems) + + for (index, URL) in urls.enumerate() { + let completion = rigController.handleImageLoadAtIndex(index) + let request = imageSession.dataTaskWithRequest(NSURLRequest(URL: URL), completionHandler: completion) + request.resume() + } + + rigController.setCurrentImage(2, animated: false) + return rigController + } + + func navBarWrappedViewController(viewController: UIViewController) -> UINavigationController { + let navigationController = UINavigationController(rootViewController: viewController) + navigationController.navigationBar.barStyle = .BlackTranslucent + navigationController.navigationBar.tintColor = .whiteColor() + navigationController.toolbar.barStyle = .BlackTranslucent + navigationController.toolbar.tintColor = .whiteColor() + return navigationController + } + +} + +private extension RIGImageGalleryViewController { + func handleImageLoadAtIndex(index: Int) -> ((NSData?, NSURLResponse?, NSError?) -> ()) { + return { [weak self] (data: NSData?, response: NSURLResponse?, error: NSError?) in + guard let image = data.flatMap(UIImage.init) where error == nil else { + print(error) + return + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(1.0 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { + self?.images[index].image = image + } + } + } +} diff --git a/RIGImageGalleryDemo/ViewController.swift b/RIGImageGalleryDemo/ViewController.swift deleted file mode 100644 index ae54bf1..0000000 --- a/RIGImageGalleryDemo/ViewController.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// ViewController.swift -// RigPhotoViewerDemo -// -// Created by Michael Skiba on 2/8/16. -// Copyright © 2016 Raizlabs. All rights reserved. -// - -import UIKit -import RIGImageGallery -import Alamofire -import AlamofireImage - -class ViewController: UIViewController { - - var rigController: RIGImageGalleryViewController? - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - let urls: [NSURL] = [ - NSURL(string: "https://placehold.it/1920x1080"), - NSURL(string: "https://placehold.it/1080x1920"), - NSURL(string: "https://placehold.it/350x150"), - NSURL(string: "https://placehold.it/150x350"), - ].flatMap { $0 } - - @IBAction func showGallery(sender: UIButton) { - let photoViewController = RIGImageGalleryViewController() - rigController = photoViewController - photoViewController.photoViewDelegate = self - loadImages() - let navigationController = navBarWrappedViewController(photoViewController) - presentViewController(navigationController, animated: true, completion: nil) - } - - @IBAction func showSingle(sender: UIButton) { - } - - private func navBarWrappedViewController(viewController: UIViewController) -> UINavigationController { - let navigationController = UINavigationController(rootViewController: viewController) - navigationController.navigationBar.barStyle = .BlackTranslucent - navigationController.navigationBar.tintColor = .whiteColor() - navigationController.toolbar.barStyle = .BlackTranslucent - navigationController.toolbar.tintColor = .whiteColor() - return navigationController - } -} - -extension ViewController: RIGPhotoViewControllerDelegate { - - func dismissPhotoViewer() { - dismissViewControllerAnimated(true, completion: nil) - } - - func actionForGalleryItem(galleryItem: RIGImageGalleryItem) { - } - - func showDismissForTraitCollection(traitCollection: UITraitCollection) -> Bool { - return !traitCollection.containsTraitsInCollection(UITraitCollection(verticalSizeClass: .Compact)) - } - - func loadImages() { - let reqs: [URLRequestConvertible] = urls.map { url in - NSURLRequest(URL: url) - } - guard let rig = rigController else { - return - } - let img = UIImage(named: "placeholder") - rig.images = Array.init(count: reqs.count, repeatedValue: RIGImageGalleryItem(placeholderImage: img)) - rig.setCurrentImage(1, animated: false) - let downloader = ImageDownloader.defaultInstance - downloader.downloadImages(URLRequests: reqs, filter: nil) { response in - guard let request = response.request, let image = response.result.value else { - return - } - let index = reqs.indexOf { req in - request == req as? NSURLRequest - } - if let matchIndex = index { - let update = rig.images[matchIndex].updateImage(image) - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(1.0 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { - rig.images[matchIndex] = update - } - } - } - } -} - diff --git a/Carthage/Checkouts/Alamofire/Tests/Info.plist b/RIGImageGalleryTests/Assets/Info.plist similarity index 100% rename from Carthage/Checkouts/Alamofire/Tests/Info.plist rename to RIGImageGalleryTests/Assets/Info.plist diff --git a/RIGImageGalleryTests/AutoCenteringScrollViewTests.swift b/RIGImageGalleryTests/AutoCenteringScrollViewTests.swift new file mode 100644 index 0000000..ac30131 --- /dev/null +++ b/RIGImageGalleryTests/AutoCenteringScrollViewTests.swift @@ -0,0 +1,52 @@ +// +// AutoCenteringScrollViewTests.swift +// RIGImageGalleryTests +// +// Created by Michael Skiba on 7/8/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import XCTest +@testable import RIGImageGallery + +class AutoCenteringScrollViewTests: XCTestCase { + + var scrollView = RIGAutoCenteringScrollView(frame: CGRect()) + + override func setUp() { + super.setUp() + scrollView = RIGAutoCenteringScrollView(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) + } + + override func tearDown() { + super.tearDown() + } + + func testSettingInsets() { + XCTAssertEqual(scrollView.zoomScale, 1, "The scroll view's zoom scale should start at 1") + XCTAssertEqual(scrollView.minimumZoomScale, 1, "The scroll view's min zoom scale should start at 1") + XCTAssertEqual(scrollView.maximumZoomScale, 1, "The scroll view's max zoom scale should start at 1") + let targetInsets = UIEdgeInsets(top: 25, left: 50, bottom: 25, right: 50) + scrollView.baseInsets = targetInsets + XCTAssert(UIEdgeInsetsEqualToEdgeInsets(scrollView.baseInsets, targetInsets), "Base insets should equal the value they're set to") + XCTAssertEqual(scrollView.zoomScale, 1, "With no image, the scrollview's zoom scale should still equal 1") + let image = UIImage.genericImage(.wide) + scrollView.zoomImage = image + // double setting to get code coverage on the short circuit for not doing any work when setting the same image + scrollView.zoomImage = image + XCTAssertEqualWithAccuracy(scrollView.minimumZoomScale, (400.0 - 50.0 - 50.0) / 1920, accuracy: 0.0001, "min zoom scale is should equal the width minus insets divided by image width") + scrollView.zoomImage = UIImage.genericImage(.tall) + XCTAssertEqualWithAccuracy(scrollView.minimumZoomScale, (400.0 - 25.0 - 25.0) / 720.0, accuracy: 0.0001, "Scoll view's min scroll view should equal the height minus insets divied be image height for taller images") + scrollView.baseInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + XCTAssertEqualWithAccuracy(scrollView.minimumZoomScale, 400.0 / 720.0, accuracy: 0.0001, "Scoll view's min scroll view should equal the height minus insets divied be image height for taller images") + scrollView.baseInsets = targetInsets + XCTAssertEqualWithAccuracy(scrollView.minimumZoomScale, (400.0 - 25.0 - 25.0) / 720.0, accuracy: 0.0001, "Scoll view's min scroll view should equal the height minus insets divied be image height for taller images") + scrollView.zoomImage = nil + } + + func testCentering() { + let image = UIImage.genericImage(.wide) + scrollView.zoomImage = image + } + +} diff --git a/RIGImageGalleryTests/ImageGalleryViewControllerTests.swift b/RIGImageGalleryTests/ImageGalleryViewControllerTests.swift new file mode 100644 index 0000000..bbf9bda --- /dev/null +++ b/RIGImageGalleryTests/ImageGalleryViewControllerTests.swift @@ -0,0 +1,101 @@ +// +// ImageGalleryViewControllerTests.swift +// RIGImageGallery +// +// Created by Michael Skiba on 7/12/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import XCTest +@testable import RIGImageGallery + +class ImageGalleryViewControllerTests: XCTestCase { + + var imageGallery = RIGImageGalleryViewController() + + override func setUp() { + super.setUp() + let images = UIImage.allGenerics.map({ RIGImageGalleryItem.init(image: $0) }) + imageGallery = RIGImageGalleryViewController(images: images) + imageGallery.loadView() + imageGallery.viewDidLoad() + imageGallery.view.frame = CGRect(x: 0, y: 0, width: 720, height: 480) + imageGallery.viewWillLayoutSubviews() + imageGallery.viewWillAppear(false) + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testChangingImages() { + imageGallery.images = Array(imageGallery.images.prefix(3)) + imageGallery.setCurrentImage(2, animated: false) + XCTAssertNil(imageGallery.countLabel.text, "Count label should be empty by default") + imageGallery.countUpdateHandler = RIGImageGalleryViewController.updateCount + XCTAssertNotNil(imageGallery.countLabel.text, "Count label should no longer be empty after setting update count") + imageGallery.images = [RIGImageGalleryItem(image: UIImage.genericImage(.wide))] + imageGallery.setCurrentImage(2, animated: false) + XCTAssertEqual(imageGallery.currentImage, 0, "Making making sure the current selected image is 0") + XCTAssertEqual(imageGallery.images.count, 1, "Making sure the gallery only contains 1 view") + imageGallery.images = [] + XCTAssertEqual(imageGallery.images.count, 0, "Making sure the gallery has no views") + imageGallery.setCurrentImage(2, animated: false) + XCTAssertEqual(imageGallery.currentImage, 0, "Making making sure the current selected image is 0") + imageGallery.images = UIImage.allGenerics.map({ RIGImageGalleryItem.init(image: $0) }) + XCTAssertEqual(imageGallery.images.count, 4, "Making sure the gallery has 4 views") + XCTAssertEqual(imageGallery.currentImage, 0, "Making making sure the current selected image is 0") + imageGallery.setCurrentImage(2, animated: false) + XCTAssertEqual(imageGallery.currentImage, 2, "Making sure current selected image updated") + imageGallery.setCurrentImage(0, animated: true) + XCTAssertEqual(imageGallery.currentImage, 0, "Making sure current selected image updated") + imageGallery = RIGImageGalleryViewController() + XCTAssertTrue(imageGallery.images.isEmpty, "Making sure a new image gallery is initalized empty") + } + + func testDelegateAndBarButtons() { + // code coverage of the no delegate dismiss function + imageGallery.dismissPhotoView(UIBarButtonItem()) + imageGallery.actionButton = UIBarButtonItem() + let actionFired = self.expectationWithDescription("action will fire on completion") + imageGallery.actionButtonHandler = { _ in + actionFired.fulfill() + } + imageGallery.performSelector((imageGallery.navigationItem.rightBarButtonItem?.action)!, withObject: imageGallery) + waitForExpectationsWithTimeout(1.0, handler: nil) + imageGallery.doneButton = UIBarButtonItem() + let dismissFired = expectationWithDescription("dismiss handler will fire on completion") + imageGallery.dismissHandler = { _ in + dismissFired.fulfill() + } + imageGallery.performSelector((imageGallery.navigationItem.leftBarButtonItem?.action)!, withObject: imageGallery) + waitForExpectationsWithTimeout(1.0, handler: nil) + } + + func testStatusBarHidden() { + XCTAssertFalse(imageGallery.prefersStatusBarHidden()) + imageGallery.toggleBarVisiblity(UITapGestureRecognizer()) + XCTAssertTrue(imageGallery.prefersStatusBarHidden()) + } + + func testPageViewController() { + XCTAssertNotNil(imageGallery.viewControllers?.first as? RIGSingleImageViewController) + let firstView = imageGallery.viewControllers!.first as! RIGSingleImageViewController + XCTAssertEqual(firstView.viewerItem, imageGallery.images.first, "The first view should have the first image in the gallery") + XCTAssertNil(imageGallery.pageViewController(imageGallery, viewControllerBeforeViewController: firstView), "The view before the first view should be nil") + let secondView = imageGallery.pageViewController(imageGallery, viewControllerAfterViewController: firstView) as! RIGSingleImageViewController + XCTAssertEqual(secondView.viewerItem, imageGallery.images[1], "The second view should have the second image in the gallery") + XCTAssertEqual((imageGallery.pageViewController(imageGallery, viewControllerBeforeViewController: secondView) as! RIGSingleImageViewController).viewerItem, firstView.viewerItem, "the view before the second view should be the first view, which is testable by comparing viewer items") + let thirdView = imageGallery.pageViewController(imageGallery, viewControllerAfterViewController: secondView)! + let fourthView = imageGallery.pageViewController(imageGallery, viewControllerAfterViewController: thirdView)! + XCTAssertNil(imageGallery.pageViewController(imageGallery, viewControllerAfterViewController: fourthView), "The view after the end of the list should be nil") + } + +} + +private extension RIGImageGalleryViewController { + static func updateCount(gallery: RIGImageGalleryViewController, position: Int, total: Int) { + gallery.countLabel.text = "\(position.successor()) of \(total)" + } +} diff --git a/RIGImageGalleryTests/SingleImageViewControllerTests.swift b/RIGImageGalleryTests/SingleImageViewControllerTests.swift new file mode 100644 index 0000000..4dc4232 --- /dev/null +++ b/RIGImageGalleryTests/SingleImageViewControllerTests.swift @@ -0,0 +1,41 @@ +// +// SingleImageViewControllerTests.swift +// RIGImageGallery +// +// Created by Michael Skiba on 7/12/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import XCTest +@testable import RIGImageGallery + +class SingleImageViewControllerTests: XCTestCase { + + override func setUp() { + super.setUp() + } + + override func tearDown() { + super.tearDown() + } + + func testSettingImages() { + let emptyItem = RIGImageGalleryItem(placeholderImage: UIImage.genericImage(.tall)) + let fullItem = RIGImageGalleryItem(image: UIImage.genericImage(.tall)) + + XCTAssertTrue(RIGSingleImageViewController(viewerItem: fullItem).scrollView.allowZoom, "zoom should be enabled if loaded with an image") + XCTAssertFalse(RIGSingleImageViewController(viewerItem: emptyItem).scrollView.allowZoom, "zoom should be disabled if loaded with a placeholder") + + let viewController = RIGSingleImageViewController() + XCTAssertFalse(viewController.scrollView.allowZoom, "Zoom should be disabled on inital load with no content") + viewController.viewerItem = fullItem + XCTAssertTrue(viewController.scrollView.allowZoom, "Zoom should be enabled if a item with an image is set") + viewController.viewerItem = emptyItem + XCTAssertFalse(viewController.scrollView.allowZoom, "Zoom should be disabled if an image with only a placeholder is set") + viewController.viewerItem = fullItem + XCTAssertTrue(viewController.scrollView.allowZoom, "making sure zoom is re-enabled") + viewController.viewerItem = nil + XCTAssertFalse(viewController.scrollView.allowZoom, "Zoom should be disabled if the viewer item is nil'd out") + } + +} diff --git a/RIGImageGalleryTests/TestingExtensions.swift b/RIGImageGalleryTests/TestingExtensions.swift new file mode 100644 index 0000000..d4845ea --- /dev/null +++ b/RIGImageGalleryTests/TestingExtensions.swift @@ -0,0 +1,34 @@ +// +// TestingExtensions.swift +// RIGImageGallery +// +// Created by Michael Skiba on 7/12/16. +// Copyright © 2016 Raizlabs. All rights reserved. +// + +import UIKit + +extension CGSize { + static let wide = CGSize(width: 1920, height: 1080) + static let tall = CGSize(width: 480, height: 720) + static let smallWide = CGSize(width: 480, height: 270) + static let smallTall = CGSize(width: 207, height: 368) +} + +extension UIImage { + + static var allGenerics: [UIImage] { + return [UIImage.genericImage(.wide), UIImage.genericImage(.tall), UIImage.genericImage(.smallWide), UIImage.genericImage(.smallTall)] + } + + static func genericImage(size: CGSize) -> UIImage { + UIGraphicsBeginImageContextWithOptions(size, true, 0) + let fillPath = UIBezierPath(rect: CGRect(origin: CGPoint(), size: size)) + fillPath.fill() + let genericImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + + return genericImage + } + +}