Created
August 17, 2016 07:44
-
-
Save macbaszii/93a3c273890e2bd8221954feac64211b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let URL = "https://raw.githubusercontent.com/tristanhimmelman/AlamofireObjectMapper/2ee8f34d21e8febfdefb2b3a403f18a43818d70a/sample_keypath_json" | |
let expectation = expectationWithDescription("\(URL)") | |
Alamofire.request(.GET, URL).responseObject(keyPath: "data") { (response: Response<WeatherResponse, NSError>) in | |
expectation.fulfill() | |
let weatherResponse = response.result.value | |
print(weatherResponse?.location) | |
if let threeDayForecast = weatherResponse?.threeDayForecast { | |
for forecast in threeDayForecast { | |
print(forecast.day) | |
print(forecast.temperature) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment