In Chapter 26, I believe the example for accessing a dictionary is wrong:
“// A dictionary that stores (String, Int) pairs, for example a
// list of people’s names and their ages:
var ages: Dictionary<String, Int>// Or, using shorthand notation:
var ages: [String: Int]// Making an instance of the dictionary:
ages = String: Int// Accessing an object from the dictionary:
var age = dict[“Jony Ive”]”Excerpt From: Joey deVilla. “iOS Apprentice.” Apple Books.
To access an object from the dictionary should be: var age = ages[“Jony Ive”]