Latest 0.1.3.1
Homepage https://github.com/arnauddorgans/RxAlamofire-ObjectMapper
License MIT
Platforms ios 8.0, tvos 9.0, osx 10.11, watchos 2.0
Dependencies RxAlamofire, ObjectMapper
Authors

RxAlamofire-ObjectMapper

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'RxAlamofire+ObjectMapper'

Usage

Map Object

// func responseMappable<T: Mappable>(`as` type: T.Type? = nil, to object: T? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Observable<T>

RxAlamofire.request(method, url, parameters: parameters)
    .responseMappable(as: User.self) // Observable<User>

Alamofire.request(url).rx
    .responseMappable(as: User.self) // Observable<User>

requestJSON(method, url)
    .mappable(as: User.self) // Observable<User>

Map Array

// func responseMappableArray<T: Mappable>(`as` type: T.Type? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Observable<[T]>

RxAlamofire.request(method, url, parameters: parameters)
    .responseMappableArray(as: User.self, keyPath: "followers") // Observable<[User]>

Alamofire.request(url).rx
    .responseMappableArray(as: User.self, keyPath: "followers") // Observable<[User]>

requestJSON(method, url)
    .mappableArray(as: User.self, keyPath: "followers") // Observable<[User]>

Map Dictionary

// func responseMappableDictionary<T: Mappable>(`as` type: T.Type? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Observable<[String:T]>

RxAlamofire.request(method, url, parameters: parameters)
    .responseMappableDictionary(as: User.self, keyPath: "followers") // Observable<[String: User]>

Alamofire.request(url).rx
    .responseMappableDictionary(as: User.self, keyPath: "followers") // Observable<[String: User]>

requestJSON(method, url)
    .mappableDictionary(as: User.self, keyPath: "followers") // Observable<[String: User]>

Map Dictionary Of Arrays

// func responseMappableDictionaryOfArrays<T: Mappable>(`as` type: T.Type? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Observable<[String:[T]]>

RxAlamofire.request(method, url, parameters: parameters)
    .responseMappableDictionaryOfArrays(as: Place.self, keyPath: "places") // Observable<[String:[Place]]>

Alamofire.request(url).rx
    .responseMappableDictionaryOfArrays(as: Place.self, keyPath: "places") // Observable<[String:[Place]]>

requestJSON(method, url)
    .mappableDictionaryOfArrays(as: Place.self, keyPath: "places") // Observable<[String:[Place]]>

Map Array Of Arrays

// func responseMappableArrayOfArrays<T: Mappable>(`as` type: T.Type? = nil, keyPath: String? = nil, context: MapContext? = nil) -> Observable<[[T]]>

RxAlamofire.request(method, url, parameters: parameters)
    .responseMappableArrayOfArrays(as: User.self, keyPath: "users") // Observable<[[User]]>

Alamofire.request(url).rx
    .responseMappableArrayOfArrays(as: User.self, keyPath: "users") // Observable<[[User]]>

requestJSON(method, url)
    .mappableArrayOfArrays(as: User.self, keyPath: "users") // Observable<[[User]]>

Author

Arnaud Dorgans, [email protected]

License

RxAlamofire+ObjectMapper is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RxAlamofire+ObjectMapper",
    "version": "0.1.3.1",
    "summary": "Reactive ObjectMapper extensions for RxAlamofire",
    "description": "Reactive ObjectMapper extensions for RxAlamofire.",
    "homepage": "https://github.com/arnauddorgans/RxAlamofire-ObjectMapper",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Arnoymous": "[email protected]"
    },
    "source": {
        "git": "https://github.com/arnauddorgans/RxAlamofire-ObjectMapper.git",
        "tag": "0.1.3.1"
    },
    "social_media_url": "https://twitter.com/arnauddorgans",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "osx": "10.11",
        "watchos": "2.0"
    },
    "source_files": "RxAlamofire-ObjectMapper/Classes/**/*",
    "dependencies": {
        "RxAlamofire": [
            "~> 4"
        ],
        "ObjectMapper": [
            "~> 3"
        ]
    }
}

Pin It on Pinterest

Share This