r/iOSProgramming • • Sep 11 '22

Article Observer Pattern: Protocol Oriented Design Pattern

The observer pattern is a behavior design pattern where a type maintains a list of objects, called observers, and notifies them automatically on changes to a particular state. In this post, we will be using Swift’s built in property observers but we will show how to decouple the observer from the property it is observing using protocol-oriented techniques.

https://www.mastering-swift.com/post/observer-pattern-protocol-oriented-design-pattern

1 Upvotes

6 comments sorted by

View all comments

3

u/Fluffy_Risk9955 Sep 12 '22

And this is why we have KVO or Combine.