Objects are often arranged in a network. For example, a person might have a spouse who has a scooter that has a model name (Figure 8.14).
Figure 8.14 Directed graph of objects
To get the selected person’s spouse’s scooter’s model name, you can use a key path:
let modelName = selectedPerson.valueForKeyPath("spouse.scooter.modelName") as String
We would say that spouse and scooter are relationships of the Person class and that modelName is an attribute of the Scooter class.
There are also operators that you ...