Skip to content

Commit

Permalink
Merge pull request #26 from toughtochoose/master
Browse files Browse the repository at this point in the history
Moya 13.0.1 and Swift 5
  • Loading branch information
AvdLee authored May 16, 2019
2 parents a27d093 + 9bfdac7 commit d7a1adb
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 51 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
5.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode10
osx_image: xcode10.2
podfile: Example/Podfile
notifications:
email: false
Expand Down
Binary file added Example/.DS_Store
Binary file not shown.
36 changes: 24 additions & 12 deletions Example/Moya-SwiftyJSONMapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
DevelopmentTeam = FFLRU7747R;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand All @@ -258,6 +259,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -301,7 +303,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Moya-SwiftyJSONMapper_Tests/Pods-Moya-SwiftyJSONMapper_Tests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-Moya-SwiftyJSONMapper_Tests/Pods-Moya-SwiftyJSONMapper_Tests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
"${BUILT_PRODUCTS_DIR}/Moya-SwiftyJSONMapper/Moya_SwiftyJSONMapper.framework",
Expand All @@ -322,7 +324,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Moya-SwiftyJSONMapper_Tests/Pods-Moya-SwiftyJSONMapper_Tests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Moya-SwiftyJSONMapper_Tests/Pods-Moya-SwiftyJSONMapper_Tests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CCD5DA6A1025628E2FEB2086 /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -331,7 +333,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Moya-SwiftyJSONMapper_Example/Pods-Moya-SwiftyJSONMapper_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-Moya-SwiftyJSONMapper_Example/Pods-Moya-SwiftyJSONMapper_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
"${BUILT_PRODUCTS_DIR}/Moya-SwiftyJSONMapper/Moya_SwiftyJSONMapper.framework",
Expand All @@ -352,7 +354,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Moya-SwiftyJSONMapper_Example/Pods-Moya-SwiftyJSONMapper_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Moya-SwiftyJSONMapper_Example/Pods-Moya-SwiftyJSONMapper_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DF728A03AA3CAF525CCA42DD /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -447,6 +449,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;
Expand Down Expand Up @@ -503,6 +506,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;
Expand Down Expand Up @@ -553,12 +557,16 @@
baseConfigurationReference = 2DEC71E25016FC11FE062150 /* Pods-Moya-SwiftyJSONMapper_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = FFLRU7747R;
INFOPLIST_FILE = "Moya-SwiftyJSONMapper/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -567,12 +575,16 @@
baseConfigurationReference = 2A0941FB078096C59A878701 /* Pods-Moya-SwiftyJSONMapper_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = FFLRU7747R;
INFOPLIST_FILE = "Moya-SwiftyJSONMapper/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -593,7 +605,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Moya-SwiftyJSONMapper_Example.app/Moya-SwiftyJSONMapper_Example";
};
name = Debug;
Expand All @@ -611,7 +623,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Moya-SwiftyJSONMapper_Example.app/Moya-SwiftyJSONMapper_Example";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ end

# Build configurations
post_install do |installer|
swift4Targets = ['Moya', 'Moya-SwiftyJSONMapper', 'RxSwift', 'ReactiveSwift']
swift5Targets = ['Moya', 'Moya-SwiftyJSONMapper', 'RxSwift', 'ReactiveSwift']

installer.pods_project.targets.each do |target|
if swift4Targets.include? target.name
if swift5Targets.include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
config.build_settings['SWIFT_VERSION'] = '5.0'
end
else
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
Expand Down
56 changes: 28 additions & 28 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
PODS:
- Alamofire (4.7.3)
- Moya (11.0.2):
- Moya/Core (= 11.0.2)
- Moya-SwiftyJSONMapper (3.1.0):
- Moya-SwiftyJSONMapper/Core (= 3.1.0)
- Moya-SwiftyJSONMapper/Core (3.1.0):
- Moya (~> 11.0)
- Alamofire (4.8.2)
- Moya (13.0.1):
- Moya/Core (= 13.0.1)
- Moya-SwiftyJSONMapper (4.0.0):
- Moya-SwiftyJSONMapper/Core (= 4.0.0)
- Moya-SwiftyJSONMapper/Core (4.0.0):
- Moya (~> 13.0.1)
- SwiftyJSON
- Moya-SwiftyJSONMapper/ReactiveCocoa (3.1.0):
- Moya-SwiftyJSONMapper/ReactiveCocoa (4.0.0):
- Moya-SwiftyJSONMapper/Core
- Moya/ReactiveSwift
- Moya-SwiftyJSONMapper/RxSwift (3.1.0):
- Moya-SwiftyJSONMapper/RxSwift (4.0.0):
- Moya-SwiftyJSONMapper/Core
- Moya/RxSwift
- Moya/Core (11.0.2):
- Moya/Core (13.0.1):
- Alamofire (~> 4.1)
- Result (~> 3.0)
- Moya/ReactiveSwift (11.0.2):
- Result (~> 4.1)
- Moya/ReactiveSwift (13.0.1):
- Moya/Core
- ReactiveSwift (~> 3.0)
- Moya/RxSwift (11.0.2):
- ReactiveSwift (~> 5.0)
- Moya/RxSwift (13.0.1):
- Moya/Core
- RxSwift (~> 4.0)
- ReactiveSwift (3.1.0):
- Result (~> 3.2)
- Result (3.2.4)
- RxSwift (4.3.0)
- SwiftyJSON (3.1.4)
- ReactiveSwift (5.0.1):
- Result (~> 4.1)
- Result (4.1.0)
- RxSwift (4.5.0)
- SwiftyJSON (5.0.0)

DEPENDENCIES:
- Moya-SwiftyJSONMapper (from `../`)
Expand All @@ -47,14 +47,14 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568
Moya: a725035953bc1c0eb1be505ab903984501d82440
Moya-SwiftyJSONMapper: 7d63343fe826514ff710b5d39bdccda5cfce9dbb
ReactiveSwift: 5b26d2e988fe0eed2daf48c4054d1de74db50184
Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10
RxSwift: a9717a34df3179fe63563f76e046ad345078dd3a
SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e
Moya-SwiftyJSONMapper: 46766fd2fa3543af73cb6e0674b732417e1c7a83
ReactiveSwift: cac20a5bbe560c5806bd29c0fccf90d03b996ac1
Result: bd966fac789cc6c1563440b348ab2598cc24d5c7
RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7

PODFILE CHECKSUM: f4b96694fb484a90dfd563ab2c7e9cbd793722e9
PODFILE CHECKSUM: b2070400d16a827b30d7177b42586267696afe2d

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
4 changes: 2 additions & 2 deletions Moya-SwiftyJSONMapper.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Moya-SwiftyJSONMapper"
s.version = "3.1.0"
s.version = "4.0.0"
s.summary = "Map objects through SwiftyJSON in combination with Moya"
s.description = <<-EOS
[SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) bindings for
Expand All @@ -32,7 +32,7 @@ Pod::Spec.new do |s|

s.subspec "Core" do |ss|
ss.source_files = "Source/*.swift"
ss.dependency "Moya", "~> 11.0"
ss.dependency "Moya", "~> 13.0.1"
ss.dependency "SwiftyJSON"
ss.framework = "Foundation"
end
Expand Down
4 changes: 2 additions & 2 deletions Source/Response+SwiftyJSONMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public extension Response {

/// Maps data received from the signal into an object which implements the ALSwiftyJSONAble protocol.
/// If the conversion fails, the signal errors.
public func map<T: ALSwiftyJSONAble>(to type:T.Type) throws -> T {
func map<T: ALSwiftyJSONAble>(to type:T.Type) throws -> T {
let jsonObject = try mapJSON()

guard let mappedObject = T(jsonData: JSON(jsonObject)) else {
Expand All @@ -25,7 +25,7 @@ public extension Response {

/// Maps data received from the signal into an array of objects which implement the ALSwiftyJSONAble protocol
/// If the conversion fails, the signal errors.
public func map<T: ALSwiftyJSONAble>(to type:[T.Type]) throws -> [T] {
func map<T: ALSwiftyJSONAble>(to type:[T.Type]) throws -> [T] {
let jsonObject = try mapJSON()

let mappedArray = JSON(jsonObject)
Expand Down

0 comments on commit d7a1adb

Please sign in to comment.