Created
December 7, 2020 14:30
-
-
Save matiasdim/9c72803880c00ad9b998598270b6f98f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Notifier { | |
private var notificationReceiver: NotificationReceiver | |
init(receiver: NotificationReceiver) { | |
self.notificationReceiver = receiver | |
} | |
func somethingHappened() { | |
notificationReceiver.receiveNotification() | |
} | |
} | |
class NotificationReceiver { | |
func receiveNotification() { | |
// Do something | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment