Last active
October 30, 2018 18:31
-
-
Save andreaslydemann/6fec4a01045b563d7038acb5f5afcac6 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
let center = NotificationCenter.default | |
center.addObserver(self, | |
selector: #selector(onNotificationReceived(_:)), | |
name: .notificationReceived, | |
object: nil) | |
@objc func onNotificationReceived(_ notification:Notification) { | |
if let data = notification.userInfo as? [String: Int] { | |
// Do something with the data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment