Add Item to a Dictionary in Swift

// Create a Dictionary with two elements
var myDictionary = ["first_name": "Sergey", "last_name": "Kargopolov"]

// print to preview
print(myDictionary)

// Add a new key with a value
myDictionary["user_id"] = "f5h7ru0tJurY8f7g5s6fd"

// We should now have 3 key value pairs printed
print(myDictionary)

[raw_html_snippet id=”cookbookpagecoursesheader”]

Unit Testing Swift Mobile App

Apply Test-Driven Development(TDD) process to iOS mobile app development in Swift Preview this video course.