Created
June 3, 2014 13:45
-
-
Save jmahmood/f436a6ce293ba25f91c5 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
import Cocoa | |
// Load data from a URL. | |
let url: NSURL = NSURL(string: "http://www.tokyomuslim.com") | |
let resultsData = NSData(contentsOfURL: url, options: NSDataReadingOptions.DataReadingUncached, error: nil) | |
let resultsString:NSString = NSString(data: resultsData, encoding: NSUTF8StringEncoding) | |
// Load JSON data. | |
let jsonUrl: NSURL = NSURL(string: "https://api.github.com/users/mralexgray/repos/") | |
let jsonResultsData = NSData(contentsOfURL: jsonUrl, options: NSDataReadingOptions.DataReadingUncached, error: nil) | |
let jsonResultsString:NSString = NSString(data: jsonResultsData, encoding: NSUTF8StringEncoding) | |
var jsonResultsDict:NSArray = NSJSONSerialization.JSONObjectWithData(jsonResultsData, options: nil, error: nil) as NSArray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment