tvOS 9 - New OS - Alamofire Example
tvOS 9~ Experiments - External Libraries - AppleTv.
Example
API Source Example
From : iTunes Search API
Requirements
-
= XCode 7.1 beta~.
-
= Swift 2.
-
= tvOS 9.0
Tested on tvOS 9.0 Simulator.
Alamofire - tvOS
- Get library from Alamofire tvOS Branch here Alamofire-tvOS
- Note : at the project writted (2015-10-06), Master branch doesn't work with tvOS.
- Installation used in this sample : Manually Install (installation with Cocoapods or Carthage untested here..)
- Check the documentation and use Alamofire!
App Transport Security Settings
To support HTTP hosted : add the Boolean type Value to YES
for NSAllowsArbitraryLoads
in app's info.plist
file.
Code Example
Response Handling
Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
Usage
To run the example project, download or clone the repo.