The same
NSJSONSerialization
class is available in Swift, Apple's new language for iOS development.
Here's an example of how to invoke the JSONObjectWithData
method of NSJSONSerialization
in Swift:
import Foundation var error: NSError? Let json: NSData = /* the JSON to parse */ let data = NSJSONSerialization.JSONObjectWithData(json, options: nil, error: &error);