Get array of keys in dictionary


I have a dictionary and want to get an array of all its keys.


// Initialize the Dictionary
let dict = ["name": "John", "surname": "Doe"]
// Get array of keys

var keys = Array(dict.keys)


Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)