AlamofireObjectMapperPromise is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AlamofireObjectMapperPromise'
// 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()
}
// func responseArray<T: BaseMappable>(queue: DispatchQueue? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Promise<[T]>
func fetchMessages() -> Promise<[Message]> {
return Alamofire.request(url)
.responseArray()
}
ZhihuaZhang, shika.cho@kapps.co.jp
AlamofireObjectMapperPromise is available under the MIT license. See the LICENSE file for more info.