Created
October 7, 2020 10:59
-
-
Save christiancabarrocas/f49e4f3b256ac6a381495bdadb1e20b3 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
extension NotificationCenter { | |
class func add(_ notification: Notification, observer: Any) { | |
let selector = Selector(notification.name.rawValue) | |
NotificationCenter.default.addObserver(observer, selector: selector, name: notification.name, object: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment