Skip to content

Commit ee75721

Browse files
committed
Version 2.4
1 parent b78ed79 commit ee75721

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

Moya-ObjectMapper.podspec

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Moya-ObjectMapper"
3-
s.version = "2.3.2"
3+
s.version = "2.4"
44
s.summary = "ObjectMapper bindings for Moya"
55
s.description = <<-EOS
66
[ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) bindings for
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
2222

2323
s.subspec "Core" do |ss|
2424
ss.source_files = "Source/*.swift"
25-
ss.dependency "Moya", '~> 9.0'
25+
ss.dependency "Moya", '~> 8.0'
2626
ss.dependency "ObjectMapper", '~> 2.2'
2727
ss.framework = "Foundation"
2828
end
@@ -31,13 +31,14 @@ Pod::Spec.new do |s|
3131
ss.source_files = "Source/RxSwift/*.swift"
3232
ss.dependency "Moya/RxSwift"
3333
ss.dependency "Moya-ObjectMapper/Core"
34-
ss.dependency "RxSwift", '~> 3.1'
34+
ss.dependency "RxSwift", '~> 3.3'
3535
end
3636

3737
s.subspec "ReactiveSwift" do |ss|
3838
ss.source_files = "Source/ReactiveSwift/*.swift"
39-
ss.dependency "Moya/ReactiveSwift"
40-
ss.dependency "Moya-ObjectMapper/Core"
41-
ss.dependency "ReactiveSwift"
42-
end
39+
ss.dependency "Moya/ReactiveSwift"
40+
ss.dependency "Moya-ObjectMapper/Core"
41+
ss.dependency "ReactiveSwift"
42+
end
43+
4344
end

Source/ReactiveSwift/SignalProducer+ObjectMapper.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension SignalProducerProtocol where Value == Moya.Response, Error == MoyaErro
77

88
/// Maps data received from the signal into an object which implements the Mappable protocol.
99
/// If the conversion fails, the signal errors.
10-
public func mapObject<T:BaseMappable>(_ type: T.Type, context: MapContext? = nil) -> SignalProducer<T, MoyaError> {
10+
public func mapObject<T: BaseMappable>(_ type: T.Type, context: MapContext? = nil) -> SignalProducer<T, MoyaError> {
1111
return producer.flatMap(.latest) {
1212
(response: Response) -> SignalProducer<T, Error> in
1313
return unwrapThrowable { try response.mapObject(type, context: context) }
@@ -17,7 +17,7 @@ extension SignalProducerProtocol where Value == Moya.Response, Error == MoyaErro
1717
/// Maps data received from the signal into an array of objects which implement the Mappable
1818
/// protocol.
1919
/// If the conversion fails, the signal errors.
20-
public func mapArray<T:BaseMappable>(_ type: T.Type, context: MapContext? = nil) -> SignalProducer<[T], MoyaError> {
20+
public func mapArray<T: BaseMappable>(_ type: T.Type, context: MapContext? = nil) -> SignalProducer<[T], MoyaError> {
2121
return producer.flatMap(.latest) { (response: Response) -> SignalProducer<[T], Error> in
2222
return unwrapThrowable { try response.mapArray(type, context: context) }
2323
}

Source/Response+ObjectMapper.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public extension Response {
4141
/// protocol.
4242
/// If the conversion fails, the signal errors.
4343
public func mapObject<T: ImmutableMappable>(_ type: T.Type, context: MapContext? = nil) throws -> T {
44-
return try Mapper<T>(context: context).map(JSONObject: try mapJSON())
44+
return try Mapper<T>(context: context).map(JSONObject: try mapJSON())
4545
}
4646

4747
/// Maps data received from the signal into an array of objects which implement the ImmutableMappable
@@ -51,7 +51,7 @@ public extension Response {
5151
guard let array = try mapJSON() as? [[String : Any]] else {
5252
throw MoyaError.jsonMapping(self)
5353
}
54-
return try Mapper<T>(context: context).mapArray(JSONArray: array)
54+
return try Mapper<T>(context: context).mapArray(JSONArray: array)
5555
}
5656

5757
}

0 commit comments

Comments
 (0)