diff --git a/.gitignore b/.gitignore index a3cd143..7b26fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ DerivedData # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # -# Pods/ +Pods/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a8f67ba..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "SwiftyJSON"] - path = SwiftyJSON - url = https://github.com/SwiftyJSON/SwiftyJSON.git -[submodule "Alamofire"] - path = Alamofire - url = https://github.com/Alamofire/Alamofire.git diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 9f55b2c..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.0 diff --git a/.travis.yml b/.travis.yml index de64906..3448ecf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ -language: objective-c -osx_image: xcode9 -xcode_sdk: iphonesimulator10.0 +language: swift +osx_image: xcode11 +xcode_sdk: iphonesimulator13.0 env: - - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone SE,OS=10.0" + - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone SE,OS=13.0" script: - set -o pipefail && xcodebuild -project Alamofire-SwiftyJSON.xcodeproj -scheme $SCHEME -destination "$DESTINATION" build-for-testing test | xcpretty diff --git a/Alamofire b/Alamofire deleted file mode 160000 index 7fe7b91..0000000 --- a/Alamofire +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7fe7b918b746fbb4b7a7c2146bef7a88c7ddc54e diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 5447dc7..200fb1b 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -1,16 +1,17 @@ Pod::Spec.new do |s| s.name = "Alamofire-SwiftyJSON" - s.version = "3.0.0" - s.summary = "Alamofire extension for serialize NSData to SwiftyJSON " + s.version = "4.0.0" + s.summary = "Alamofire extension for serialize Data to SwiftyJSON" s.homepage = "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON" s.license = { :type => "MIT" } s.authors = { "tangplin" => "tangplin@gmail.com" } - + + s.swift_version = '5.1' s.requires_arc = true s.osx.deployment_target = "10.11" s.ios.deployment_target = "9.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 4.5' - s.dependency 'SwiftyJSON', '~> 4.0.0' + s.dependency 'Alamofire', '~> 5.0.0-rc.2' + s.dependency 'SwiftyJSON', '~> 5.0.0' end diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj index e703136..2419a06 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj +++ b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj @@ -7,101 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - A8A2DBBA1A23292000AF9EFC /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB75A19D14A5C0070765E /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBBB1A23292000AF9EFC /* SwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB76519D14A670070765E /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBC31A2329E700AF9EFC /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB75A19D14A5C0070765E /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBC41A2329E700AF9EFC /* SwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB76519D14A670070765E /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 195172592344A8B4002D4C23 /* Alamofire-SwiftyJSON.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 195172582344A8B4002D4C23 /* Alamofire-SwiftyJSON.podspec */; }; + 1951725C2344A93F002D4C23 /* .travis.yml in Resources */ = {isa = PBXBuildFile; fileRef = 1951725A2344A93E002D4C23 /* .travis.yml */; }; + 1951725D2344A93F002D4C23 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 1951725B2344A93F002D4C23 /* README.md */; }; + 4FCF8BE87520DCAB10B5042B /* Pods_AlamofireSwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7BEF49FE829BEA6F20DE444 /* Pods_AlamofireSwiftyJSON.framework */; }; A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */; }; A8AFB72919D140BD0070765E /* Alamofire-SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */; }; + D576C264D315DE455420AB4D /* Pods_AlamofireSwiftyJSONTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 032B55364607D4459C7B13CF /* Pods_AlamofireSwiftyJSONTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 4BC5E9F91BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4BC5E9FB1BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC5B1A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX"; - }; - 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC651A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX Tests"; - }; - 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4D7CCE81B9465A700EE7221; - remoteInfo = "SwiftyJSON watchOS"; - }; - A81D16431E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - A81D16451E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - A81D164D1E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 7236B4F61BAC14150020529B; - remoteInfo = "SwiftyJSON tvOS"; - }; - A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = A8580F741BCF5C5B00DA927B; - remoteInfo = "SwiftyJSON tvOS Tests"; - }; - A8A2DBB61A23290100AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8A2DBB81A23290100AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2E4FEFDA19575BE100351305; - remoteInfo = SwiftyJSON; - }; A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A8AFB70619D1401D0070765E /* Project object */; @@ -109,48 +26,6 @@ remoteGlobalIDString = A8AFB70E19D1401D0070765E; remoteInfo = AlamofireSwiftyJSON; }; - A8A2DBBE1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8A2DBC01A2329BD00AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2E4FEFDA19575BE100351305; - remoteInfo = SwiftyJSON; - }; - A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = AlamofireTests; - }; - A8AFB76419D14A670070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFDB19575BE100351305; - remoteInfo = SwiftyJSON; - }; - A8AFB76619D14A670070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFE619575BE100351305; - remoteInfo = SwiftyJSONTests; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -160,8 +35,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - A8A2DBBA1A23292000AF9EFC /* Alamofire.framework in Copy Frameworks */, - A8A2DBBB1A23292000AF9EFC /* SwiftyJSON.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 1; @@ -172,8 +45,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - A8A2DBC31A2329E700AF9EFC /* Alamofire.framework in Copy Frameworks */, - A8A2DBC41A2329E700AF9EFC /* SwiftyJSON.framework in Copy Frameworks */, A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */, ); name = "Copy Frameworks"; @@ -182,6 +53,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 032B55364607D4459C7B13CF /* Pods_AlamofireSwiftyJSONTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AlamofireSwiftyJSONTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 195172582344A8B4002D4C23 /* Alamofire-SwiftyJSON.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Alamofire-SwiftyJSON.podspec"; sourceTree = ""; }; + 1951725A2344A93E002D4C23 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; }; + 1951725B2344A93F002D4C23 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 24D9421C868DAF774A3847BF /* Pods-AlamofireSwiftyJSONTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AlamofireSwiftyJSONTests.debug.xcconfig"; path = "Target Support Files/Pods-AlamofireSwiftyJSONTests/Pods-AlamofireSwiftyJSONTests.debug.xcconfig"; sourceTree = ""; }; + 2C3409D07689C0A7F179C2FC /* Pods-AlamofireSwiftyJSONTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AlamofireSwiftyJSONTests.release.xcconfig"; path = "Target Support Files/Pods-AlamofireSwiftyJSONTests/Pods-AlamofireSwiftyJSONTests.release.xcconfig"; sourceTree = ""; }; + 6973684C3819B7DFD7672ECA /* Pods-AlamofireSwiftyJSON.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AlamofireSwiftyJSON.debug.xcconfig"; path = "Target Support Files/Pods-AlamofireSwiftyJSON/Pods-AlamofireSwiftyJSON.debug.xcconfig"; sourceTree = ""; }; A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A8AFB71319D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Alamofire-SwiftyJSON.h"; sourceTree = ""; }; @@ -189,8 +67,8 @@ A8AFB71D19D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alamofire_SwiftyJSONTests.swift; sourceTree = ""; }; A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Alamofire-SwiftyJSON.swift"; sourceTree = ""; }; - A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; - A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = ""; }; + DFA9976BE9D3F87B5E122FEE /* Pods-AlamofireSwiftyJSON.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AlamofireSwiftyJSON.release.xcconfig"; path = "Target Support Files/Pods-AlamofireSwiftyJSON/Pods-AlamofireSwiftyJSON.release.xcconfig"; sourceTree = ""; }; + F7BEF49FE829BEA6F20DE444 /* Pods_AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -198,6 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4FCF8BE87520DCAB10B5042B /* Pods_AlamofireSwiftyJSON.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -205,20 +84,33 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D576C264D315DE455420AB4D /* Pods_AlamofireSwiftyJSONTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 4B58017264CE5123D1D128D3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F7BEF49FE829BEA6F20DE444 /* Pods_AlamofireSwiftyJSON.framework */, + 032B55364607D4459C7B13CF /* Pods_AlamofireSwiftyJSONTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; A8AFB70519D1401D0070765E = { isa = PBXGroup; children = ( - A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */, - A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */, + 1951725A2344A93E002D4C23 /* .travis.yml */, + 1951725B2344A93F002D4C23 /* README.md */, + 195172582344A8B4002D4C23 /* Alamofire-SwiftyJSON.podspec */, A8AFB71119D1401D0070765E /* Source */, A8AFB71B19D1401D0070765E /* Tests */, A8AFB71019D1401D0070765E /* Products */, + B7F0C282E6E98C795C0DF459 /* Pods */, + 4B58017264CE5123D1D128D3 /* Frameworks */, ); sourceTree = ""; }; @@ -266,32 +158,15 @@ name = "Supporting Files"; sourceTree = ""; }; - A8AFB75519D14A5C0070765E /* Products */ = { - isa = PBXGroup; - children = ( - A8AFB75A19D14A5C0070765E /* Alamofire.framework */, - A8AFB75C19D14A5C0070765E /* Alamofire iOS Tests.xctest */, - 4BC5E9FA1BB7E15600A393DD /* Alamofire.framework */, - 4BC5E9FE1BB7E15600A393DD /* Alamofire macOS Tests.xctest */, - A81D16441E59E90500C62C5F /* Alamofire.framework */, - A81D16461E59E90500C62C5F /* Alamofire tvOS Tests.xctest */, - 4BC5E9FC1BB7E15600A393DD /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; - A8AFB75E19D14A670070765E /* Products */ = { + B7F0C282E6E98C795C0DF459 /* Pods */ = { isa = PBXGroup; children = ( - A8AFB76519D14A670070765E /* SwiftyJSON.framework */, - A8AFB76719D14A670070765E /* SwiftyJSON iOS Tests.xctest */, - 4BC5EA041BB7E15600A393DD /* SwiftyJSON.framework */, - 4BC5EA061BB7E15600A393DD /* SwiftyJSON OSX Tests.xctest */, - 4BC5EA081BB7E15600A393DD /* SwiftyJSON.framework */, - A81D164E1E59E90500C62C5F /* SwiftyJSON.framework */, - A81D16501E59E90500C62C5F /* SwiftyJSON tvOS Tests.xctest */, + 6973684C3819B7DFD7672ECA /* Pods-AlamofireSwiftyJSON.debug.xcconfig */, + DFA9976BE9D3F87B5E122FEE /* Pods-AlamofireSwiftyJSON.release.xcconfig */, + 24D9421C868DAF774A3847BF /* Pods-AlamofireSwiftyJSONTests.debug.xcconfig */, + 2C3409D07689C0A7F179C2FC /* Pods-AlamofireSwiftyJSONTests.release.xcconfig */, ); - name = Products; + path = Pods; sourceTree = ""; }; /* End PBXGroup section */ @@ -312,6 +187,7 @@ isa = PBXNativeTarget; buildConfigurationList = A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */; buildPhases = ( + 094D3859F06572A4B8BE7171 /* [CP] Check Pods Manifest.lock */, A8AFB70A19D1401D0070765E /* Sources */, A8AFB70B19D1401D0070765E /* Frameworks */, A8AFB70C19D1401D0070765E /* Headers */, @@ -321,8 +197,6 @@ buildRules = ( ); dependencies = ( - A8A2DBB71A23290100AF9EFC /* PBXTargetDependency */, - A8A2DBB91A23290100AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSON; productName = "Alamofire-SwiftyJSON"; @@ -333,6 +207,7 @@ isa = PBXNativeTarget; buildConfigurationList = A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */; buildPhases = ( + 6AE49616430C8EE0E9E357CE /* [CP] Check Pods Manifest.lock */, A8AFB71619D1401D0070765E /* Sources */, A8AFB71719D1401D0070765E /* Frameworks */, A8AFB71819D1401D0070765E /* Resources */, @@ -342,8 +217,6 @@ ); dependencies = ( A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBBF1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBC11A2329BD00AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSONTests; productName = "Alamofire-SwiftyJSONTests"; @@ -357,7 +230,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = SwiftJSON; TargetAttributes = { A8AFB70E19D1401D0070765E = { @@ -367,29 +240,21 @@ A8AFB71919D1401D0070765E = { CreatedOnToolsVersion = 6.0.1; LastSwiftMigration = 0820; + ProvisioningStyle = Manual; }; }; }; buildConfigurationList = A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "Alamofire-SwiftyJSON" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = A8AFB70519D1401D0070765E; productRefGroup = A8AFB71019D1401D0070765E /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = A8AFB75519D14A5C0070765E /* Products */; - ProjectRef = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - }, - { - ProductGroup = A8AFB75E19D14A670070765E /* Products */; - ProjectRef = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - }, - ); projectRoot = ""; targets = ( A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */, @@ -398,112 +263,14 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 4BC5E9FA1BB7E15600A393DD /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4BC5E9F91BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5E9FC1BB7E15600A393DD /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4BC5E9FB1BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5E9FE1BB7E15600A393DD /* Alamofire macOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire macOS Tests.xctest"; - remoteRef = 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA041BB7E15600A393DD /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA061BB7E15600A393DD /* SwiftyJSON OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON OSX Tests.xctest"; - remoteRef = 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA081BB7E15600A393DD /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16441E59E90500C62C5F /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = A81D16431E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16461E59E90500C62C5F /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = A81D16451E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D164E1E59E90500C62C5F /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A81D164D1E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16501E59E90500C62C5F /* SwiftyJSON tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON tvOS Tests.xctest"; - remoteRef = A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB75A19D14A5C0070765E /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB75C19D14A5C0070765E /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB76519D14A670070765E /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A8AFB76419D14A670070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB76719D14A670070765E /* SwiftyJSON iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON iOS Tests.xctest"; - remoteRef = A8AFB76619D14A670070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ A8AFB70D19D1401D0070765E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1951725D2344A93F002D4C23 /* README.md in Resources */, + 1951725C2344A93F002D4C23 /* .travis.yml in Resources */, + 195172592344A8B4002D4C23 /* Alamofire-SwiftyJSON.podspec in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -516,6 +283,53 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 094D3859F06572A4B8BE7171 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-AlamofireSwiftyJSON-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 6AE49616430C8EE0E9E357CE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-AlamofireSwiftyJSONTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ A8AFB70A19D1401D0070765E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -536,31 +350,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - A8A2DBB71A23290100AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - targetProxy = A8A2DBB61A23290100AF9EFC /* PBXContainerItemProxy */; - }; - A8A2DBB91A23290100AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftyJSON; - targetProxy = A8A2DBB81A23290100AF9EFC /* PBXContainerItemProxy */; - }; A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */; targetProxy = A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */; }; - A8A2DBBF1A2329BD00AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - targetProxy = A8A2DBBE1A2329BD00AF9EFC /* PBXContainerItemProxy */; - }; - A8A2DBC11A2329BD00AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftyJSON; - targetProxy = A8A2DBC01A2329BD00AF9EFC /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -568,6 +362,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -576,12 +371,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -624,6 +421,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -632,12 +430,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -671,6 +471,7 @@ }; A8AFB72319D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6973684C3819B7DFD7672ECA /* Pods-AlamofireSwiftyJSON.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -680,15 +481,17 @@ INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; A8AFB72419D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = DFA9976BE9D3F87B5E122FEE /* Pods-AlamofireSwiftyJSON.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -698,16 +501,20 @@ INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; A8AFB72619D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 24D9421C868DAF774A3847BF /* Pods-AlamofireSwiftyJSONTests.debug.xcconfig */; buildSettings = { + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -716,18 +523,25 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; + SWIFT_VERSION = 5.0; }; name = Debug; }; A8AFB72719D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 2C3409D07689C0A7F179C2FC /* Pods-AlamofireSwiftyJSONTests.release.xcconfig */; buildSettings = { + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme b/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme index 45076c5..1edaab7 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme +++ b/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -54,23 +62,11 @@ - - - - - - - - + + + + + + diff --git a/Alamofire-SwiftyJSON.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Alamofire-SwiftyJSON.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Alamofire-SwiftyJSON.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..db1d741 --- /dev/null +++ b/Podfile @@ -0,0 +1,16 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'AlamofireSwiftyJSON' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + pod 'Alamofire' + pod 'SwiftyJSON' + + target 'AlamofireSwiftyJSONTests' do + inherit! :search_paths + # Pods for testing + end + +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..8f11325 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - Alamofire (4.9.0) + - SwiftyJSON (5.0.0) + +DEPENDENCIES: + - Alamofire + - SwiftyJSON + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - SwiftyJSON + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 + +PODFILE CHECKSUM: a1602366b4aa23d5adf317c2a7ddeb7bd52d20bc + +COCOAPODS: 1.7.5 diff --git a/README.md b/README.md index 4a17848..d9c24af 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,16 @@ An extension to make serializing [Alamofire](https://github.com/Alamofire/Alamof ⚠️ **To use with Swift 4.x please ensure you are using >= `3.0.0`** ⚠️ +⚠️ **To use with Swift 5.x please ensure you are using >= `4.0.0`** ⚠️ + + ## Swift version Alamofire-SwiftyJSON | Swift version | Alamofire | SwiftyJSON ------------- | --------------| ----------| ---------- 2.x | Swift 3.x | 4.x | 3.x 3.x | Swift 4.x | 4.5.x | 4.x +4.x | Swift 5.x | 5.x | 4.x ## Requirements @@ -40,10 +44,10 @@ import Alamofire_SwiftyJSON ```swift Alamofire.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) - .responseSwiftyJSON { dataResponse in - print(dataResponse.request) - print(dataResponse.response) - print(dataResponse.error) - print(dataResponse.value) - }) + .responseSwiftyJSON { dataResponse in + print(dataResponse.request) + print(dataResponse.response) + print(dataResponse.error) + print(dataResponse.value) + }) ``` diff --git a/Source/Alamofire-SwiftyJSON.swift b/Source/Alamofire-SwiftyJSON.swift index 84806fc..d263863 100644 --- a/Source/Alamofire-SwiftyJSON.swift +++ b/Source/Alamofire-SwiftyJSON.swift @@ -7,11 +7,10 @@ // import Foundation - import Alamofire import SwiftyJSON -// MARK: - Request for Swift JSON +private let emptyDataStatusCodes: Set = [204, 205] extension Request { /// Returns a SwiftyJSON object contained in a result type constructed from the response data using `JSONSerialization` @@ -27,12 +26,15 @@ extension Request { options: JSONSerialization.ReadingOptions, response: HTTPURLResponse?, data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } + error: Error? + ) -> Result { + if let error = error { + return .failure(error) + } - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(JSON.null) } + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { + return .success(JSON.null) + } guard let validData = data, validData.count > 0 else { return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) @@ -55,11 +57,10 @@ extension DataRequest { /// /// - returns: A JSON object response serializer. public static func swiftyJSONResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { + options: JSONSerialization.ReadingOptions = .allowFragments + ) -> DataResponseSerializer { return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseSwiftyJSON(options: options, response: response, data: data, error: error) + return Request.serializeResponseSwiftyJSON(options: options, response: response, data: data, error: error) } } @@ -73,15 +74,12 @@ extension DataRequest { public func responseSwiftyJSON( queue: DispatchQueue? = nil, options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( + completionHandler: @escaping (DataResponse) -> Void + ) -> Self { + return self.response( queue: queue, responseSerializer: DataRequest.swiftyJSONResponseSerializer(options: options), completionHandler: completionHandler ) } } - -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/Source/Info.plist b/Source/Info.plist index e0f4bf7..ca23c84 100644 --- a/Source/Info.plist +++ b/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.0 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion diff --git a/SwiftyJSON b/SwiftyJSON deleted file mode 160000 index 6b9f11e..0000000 --- a/SwiftyJSON +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6b9f11e2bbd277f199b1c09fa65631bfc52d4a5d