Created
June 3, 2018 20:04
-
-
Save hvsw/f09510dcf1440509b58b5c82b5276da5 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
// TO BE CONTINUED... | |
extension Notification.Name { | |
func post(to notificationCenter: NotificationCenter = .default, withObject object: Any? = nil) { | |
notificationCenter.post(name: self, object: object) | |
} | |
} | |
extension Notification { | |
struct MyApp { | |
static let myAwesomeNotification = Notification.Name("myAwesomeNotification") | |
} | |
} | |
Notification.MyApp.myAwesomeNotification.post() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment