Have you heard of Observer Pattern in iOS. Today, we will learn Observer Pattern in iOS swift 4 as we are going to learn about NotificationCenter in IOS. NotificationCenter works on Observer Pattern
The Observer pattern allows objects to subscribe to other objects known as a Subject. When the Subject is updated, all of the objects who have subscribed to the Subject will be notified about the update. It is used when there is a one to many relationship between objects and is opposite to delegate pattern where we have one to one relationship.
Source code: https://goo.gl/AKwf1S