CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

AlamofireObjectMapperPromise 0.1.0

AlamofireObjectMapperPromise 0.1.0

Maintained by ZhihuaZhang.



 
Depends on:
AlamofireObjectMapper>= 0
PromiseKit>= 0
 

  • By
  • ZhihuaZhang

AlamofireObjectMapperPromise

CI Status Version License Platform

Requirements

Installation

AlamofireObjectMapperPromise is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AlamofireObjectMapperPromise'

Usage

Map Object

// func responseObject<T: BaseMappable>(queue: DispatchQueue? = nil, keyPath: String? = nil, mapToObject object: T? = nil, context: MapContext? = nil) -> Promise<T>
    
func fetchUserInfo() -> Promise<UserInfo> {
    return Alamofire.request(url)
        .responseObject()
}

Map Array

// func responseArray<T: BaseMappable>(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Promise<[T]>

func fetchMessages() -> Promise<[Message]> {
    return Alamofire.request(url)
        .responseArray()
}

Author

ZhihuaZhang, [email protected]

License

AlamofireObjectMapperPromise is available under the MIT license. See the LICENSE file for more info.