Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let myMoment = <Authorized Moment from above>
- // Access the data of a Website Moment
- let urlString = "\(myMoment.launchURL)/WebsiteBits?alllocales=true"
- let momentRequest = NSMutableURLRequest(URL: NSURL(string: urlString)!)
- // You can use NSURLSession and dataTaskWithRequest(...), but we strongly encourage you to adopt the Requestable paradigm as discussed in "Getting Started -> Fundamentals"
- let task = NSURLSession.sharedSession().dataTaskWithRequest(momentRequest) { (data, response, error) in
- guard let data = data else {
- return // No data available!
- }
- // success - deserialize JSON
- }
- task.resume()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement