We have covered three different techniques to implement the observer pattern in this section. Each technique comes with its set of constraints and advantages.
- NotificationCenter, which can become resource-intensive
- KVO observation, which requires deep integration with Objective-C
- Pure Swift setters, which restrict the number of observers to one
In practice, you'll find yourself using all three techniques over time, as they are core to Swift and Foundation-based programming in general.