Monthly Archives: July 2017

Create Swift Arrays and Dictionary

Create arrays and dictionaries using brackets ([]), and access their elements by writing the index or key in brackets. A comma is allowed after the last element. var shoppingList = [“bread”, “eggs”, “water”, “jelly”] print(shoppingList[1]) var vehicles = [     “Toyota”: “Cars”,     “Harley”: “Bike”, ] vehicles[“Honda”] = “Coupe” print(vehicles[“Harley”]!) If you have …