Problem Statement
Which pattern allows one object to notify other objects about changes in its state in Swift?
Explanation
The Observer pattern defines a one-to-many dependency so that when one object changes state, its dependents are notified. In Swift this is often implemented via NotificationCenter or Combine’s publishers/subscribers. Knowledge of this pattern is expected in iOS/Swift interviews.
Practice Sets
This question appears in the following practice sets: