Created
June 12, 2014 03:09
-
-
Save debreuil/a16d68b58ecf2bc8cf14 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
// How do you get the keys from a dictionary? | |
let array = [1,2,3] | |
let dict = [1: "One", 2: "Two", 3: "Three"] | |
// cast to get the keys in an array | |
var keys = Array(dict.keys) | |
keys == array // comapre arrays with == | |
var values = Array(dict.values) // the same works for values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment