Created
January 20, 2017 03:20
-
-
Save castillejoale/659b70fba2ee52857653042a2d676a51 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 UIKit | |
import AVFoundation | |
//Dictionary -> JSON String | |
let dictionary = ["aKey": "aValue", "anotherKey": "anotherValue"] | |
var theJSONText:String? | |
do { | |
let theJSONData = try NSJSONSerialization.dataWithJSONObject(dictionary , options: NSJSONWritingOptions(rawValue: 0)) | |
theJSONText = String(data: theJSONData, | |
encoding: NSASCIIStringEncoding) | |
} catch let error as NSError { | |
print(error.localizedDescription) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment