From 1e668c8c157806b725d20c1572bc7023bb7b6464 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Mon, 27 Jul 2015 14:27:29 -0400 Subject: [PATCH] - now using ObjectMapper 0.14 - updated documentation - updated tests --- .../AlamofireObjectMapperTests.swift | 12 ++++-------- Cartfile | 2 +- Cartfile.resolved | 2 +- README.md | 16 ++++++---------- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift index ee911a3..2dbdc20 100644 --- a/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift +++ b/AlamofireObjectMapperTests/AlamofireObjectMapperTests.swift @@ -123,10 +123,8 @@ class WeatherResponse: Mappable { var location: String? var threeDayForecast: [Forecast]? - init() {} - - required init?(_ map: Map) { - mapping(map) + class func newInstance() -> Mappable { + return WeatherResponse() } func mapping(map: Map) { @@ -140,10 +138,8 @@ class Forecast: Mappable { var temperature: Int? var conditions: String? - init() {} - - required init?(_ map: Map) { - mapping(map) + class func newInstance() -> Mappable { + return Forecast() } func mapping(map: Map) { diff --git a/Cartfile b/Cartfile index b07bbc0..38e3281 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ github "Alamofire/Alamofire" >= 1.3 -github "Hearst-DD/ObjectMapper" >= 0.10 +github "Hearst-DD/ObjectMapper" >= 0.14 diff --git a/Cartfile.resolved b/Cartfile.resolved index 9de0443..da772af 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ github "Alamofire/Alamofire" "1.3.0" -github "Hearst-DD/ObjectMapper" "0.12" +github "Hearst-DD/ObjectMapper" "0.14" diff --git a/README.md b/README.md index a72c007..65615b1 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,8 @@ class WeatherResponse: Mappable { var location: String? var threeDayForecast: [Forecast]? - init() {} - - required init?(_ map: Map) { - mapping(map) + class func newInstance() -> Mappable { + return WeatherResponse() } func mapping(map: Map) { @@ -70,10 +68,8 @@ class Forecast: Mappable { var temperature: Int? var conditions: String? - init() {} - - required init?(_ map: Map) { - mapping(map) + class func newInstance() -> Mappable { + return Forecast() } func mapping(map: Map) { @@ -148,10 +144,10 @@ Alamofire.request(.GET, URL, parameters: nil) #Installation AlamofireObjectMapper can be added to your project using [Cocoapods](https://cocoapods.org/) by adding the following line to your Podfile: ``` -pod 'AlamofireObjectMapper', '~> 0.6' +pod 'AlamofireObjectMapper', '~> 0.7' ``` If your using [Carthage](https://github.com/Carthage/Carthage) you can add a dependency on AlamofireObjectMapper by adding it to your Cartfile: ``` -github "tristanhimmelman/AlamofireObjectMapper" ~> 0.6 +github "tristanhimmelman/AlamofireObjectMapper" ~> 0.7 ```