Latest 2.0.0
Homepage https://github.com/deanWombourne/Alamofire-Decodable
License MIT
Platforms ios 9.0
Dependencies Alamofire, Decodable
Authors

CI Status
Version
License
Platform

Brief

A simple pod to connect Decodable to Alamofire.

Assuming you have a decodable struct called Post (check out Post.swift in the example project), then you can just use responseDecodable to return you one (or a list) of them, like this:

Alamofire.request("https://jsonplaceholder.typicode.com/posts/1").responseDecodable { (response: DataResponse<Post>) in
    switch response.result {
    case .success(let post):
        print("Recieved post: (post)")

    case .failure(let error):
        print("Failed with error: (error)")
    }
}

Requirements

Alamofire-Decodable requires iOS 9.0, Swift 3 and Xcode 8.

Example Project

To run the example project, clone the repo and run the project in the Example folder.

Installation

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

pod "Alamofire-Decodable"

Author

Sam Dean, [email protected]

License

Alamofire-Decodable is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Alamofire-Decodable",
    "version": "2.0.0",
    "summary": "A trivial method added to alamofire to automagically decode responses using Decodable",
    "description": "This pod adds the `responseDecodable` method to Alamofire's Request object to return model objects instead of just json.'. This pod basically just removes some boilerplate from your apps.",
    "homepage": "https://github.com/deanWombourne/Alamofire-Decodable",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Sam Dean": "[email protected]"
    },
    "source": {
        "git": "https://github.com/deanWombourne/Alamofire-Decodable.git",
        "tag": "v2.0.0"
    },
    "social_media_url": "https://twitter.com/deanWombourne",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Alamofire-Decodable/Classes/**/*",
    "dependencies": {
        "Alamofire": [
            "~> 4.0"
        ],
        "Decodable": [
            "~> 0.5.0"
        ]
    }
}

Pin It on Pinterest

Share This