From fff143bf281db572b97beab12723793b757f024e Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 20 Sep 2019 14:52:52 -0500 Subject: [PATCH 01/15] update s.dependency to Alamofire 5.0.0 rc.2 & SwiftyJSON --- .travis.yml | 7 +- Alamofire | 2 +- Alamofire-SwiftyJSON.podspec | 8 +- .../project.pbxproj | 365 ++++++++---------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/AlamofireSwiftyJSON.xcscheme | 26 +- Source/Alamofire-SwiftyJSON.swift | 137 +++---- SwiftyJSON | 2 +- Tests/Alamofire_SwiftyJSONTests.swift | 2 +- 9 files changed, 251 insertions(+), 306 deletions(-) create mode 100644 Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/.travis.yml b/.travis.yml index de64906..0cc5386 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ -language: objective-c -osx_image: xcode9 +os: osxa +osx_image: xcode10.2 xcode_sdk: iphonesimulator10.0 +branches: + only: + - master env: - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone SE,OS=10.0" script: diff --git a/Alamofire b/Alamofire index 7fe7b91..c1d1458 160000 --- a/Alamofire +++ b/Alamofire @@ -1 +1 @@ -Subproject commit 7fe7b918b746fbb4b7a7c2146bef7a88c7ddc54e +Subproject commit c1d14588e5558a3669fd03510d135d88c5109069 diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 5447dc7..a04e2ff 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Alamofire-SwiftyJSON" - s.version = "3.0.0" + s.version = "5.0.0" s.summary = "Alamofire extension for serialize NSData to SwiftyJSON " s.homepage = "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON" s.license = { :type => "MIT" } @@ -8,9 +8,9 @@ Pod::Spec.new do |s| s.requires_arc = true s.osx.deployment_target = "10.11" - s.ios.deployment_target = "9.0" + s.ios.deployment_target = "10.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..74f3e77 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj +++ b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj @@ -7,10 +7,8 @@ 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, ); }; }; + 53779D6023356493003021E2 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53779D4823356420003021E2 /* Alamofire.framework */; }; + 53779D6123356497003021E2 /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53779D2F23356416003021E2 /* SwiftyJSON.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 */; }; @@ -18,138 +16,110 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 4BC5E9F91BB7E15600A393DD /* PBXContainerItemProxy */ = { + 53779D2E23356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4BC5E9FB1BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; + remoteGlobalIDString = 2E4FEFDB19575BE100351305; + remoteInfo = "SwiftyJSON iOS"; }; - 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */ = { + 53779D3023356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; + remoteGlobalIDString = 2E4FEFE619575BE100351305; + remoteInfo = "SwiftyJSON iOS Tests"; }; - 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */ = { + 53779D3223356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; remoteGlobalIDString = 9C7DFC5B1A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX"; + remoteInfo = "SwiftyJSON macOS"; }; - 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */ = { + 53779D3423356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; remoteGlobalIDString = 9C7DFC651A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX Tests"; + remoteInfo = "SwiftyJSON macOS Tests"; }; - 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */ = { + 53779D3623356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* 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 */ = { + 53779D3823356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; remoteGlobalIDString = 7236B4F61BAC14150020529B; remoteInfo = "SwiftyJSON tvOS"; }; - A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */ = { + 53779D3A23356416003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; proxyType = 2; remoteGlobalIDString = A8580F741BCF5C5B00DA927B; remoteInfo = "SwiftyJSON tvOS Tests"; }; - A8A2DBB61A23290100AF9EFC /* PBXContainerItemProxy */ = { + 53779D4723356420003021E2 /* 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; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3319A95C8B0040E7D1; + remoteInfo = "Alamofire iOS"; }; - A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { + 53779D4923356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB70619D1401D0070765E /* Project object */; - proxyType = 1; - remoteGlobalIDString = A8AFB70E19D1401D0070765E; - remoteInfo = AlamofireSwiftyJSON; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; + remoteInfo = "Alamofire iOS Tests"; }; - A8A2DBBE1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { + 53779D4B23356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; + remoteInfo = "Alamofire macOS"; }; - A8A2DBC01A2329BD00AF9EFC /* PBXContainerItemProxy */ = { + 53779D4D23356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2E4FEFDA19575BE100351305; - remoteInfo = SwiftyJSON; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = F829C6B21A7A94F100A2CD59; + remoteInfo = "Alamofire macOS Tests"; }; - A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */ = { + 53779D4F23356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = Alamofire; + remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; + remoteInfo = "Alamofire tvOS"; }; - A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */ = { + 53779D5123356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = AlamofireTests; + remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; + remoteInfo = "Alamofire tvOS Tests"; }; - A8AFB76419D14A670070765E /* PBXContainerItemProxy */ = { + 53779D5323356420003021E2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 2E4FEFDB19575BE100351305; - remoteInfo = SwiftyJSON; + remoteGlobalIDString = E4202FE01B667AA100C997FB; + remoteInfo = "Alamofire watchOS"; }; - A8AFB76619D14A670070765E /* PBXContainerItemProxy */ = { + A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFE619575BE100351305; - remoteInfo = SwiftyJSONTests; + containerPortal = A8AFB70619D1401D0070765E /* Project object */; + proxyType = 1; + remoteGlobalIDString = A8AFB70E19D1401D0070765E; + remoteInfo = AlamofireSwiftyJSON; }; /* End PBXContainerItemProxy section */ @@ -160,8 +130,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - A8A2DBBA1A23292000AF9EFC /* Alamofire.framework in Copy Frameworks */, - A8A2DBBB1A23292000AF9EFC /* SwiftyJSON.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 1; @@ -172,8 +140,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 +148,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = ""; }; + 53779D3C23356420003021E2 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Alamofire/Alamofire.xcodeproj; 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 +157,6 @@ 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -198,6 +164,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 53779D6123356497003021E2 /* SwiftyJSON.framework in Frameworks */, + 53779D6023356493003021E2 /* Alamofire.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -211,14 +179,50 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 53779D2423356416003021E2 /* Products */ = { + isa = PBXGroup; + children = ( + 53779D2F23356416003021E2 /* SwiftyJSON.framework */, + 53779D3123356416003021E2 /* SwiftyJSON iOS Tests.xctest */, + 53779D3323356416003021E2 /* SwiftyJSON.framework */, + 53779D3523356416003021E2 /* SwiftyJSON macOS Tests.xctest */, + 53779D3723356416003021E2 /* SwiftyJSON.framework */, + 53779D3923356416003021E2 /* SwiftyJSON.framework */, + 53779D3B23356416003021E2 /* SwiftyJSON tvOS Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 53779D3D23356420003021E2 /* Products */ = { + isa = PBXGroup; + children = ( + 53779D4823356420003021E2 /* Alamofire.framework */, + 53779D4A23356420003021E2 /* Alamofire iOS Tests.xctest */, + 53779D4C23356420003021E2 /* Alamofire.framework */, + 53779D4E23356420003021E2 /* Alamofire macOS Tests.xctest */, + 53779D5023356420003021E2 /* Alamofire.framework */, + 53779D5223356420003021E2 /* Alamofire tvOS Tests.xctest */, + 53779D5423356420003021E2 /* Alamofire.framework */, + ); + name = Products; + sourceTree = ""; + }; + 53779D552335643B003021E2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; A8AFB70519D1401D0070765E = { isa = PBXGroup; children = ( - A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */, - A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */, + 53779D3C23356420003021E2 /* Alamofire.xcodeproj */, + 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */, A8AFB71119D1401D0070765E /* Source */, A8AFB71B19D1401D0070765E /* Tests */, A8AFB71019D1401D0070765E /* Products */, + 53779D552335643B003021E2 /* Frameworks */, ); sourceTree = ""; }; @@ -266,34 +270,6 @@ 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 */ = { - 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 */, - ); - name = Products; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -321,8 +297,6 @@ buildRules = ( ); dependencies = ( - A8A2DBB71A23290100AF9EFC /* PBXTargetDependency */, - A8A2DBB91A23290100AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSON; productName = "Alamofire-SwiftyJSON"; @@ -342,8 +316,6 @@ ); dependencies = ( A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBBF1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBC11A2329BD00AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSONTests; productName = "Alamofire-SwiftyJSONTests"; @@ -357,7 +329,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = SwiftJSON; TargetAttributes = { A8AFB70E19D1401D0070765E = { @@ -375,6 +347,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = A8AFB70519D1401D0070765E; @@ -382,12 +355,12 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = A8AFB75519D14A5C0070765E /* Products */; - ProjectRef = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; + ProductGroup = 53779D3D23356420003021E2 /* Products */; + ProjectRef = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; }, { - ProductGroup = A8AFB75E19D14A670070765E /* Products */; - ProjectRef = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; + ProductGroup = 53779D2423356416003021E2 /* Products */; + ProjectRef = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; }, ); projectRoot = ""; @@ -399,102 +372,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 4BC5E9FA1BB7E15600A393DD /* Alamofire.framework */ = { + 53779D2F23356416003021E2 /* SwiftyJSON.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 */; + path = SwiftyJSON.framework; + remoteRef = 53779D2E23356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC5E9FE1BB7E15600A393DD /* Alamofire macOS Tests.xctest */ = { + 53779D3123356416003021E2 /* SwiftyJSON iOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "Alamofire macOS Tests.xctest"; - remoteRef = 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */; + path = "SwiftyJSON iOS Tests.xctest"; + remoteRef = 53779D3023356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC5EA041BB7E15600A393DD /* SwiftyJSON.framework */ = { + 53779D3323356416003021E2 /* SwiftyJSON.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = SwiftyJSON.framework; - remoteRef = 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */; + remoteRef = 53779D3223356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC5EA061BB7E15600A393DD /* SwiftyJSON OSX Tests.xctest */ = { + 53779D3523356416003021E2 /* SwiftyJSON macOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "SwiftyJSON OSX Tests.xctest"; - remoteRef = 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */; + path = "SwiftyJSON macOS Tests.xctest"; + remoteRef = 53779D3423356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC5EA081BB7E15600A393DD /* SwiftyJSON.framework */ = { + 53779D3723356416003021E2 /* SwiftyJSON.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = SwiftyJSON.framework; - remoteRef = 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */; + remoteRef = 53779D3623356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A81D16441E59E90500C62C5F /* Alamofire.framework */ = { + 53779D3923356416003021E2 /* SwiftyJSON.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = A81D16431E59E90500C62C5F /* PBXContainerItemProxy */; + path = SwiftyJSON.framework; + remoteRef = 53779D3823356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A81D16461E59E90500C62C5F /* Alamofire tvOS Tests.xctest */ = { + 53779D3B23356416003021E2 /* SwiftyJSON tvOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = A81D16451E59E90500C62C5F /* PBXContainerItemProxy */; + path = "SwiftyJSON tvOS Tests.xctest"; + remoteRef = 53779D3A23356416003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A81D164E1E59E90500C62C5F /* SwiftyJSON.framework */ = { + 53779D4823356420003021E2 /* Alamofire.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A81D164D1E59E90500C62C5F /* PBXContainerItemProxy */; + path = Alamofire.framework; + remoteRef = 53779D4723356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A81D16501E59E90500C62C5F /* SwiftyJSON tvOS Tests.xctest */ = { + 53779D4A23356420003021E2 /* Alamofire iOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "SwiftyJSON tvOS Tests.xctest"; - remoteRef = A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */; + path = "Alamofire iOS Tests.xctest"; + remoteRef = 53779D4923356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB75A19D14A5C0070765E /* Alamofire.framework */ = { + 53779D4C23356420003021E2 /* Alamofire.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = Alamofire.framework; - remoteRef = A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */; + remoteRef = 53779D4B23356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB75C19D14A5C0070765E /* Alamofire iOS Tests.xctest */ = { + 53779D4E23356420003021E2 /* Alamofire macOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */; + path = "Alamofire macOS Tests.xctest"; + remoteRef = 53779D4D23356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB76519D14A670070765E /* SwiftyJSON.framework */ = { + 53779D5023356420003021E2 /* Alamofire.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A8AFB76419D14A670070765E /* PBXContainerItemProxy */; + path = Alamofire.framework; + remoteRef = 53779D4F23356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB76719D14A670070765E /* SwiftyJSON iOS Tests.xctest */ = { + 53779D5223356420003021E2 /* Alamofire tvOS Tests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; - path = "SwiftyJSON iOS Tests.xctest"; - remoteRef = A8AFB76619D14A670070765E /* PBXContainerItemProxy */; + path = "Alamofire tvOS Tests.xctest"; + remoteRef = 53779D5123356420003021E2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 53779D5423356420003021E2 /* Alamofire.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Alamofire.framework; + remoteRef = 53779D5323356420003021E2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -536,31 +509,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 +521,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 +530,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; @@ -609,7 +565,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -624,6 +580,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 +589,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; @@ -658,7 +617,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -683,7 +642,7 @@ 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; }; @@ -701,7 +660,7 @@ 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; }; @@ -716,7 +675,7 @@ 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; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -727,7 +686,7 @@ 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; + 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 @@ - - - - - - - - Result - { - guard error == nil else { return .failure(error!) } - - 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)) - } - - do { - let json = try JSONSerialization.jsonObject(with: validData, options: options) - return .success(JSON(json)) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) - } +public final class SwiftyJSONResponseSerializer: ResponseSerializer { + public let dataPreprocessor: DataPreprocessor + public let emptyResponseCodes: Set + public let emptyRequestMethods: Set + /// `JSONSerialization.ReadingOptions` used when serializing a response. + public let options: JSONSerialization.ReadingOptions + + /// Creates an instance with the provided values. + /// + /// - Parameters: + /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. + /// - emptyResponseCodes: The HTTP response codes for which empty responses are allowed. `[204, 205]` by default. + /// - emptyRequestMethods: The HTTP request methods for which empty responses are allowed. `[.head]` by default. + /// - options: The options to use. `.allowFragments` by default. + public init(dataPreprocessor: DataPreprocessor = SwiftyJSONResponseSerializer.defaultDataPreprocessor, + emptyResponseCodes: Set = SwiftyJSONResponseSerializer.defaultEmptyResponseCodes, + emptyRequestMethods: Set = SwiftyJSONResponseSerializer.defaultEmptyRequestMethods, + options: JSONSerialization.ReadingOptions = .allowFragments) { + self.dataPreprocessor = dataPreprocessor + self.emptyResponseCodes = emptyResponseCodes + self.emptyRequestMethods = emptyRequestMethods + self.options = options + } + + public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> JSON { + guard error == nil else { throw error! } + + guard var data = data, !data.isEmpty else { + guard emptyResponseAllowed(forRequest: request, response: response) else { + throw AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength) + } + + return JSON(booleanLiteral: false) } + + data = try dataPreprocessor.preprocess(data) + + do { + let json = try JSONSerialization.jsonObject(with: data, options: options) + return JSON(json) + } catch { + throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error)) + } + } } extension DataRequest { - /// Creates a response serializer that returns a SwiftyJSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func swiftyJSONResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseSwiftyJSON(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseSwiftyJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.swiftyJSONResponseSerializer(options: options), - completionHandler: completionHandler - ) - } + /// Adds a handler to be called once the request has finished. + /// + /// - Parameters: + /// - queue: The queue on which the completion handler is dispatched. `.main` by default. + /// - options: The JSON serialization reading options. `.allowFragments` by default. + /// - completionHandler: A closure to be executed once the request has finished. + /// + /// - Returns: The request. + @discardableResult + public func responseSwiftyJSON(queue: DispatchQueue = .main, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (AFDataResponse) -> Void) -> Self { + return response(queue: queue, + responseSerializer: SwiftyJSONResponseSerializer(options: options), + completionHandler: completionHandler) + } } - -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/SwiftyJSON b/SwiftyJSON index 6b9f11e..2b6054e 160000 --- a/SwiftyJSON +++ b/SwiftyJSON @@ -1 +1 @@ -Subproject commit 6b9f11e2bbd277f199b1c09fa65631bfc52d4a5d +Subproject commit 2b6054efa051565954e1d2b9da831680026cd768 diff --git a/Tests/Alamofire_SwiftyJSONTests.swift b/Tests/Alamofire_SwiftyJSONTests.swift index 43731b0..778f056 100644 --- a/Tests/Alamofire_SwiftyJSONTests.swift +++ b/Tests/Alamofire_SwiftyJSONTests.swift @@ -17,7 +17,7 @@ class Alamofire_SwiftyJSONTests: XCTestCase { let URL = "http://httpbin.org/get" let parameters: Parameters = ["foo": "bar"] let expect = expectation(description: "responseSwiftyJSON method should work") - Alamofire.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) + AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) .validate() .responseSwiftyJSON { response in XCTAssertNotNil(response.request, "request should not be nil") From 09cd2d5139d2132e2cbd3c140391a4b939380463 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 20 Sep 2019 14:53:46 -0500 Subject: [PATCH 02/15] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a17848..dd656c1 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,15 @@ 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 >= `5.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 +5.x | Swift 5.x | 5.x | 5.x ## Requirements @@ -39,7 +42,7 @@ import Alamofire_SwiftyJSON ``` ```swift -Alamofire.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) +AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) .responseSwiftyJSON { dataResponse in print(dataResponse.request) print(dataResponse.response) From 7018514566d7da43c83128b57844911bace9f445 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 20 Sep 2019 14:59:09 -0500 Subject: [PATCH 03/15] updated travis settings --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0cc5386..da095b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -os: osxa -osx_image: xcode10.2 +language: objective-c +osx_image: xcode10.3 xcode_sdk: iphonesimulator10.0 branches: only: From 7948a81b4bc20c4652c85a980eaa059a0d900fe6 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 20 Sep 2019 15:03:21 -0500 Subject: [PATCH 04/15] travis simulator version settings --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index da095b8..5fa5363 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: objective-c osx_image: xcode10.3 -xcode_sdk: iphonesimulator10.0 +xcode_sdk: iphonesimulator12.0 branches: only: - master 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 XS Max,OS=12.0" script: - set -o pipefail && xcodebuild -project Alamofire-SwiftyJSON.xcodeproj -scheme $SCHEME -destination "$DESTINATION" build-for-testing test | xcpretty From 5fd96198bf155aeb53b58e3cd34f71bd52f7b37c Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Mon, 21 Oct 2019 21:37:46 -0500 Subject: [PATCH 05/15] Update .travis.yml --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5fa5363..02ce602 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ -language: objective-c -osx_image: xcode10.3 -xcode_sdk: iphonesimulator12.0 +language: swift +osx_image: xcode11 +xcode_sdk: iphonesimulator13.0 branches: only: - master env: - - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone XS Max,OS=12.0" + - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone XS Max,OS=13.0" script: - set -o pipefail && xcodebuild -project Alamofire-SwiftyJSON.xcodeproj -scheme $SCHEME -destination "$DESTINATION" build-for-testing test | xcpretty From 1bb3fd489724db160ccb55e8d11414878895fa91 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Mon, 21 Oct 2019 21:46:08 -0500 Subject: [PATCH 06/15] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 02ce602..dec91de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ branches: only: - master env: - - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone XS Max,OS=13.0" + - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=13.0" script: - set -o pipefail && xcodebuild -project Alamofire-SwiftyJSON.xcodeproj -scheme $SCHEME -destination "$DESTINATION" build-for-testing test | xcpretty From 8f1864eb612d1ac215d247673c5070401de509f1 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 14 Feb 2020 17:32:36 -0600 Subject: [PATCH 07/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index a04e2ff..de798df 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = "10.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5.0.0-rc.2' + s.dependency 'Alamofire', '~> 5.0.0' s.dependency 'SwiftyJSON', '~> 5.0.0' end From f994c0e1f2213b8244c3e6e934e3335dc1774148 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Sun, 5 Apr 2020 18:00:38 -0500 Subject: [PATCH 08/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index de798df..4a711bb 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = "10.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5.0.0' - s.dependency 'SwiftyJSON', '~> 5.0.0' + s.dependency 'Alamofire', '~> 5' + s.dependency 'SwiftyJSON', '~> 5' end From 2449a2ce1e0e534fe9fe0cf2ee2c51944da887c4 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Sun, 5 Apr 2020 18:04:51 -0500 Subject: [PATCH 09/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 4a711bb..6272bb9 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = "10.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5' - s.dependency 'SwiftyJSON', '~> 5' + s.dependency 'Alamofire', '~> 5.1.0' + s.dependency 'SwiftyJSON', '~> 5.0.0' end From eb9e8fe51714f48909e0adc93d5aa35e674d4a95 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Sun, 5 Apr 2020 18:05:48 -0500 Subject: [PATCH 10/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 6272bb9..de798df 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = "10.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5.1.0' + s.dependency 'Alamofire', '~> 5.0.0' s.dependency 'SwiftyJSON', '~> 5.0.0' end From c035cf4a0a05e7ee99cd7fd1a03e49b185c41e05 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Sun, 5 Apr 2020 18:06:10 -0500 Subject: [PATCH 11/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index de798df..4a711bb 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = "10.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5.0.0' - s.dependency 'SwiftyJSON', '~> 5.0.0' + s.dependency 'Alamofire', '~> 5' + s.dependency 'SwiftyJSON', '~> 5' end From 08aea6d71a237cb809629b94d580bcd94ce04cc0 Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 4 Sep 2020 12:02:36 -0500 Subject: [PATCH 12/15] use cocoapods instead of git submodules --- .github/workflows/ci.yml | 19 + .gitignore | 2 +- .swift-version | 2 +- .travis.yml | 10 - .../project.pbxproj | 343 +++++------------- Podfile | 14 + Podfile.lock | 20 + Source/Alamofire-SwiftyJSON.swift | 118 +++--- Tests/Alamofire_SwiftyJSONTests.swift | 7 +- 9 files changed, 216 insertions(+), 319 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 Podfile create mode 100644 Podfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1683ecc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: Tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + - name: Build + run: pod install + - name: Run iOS tests + run: xcodebuild test -workspace Alamofire-SwiftyJSON.xcworkspace -scheme AlamofireSwiftyJSON -destination platform="iOS Simulator,name=iPhone 11 Pro" 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/.swift-version b/.swift-version index 9f55b2c..ef425ca 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +5.2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dec91de..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: swift -osx_image: xcode11 -xcode_sdk: iphonesimulator13.0 -branches: - only: - - master -env: - - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone 8,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-SwiftyJSON.xcodeproj/project.pbxproj b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj index 74f3e77..ce8a816 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj +++ b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj @@ -7,8 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - 53779D6023356493003021E2 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53779D4823356420003021E2 /* Alamofire.framework */; }; - 53779D6123356497003021E2 /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53779D2F23356416003021E2 /* SwiftyJSON.framework */; }; + 7E90058880628A8C474F3A68 /* Pods_AlamofireSwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8141A8B420D5792AA2B6AD79 /* Pods_AlamofireSwiftyJSON.framework */; }; + A1C24D21CC1605AB4DA90602 /* Pods_AlamofireSwiftyJSONTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79F09BCD209A1D2946563E19 /* Pods_AlamofireSwiftyJSONTests.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 */; }; @@ -16,104 +16,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 53779D2E23356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFDB19575BE100351305; - remoteInfo = "SwiftyJSON iOS"; - }; - 53779D3023356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFE619575BE100351305; - remoteInfo = "SwiftyJSON iOS Tests"; - }; - 53779D3223356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC5B1A9102BD005AA3F7; - remoteInfo = "SwiftyJSON macOS"; - }; - 53779D3423356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC651A9102BD005AA3F7; - remoteInfo = "SwiftyJSON macOS Tests"; - }; - 53779D3623356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4D7CCE81B9465A700EE7221; - remoteInfo = "SwiftyJSON watchOS"; - }; - 53779D3823356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 7236B4F61BAC14150020529B; - remoteInfo = "SwiftyJSON tvOS"; - }; - 53779D3A23356416003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = A8580F741BCF5C5B00DA927B; - remoteInfo = "SwiftyJSON tvOS Tests"; - }; - 53779D4723356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = "Alamofire iOS"; - }; - 53779D4923356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = "Alamofire iOS Tests"; - }; - 53779D4B23356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire macOS"; - }; - 53779D4D23356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire macOS Tests"; - }; - 53779D4F23356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - 53779D5123356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - 53779D5323356420003021E2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A8AFB70619D1401D0070765E /* Project object */; @@ -148,8 +50,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = ""; }; - 53779D3C23356420003021E2 /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; + 25819AD76C0268FCBBA2FCBF /* 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 = ""; }; + 349731602792B03E8212C8A5 /* 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 = ""; }; + 79F09BCD209A1D2946563E19 /* Pods_AlamofireSwiftyJSONTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AlamofireSwiftyJSONTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8141A8B420D5792AA2B6AD79 /* Pods_AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 85ED7618CB4A172FF8CBCFC0 /* 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 = ""; }; + 8C8591497AFB78FD9E258AF7 /* 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 = ""; }; 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 = ""; }; @@ -164,8 +70,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 53779D6123356497003021E2 /* SwiftyJSON.framework in Frameworks */, - 53779D6023356493003021E2 /* Alamofire.framework in Frameworks */, + 7E90058880628A8C474F3A68 /* Pods_AlamofireSwiftyJSON.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -173,43 +78,18 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A1C24D21CC1605AB4DA90602 /* Pods_AlamofireSwiftyJSONTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 53779D2423356416003021E2 /* Products */ = { - isa = PBXGroup; - children = ( - 53779D2F23356416003021E2 /* SwiftyJSON.framework */, - 53779D3123356416003021E2 /* SwiftyJSON iOS Tests.xctest */, - 53779D3323356416003021E2 /* SwiftyJSON.framework */, - 53779D3523356416003021E2 /* SwiftyJSON macOS Tests.xctest */, - 53779D3723356416003021E2 /* SwiftyJSON.framework */, - 53779D3923356416003021E2 /* SwiftyJSON.framework */, - 53779D3B23356416003021E2 /* SwiftyJSON tvOS Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 53779D3D23356420003021E2 /* Products */ = { - isa = PBXGroup; - children = ( - 53779D4823356420003021E2 /* Alamofire.framework */, - 53779D4A23356420003021E2 /* Alamofire iOS Tests.xctest */, - 53779D4C23356420003021E2 /* Alamofire.framework */, - 53779D4E23356420003021E2 /* Alamofire macOS Tests.xctest */, - 53779D5023356420003021E2 /* Alamofire.framework */, - 53779D5223356420003021E2 /* Alamofire tvOS Tests.xctest */, - 53779D5423356420003021E2 /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; 53779D552335643B003021E2 /* Frameworks */ = { isa = PBXGroup; children = ( + 8141A8B420D5792AA2B6AD79 /* Pods_AlamofireSwiftyJSON.framework */, + 79F09BCD209A1D2946563E19 /* Pods_AlamofireSwiftyJSONTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -217,12 +97,11 @@ A8AFB70519D1401D0070765E = { isa = PBXGroup; children = ( - 53779D3C23356420003021E2 /* Alamofire.xcodeproj */, - 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */, A8AFB71119D1401D0070765E /* Source */, A8AFB71B19D1401D0070765E /* Tests */, A8AFB71019D1401D0070765E /* Products */, 53779D552335643B003021E2 /* Frameworks */, + E3AECADE183F7CACE275C5C4 /* Pods */, ); sourceTree = ""; }; @@ -270,6 +149,17 @@ name = "Supporting Files"; sourceTree = ""; }; + E3AECADE183F7CACE275C5C4 /* Pods */ = { + isa = PBXGroup; + children = ( + 25819AD76C0268FCBBA2FCBF /* Pods-AlamofireSwiftyJSON.debug.xcconfig */, + 85ED7618CB4A172FF8CBCFC0 /* Pods-AlamofireSwiftyJSON.release.xcconfig */, + 349731602792B03E8212C8A5 /* Pods-AlamofireSwiftyJSONTests.debug.xcconfig */, + 8C8591497AFB78FD9E258AF7 /* Pods-AlamofireSwiftyJSONTests.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -288,6 +178,7 @@ isa = PBXNativeTarget; buildConfigurationList = A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */; buildPhases = ( + 5B5000E549C2DD7FEB0EC983 /* [CP] Check Pods Manifest.lock */, A8AFB70A19D1401D0070765E /* Sources */, A8AFB70B19D1401D0070765E /* Frameworks */, A8AFB70C19D1401D0070765E /* Headers */, @@ -307,10 +198,12 @@ isa = PBXNativeTarget; buildConfigurationList = A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */; buildPhases = ( + 927EBAF7CC9A1E6D8A3F396D /* [CP] Check Pods Manifest.lock */, A8AFB71619D1401D0070765E /* Sources */, A8AFB71719D1401D0070765E /* Frameworks */, A8AFB71819D1401D0070765E /* Resources */, A8A2DBC21A2329CE00AF9EFC /* Copy Frameworks */, + B1172473D4268CDCF7B3B578 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -353,16 +246,6 @@ mainGroup = A8AFB70519D1401D0070765E; productRefGroup = A8AFB71019D1401D0070765E /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 53779D3D23356420003021E2 /* Products */; - ProjectRef = 53779D3C23356420003021E2 /* Alamofire.xcodeproj */; - }, - { - ProductGroup = 53779D2423356416003021E2 /* Products */; - ProjectRef = 53779D2323356416003021E2 /* SwiftyJSON.xcodeproj */; - }, - ); projectRoot = ""; targets = ( A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */, @@ -371,107 +254,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 53779D2F23356416003021E2 /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 53779D2E23356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3123356416003021E2 /* SwiftyJSON iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON iOS Tests.xctest"; - remoteRef = 53779D3023356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3323356416003021E2 /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 53779D3223356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3523356416003021E2 /* SwiftyJSON macOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON macOS Tests.xctest"; - remoteRef = 53779D3423356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3723356416003021E2 /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 53779D3623356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3923356416003021E2 /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 53779D3823356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D3B23356416003021E2 /* SwiftyJSON tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON tvOS Tests.xctest"; - remoteRef = 53779D3A23356416003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D4823356420003021E2 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 53779D4723356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D4A23356420003021E2 /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = 53779D4923356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D4C23356420003021E2 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 53779D4B23356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D4E23356420003021E2 /* Alamofire macOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire macOS Tests.xctest"; - remoteRef = 53779D4D23356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D5023356420003021E2 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 53779D4F23356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D5223356420003021E2 /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = 53779D5123356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 53779D5423356420003021E2 /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 53779D5323356420003021E2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ A8AFB70D19D1401D0070765E /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -489,6 +271,73 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 5B5000E549C2DD7FEB0EC983 /* [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; + }; + 927EBAF7CC9A1E6D8A3F396D /* [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; + }; + B1172473D4268CDCF7B3B578 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-AlamofireSwiftyJSONTests/Pods-AlamofireSwiftyJSONTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AlamofireSwiftyJSONTests/Pods-AlamofireSwiftyJSONTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ A8AFB70A19D1401D0070765E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -630,6 +479,7 @@ }; A8AFB72319D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 25819AD76C0268FCBBA2FCBF /* Pods-AlamofireSwiftyJSON.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -648,6 +498,7 @@ }; A8AFB72419D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 85ED7618CB4A172FF8CBCFC0 /* Pods-AlamofireSwiftyJSON.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -666,6 +517,7 @@ }; A8AFB72619D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 349731602792B03E8212C8A5 /* Pods-AlamofireSwiftyJSONTests.debug.xcconfig */; buildSettings = { GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -681,6 +533,7 @@ }; A8AFB72719D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8C8591497AFB78FD9E258AF7 /* Pods-AlamofireSwiftyJSONTests.release.xcconfig */; buildSettings = { INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..03be5b4 --- /dev/null +++ b/Podfile @@ -0,0 +1,14 @@ +platform :ios, '10' + +source 'https://github.com/CocoaPods/Specs.git' +use_frameworks! + +target 'AlamofireSwiftyJSON' do + pod 'Alamofire', '~> 5' + pod 'SwiftyJSON', '~> 5' +end + +target 'AlamofireSwiftyJSONTests' do + pod 'Alamofire', '~> 5' + pod 'SwiftyJSON', '~> 5' +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..587878c --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - Alamofire (5.2.2) + - SwiftyJSON (5.0.0) + +DEPENDENCIES: + - Alamofire (~> 5) + - SwiftyJSON (~> 5) + +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - Alamofire + - SwiftyJSON + +SPEC CHECKSUMS: + Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 + SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 + +PODFILE CHECKSUM: 5175165036843bb0979dcfa0e46433202caf367a + +COCOAPODS: 1.10.0.beta.2 diff --git a/Source/Alamofire-SwiftyJSON.swift b/Source/Alamofire-SwiftyJSON.swift index 8ab8f2d..4f23a34 100644 --- a/Source/Alamofire-SwiftyJSON.swift +++ b/Source/Alamofire-SwiftyJSON.swift @@ -1,68 +1,70 @@ -import Foundation import Alamofire +import Foundation import SwiftyJSON public final class SwiftyJSONResponseSerializer: ResponseSerializer { - public let dataPreprocessor: DataPreprocessor - public let emptyResponseCodes: Set - public let emptyRequestMethods: Set - /// `JSONSerialization.ReadingOptions` used when serializing a response. - public let options: JSONSerialization.ReadingOptions - - /// Creates an instance with the provided values. - /// - /// - Parameters: - /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. - /// - emptyResponseCodes: The HTTP response codes for which empty responses are allowed. `[204, 205]` by default. - /// - emptyRequestMethods: The HTTP request methods for which empty responses are allowed. `[.head]` by default. - /// - options: The options to use. `.allowFragments` by default. - public init(dataPreprocessor: DataPreprocessor = SwiftyJSONResponseSerializer.defaultDataPreprocessor, - emptyResponseCodes: Set = SwiftyJSONResponseSerializer.defaultEmptyResponseCodes, - emptyRequestMethods: Set = SwiftyJSONResponseSerializer.defaultEmptyRequestMethods, - options: JSONSerialization.ReadingOptions = .allowFragments) { - self.dataPreprocessor = dataPreprocessor - self.emptyResponseCodes = emptyResponseCodes - self.emptyRequestMethods = emptyRequestMethods - self.options = options - } - - public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> JSON { - guard error == nil else { throw error! } - - guard var data = data, !data.isEmpty else { - guard emptyResponseAllowed(forRequest: request, response: response) else { - throw AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength) - } - - return JSON(booleanLiteral: false) + public let dataPreprocessor: DataPreprocessor + public let emptyResponseCodes: Set + public let emptyRequestMethods: Set + /// `JSONSerialization.ReadingOptions` used when serializing a response. + public let options: JSONSerialization.ReadingOptions + + /// Creates an instance with the provided values. + /// + /// - Parameters: + /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. + /// - emptyResponseCodes: The HTTP response codes for which empty responses are allowed. `[204, 205]` by default. + /// - emptyRequestMethods: The HTTP request methods for which empty responses are allowed. `[.head]` by default. + /// - options: The options to use. `.allowFragments` by default. + public init(dataPreprocessor: DataPreprocessor = SwiftyJSONResponseSerializer.defaultDataPreprocessor, + emptyResponseCodes: Set = SwiftyJSONResponseSerializer.defaultEmptyResponseCodes, + emptyRequestMethods: Set = SwiftyJSONResponseSerializer.defaultEmptyRequestMethods, + options: JSONSerialization.ReadingOptions = .allowFragments) + { + self.dataPreprocessor = dataPreprocessor + self.emptyResponseCodes = emptyResponseCodes + self.emptyRequestMethods = emptyRequestMethods + self.options = options } - - data = try dataPreprocessor.preprocess(data) - - do { - let json = try JSONSerialization.jsonObject(with: data, options: options) - return JSON(json) - } catch { - throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error)) + + public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> JSON { + guard error == nil else { throw error! } + + guard var data = data, !data.isEmpty else { + guard emptyResponseAllowed(forRequest: request, response: response) else { + throw AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength) + } + + return JSON(booleanLiteral: false) + } + + data = try dataPreprocessor.preprocess(data) + + do { + let json = try JSONSerialization.jsonObject(with: data, options: options) + return JSON(json) + } catch { + throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error)) + } } - } } extension DataRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - Parameters: - /// - queue: The queue on which the completion handler is dispatched. `.main` by default. - /// - options: The JSON serialization reading options. `.allowFragments` by default. - /// - completionHandler: A closure to be executed once the request has finished. - /// - /// - Returns: The request. - @discardableResult - public func responseSwiftyJSON(queue: DispatchQueue = .main, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (AFDataResponse) -> Void) -> Self { - return response(queue: queue, - responseSerializer: SwiftyJSONResponseSerializer(options: options), - completionHandler: completionHandler) - } + /// Adds a handler to be called once the request has finished. + /// + /// - Parameters: + /// - queue: The queue on which the completion handler is dispatched. `.main` by default. + /// - options: The JSON serialization reading options. `.allowFragments` by default. + /// - completionHandler: A closure to be executed once the request has finished. + /// + /// - Returns: The request. + @discardableResult + public func responseSwiftyJSON(queue: DispatchQueue = .main, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (AFDataResponse) -> Void) -> Self + { + response(queue: queue, + responseSerializer: SwiftyJSONResponseSerializer(options: options), + completionHandler: completionHandler) + } } diff --git a/Tests/Alamofire_SwiftyJSONTests.swift b/Tests/Alamofire_SwiftyJSONTests.swift index 778f056..cd65a46 100644 --- a/Tests/Alamofire_SwiftyJSONTests.swift +++ b/Tests/Alamofire_SwiftyJSONTests.swift @@ -6,13 +6,12 @@ // Copyright (c) 2014年 SwiftJSON. All rights reserved. // -import XCTest import Alamofire -import SwiftyJSON import AlamofireSwiftyJSON +import SwiftyJSON +import XCTest class Alamofire_SwiftyJSONTests: XCTestCase { - func testGETRequestJSONResponse() { let URL = "http://httpbin.org/get" let parameters: Parameters = ["foo": "bar"] @@ -25,7 +24,7 @@ class Alamofire_SwiftyJSONTests: XCTestCase { XCTAssertNil(response.error, "result error should be nil") XCTAssertEqual(response.value?["args"], SwiftyJSON.JSON(["foo": "bar"] as NSDictionary), "args should be equal") expect.fulfill() - } + } waitForExpectations(timeout: 10.0, handler: nil) } } From c938b705e8e7c29f14e21c1dc5db5af9113512ba Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 4 Sep 2020 12:03:22 -0500 Subject: [PATCH 13/15] remove Alamofire submodule --- .gitmodules | 3 --- Alamofire | 1 - 2 files changed, 4 deletions(-) delete mode 160000 Alamofire diff --git a/.gitmodules b/.gitmodules index a8f67ba..410b2c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [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/Alamofire b/Alamofire deleted file mode 160000 index c1d1458..0000000 --- a/Alamofire +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1d14588e5558a3669fd03510d135d88c5109069 From 5a1bb7e3a30421bbada17e0b410819a166d9c73b Mon Sep 17 00:00:00 2001 From: Adar Porat Date: Fri, 4 Sep 2020 12:04:22 -0500 Subject: [PATCH 14/15] removed SwiftyJSON submodule --- .gitmodules | 3 --- SwiftyJSON | 1 - 2 files changed, 4 deletions(-) delete mode 160000 SwiftyJSON diff --git a/.gitmodules b/.gitmodules index 410b2c7..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "SwiftyJSON"] - path = SwiftyJSON - url = https://github.com/SwiftyJSON/SwiftyJSON.git diff --git a/SwiftyJSON b/SwiftyJSON deleted file mode 160000 index 2b6054e..0000000 --- a/SwiftyJSON +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2b6054efa051565954e1d2b9da831680026cd768 From 7bd9f48869e80333ae08286d8296616561252024 Mon Sep 17 00:00:00 2001 From: A Porat Date: Sun, 10 Nov 2024 18:19:53 -0500 Subject: [PATCH 15/15] Update Alamofire-SwiftyJSON.podspec --- Alamofire-SwiftyJSON.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 4a711bb..66aa6ea 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.osx.deployment_target = "10.11" - s.ios.deployment_target = "10.0" + s.ios.deployment_target = "15.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" s.dependency 'Alamofire', '~> 5'