Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
/ UnboxedAlamofire Public archive

[Deprecated] Alamofire + Unbox: the easiest way to download and decode JSON into swift objects.

License

Notifications You must be signed in to change notification settings

serejahh/UnboxedAlamofire

 
 

Repository files navigation

UnboxedAlamofire

Build Status CocoaPods Compatible Carthage Compatible Platform

Alamofire + Unbox: the easiest way to download and decode JSON into swift objects.

Features

  • Unit tested
  • Fully documented
  • Mapping response to objects
  • Mapping response to array of objects
  • Keypaths
  • Nested keypaths

Usage

Objects you request have to conform Unboxable protocol.

Get an object

Alamofire.request(.GET, url).responseObject { (response: Response<Candy, NSError>) in
	let candy = response.result.value
}

Get an array

Alamofire.request(.GET, url).responseArray { (response: Response<[Candy], NSError>) in
	let candies = response.result.value
}

KeyPath

Also you can specify a keypath in both requests:

Alamofire.request(.GET, url).responseObject(keyPath: "response") { (response: Response<Candy, NSError>) in
	let candy = response.result.value
}

Installation

pod 'UnboxedAlamofire', '~> 1.0'
github "serejahh/UnboxedAlamofire" ~> 1.0