Of course, you can invoke the NSJSONSerialization.dataWithJSONObject
method from Swift, too, which returns an NSData
object that you can then convert to a string.
Here's a simple example:
var error: NSError? var data: NSJSONSerialization.dataWithJSONObject( dictionary, options: NSJSONWritingOptions(0), error: &error); var json: NSString(data: data, encoding: NSUTF8StringEncoding);