Created
January 20, 2017 03:21
-
-
Save castillejoale/bc53a5f4189d65d0bb8dca29281e6fa6 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 | |
//JSON String -> Dictionary | |
let jsonText = "{\"anotherKey\":\"anotherValue\",\"aKey\":\"aValue\"}" | |
var dictonary:NSDictionary? | |
if let data = jsonText.dataUsingEncoding(NSUTF8StringEncoding) { | |
do { | |
dictonary = try NSJSONSerialization.JSONObjectWithData(data, options: []) as? [String:AnyObject] | |
} catch let error as NSError { | |
print(error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment