Skip to content

Instantly share code, notes, and snippets.

@bgayman
Created March 27, 2016 02:55
Show Gist options
  • Save bgayman/d1221fe5fbe634d7d5a1 to your computer and use it in GitHub Desktop.
Save bgayman/d1221fe5fbe634d7d5a1 to your computer and use it in GitHub Desktop.
let objects:Array<Dictionary<String, AnyObject>> = [["id": NSNull(), "born": 1964, "name": "Keanu Reeves"], ["id": NSNull(), "born": 1967, "name": "Carrie-Anne Moss"], ["id": NSNull(), "born": 1961, "name": "Laurence Fishburne"], ["id": NSNull(), "born": 1960, "name": "Hugo Weaving"], ["id": NSNull(), "born": 1967, "name": "Andy Wachowski"], ["id": NSNull(), "born": 1965, "name": "Lana Wachowski"], ["id": NSNull(), "born": 1952, "name": "Joel Silver"], ["id": NSNull(), "born": NSNull(), "name": "Ann"], ["id": NSNull(), "born": NSNull(), "name": "Dan"]]
let object = objects[1]
print("Object is: \(objects)")
print("Hello")
print(object["name"]?.classForCoder)
let text = object["name"] as! String
print(object["born"]?.classForCoder)
let text2 = object["born"] as! Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment