Set dictionary element for key


I have a Dictionary and want to set a new value to one of its elements, by key.


// Initialize the Dictionary
var dict = ["name": "John", "surname": "Doe"]
// Set the element with key: 'name' to 'Jane'

dict["name"] = "Jane"


Heard the news?

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