Skip to content

Instantly share code, notes, and snippets.

@matiasdim
Created December 7, 2020 14:30
Show Gist options
  • Save matiasdim/9c72803880c00ad9b998598270b6f98f to your computer and use it in GitHub Desktop.
Save matiasdim/9c72803880c00ad9b998598270b6f98f to your computer and use it in GitHub Desktop.
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