You can also just make out
var data = NSData(contentsOfURL: NSURL(string: "http://api.androidhive.info/contacts/")!) var parcedData : NSMutableDictionary = NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.AllowFragments, error: nil) as! NSMutableDictionary print(parceData)
There are many other ways to do this.
You can use Alamofire with SwiftyJSON
Snippet with Alamofire and SwiftyJSON
Alamofire.request(.GET, url, parameters: parameters) .responseJSON { (req, res, json, error) in if(error != nil) { NSLog("Error: \(error)") println(req) println(res) } else { NSLog("Success: \(url)") var json = JSON(json!) } }
source share