let keywords = ["photo","design","icon","book","game"]
let index = Int(rand()) % Int(keywords.endIndex)
let url = "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsSearch"
let param = ["term":keywords[index],"country":"jp","entity":"software"]
let manager = AFHTTPRequestOperationManager()
manager.GET(
url,
parameters: param,
success: { (operation: AFHTTPRequestOperation!,
responseObject: AnyObject!) in
println("JSON: " + responseObject.description)
},
failure: { (operation: AFHTTPRequestOperation!,
error: NSError!) in
println("Error: " + error.localizedDescription)
})
More than 5 years have passed since last update.
SwiftでAFNetworkingを使う
Last updated at Posted at 2014-06-05
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme