Swift is very strict about types
let jsonObject : AnyObject! = NSJSONSerialization.JSONObjectWithData(dataFromTwitter, options: NSJSONReadingOptions.MutableContainers, error: nil) | |
if let statusesArray = jsonObject as? NSArray{ | |
if let aStatus = statusesArray[0] as? NSDictionary{ | |
if let user = aStatus["user"] as? NSDictionary{ | |
if let userName = user["name"] as? NSDictionary{ | |
//Finally We Got The Name | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment