MVC Communication Methods
- Outlets – target action
- Delegates – should, will, did
- Data Source – data at, count
- Notification & KVO (Key Value Observing)
The Card struct is UI independent. It’s tempting to allow the Card to also store the emoji symbol. However the emoji symbol is a view element. Therefore it should not be allowed in Card.
Classes get free initializers as long as all their instance variables are initialized.
Struct also get free initializer allowing all its instance variables to be initialized.
Lazy vars cannot have property observers (didSet).
State of the App after Implementing the Code from Lecture 2
The source code of the app Concentration is available here: