Last active
August 29, 2015 14:02
-
-
Save amolloy/592a7ae4eb8a8de4bf20 to your computer and use it in GitHub Desktop.
NSString* theId = jsonDict[@“response”][@“id”];, in Swift
This file contains 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
let info : Dictionary<String, AnyObject!> = ... | |
var theId : String? | |
let reponseObj = info["response"] | |
if let response = reponseObj as? Dictionary<String, AnyObject!> | |
{ | |
let idObj = response["id"] | |
if let id = idObj as? String | |
{ | |
theId = id | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment