Skip to content

Instantly share code, notes, and snippets.

@DonMag
Created April 19, 2017 19:37
Show Gist options
  • Select an option

  • Save DonMag/1f0ebbd0824337a1408fb265c9e16c48 to your computer and use it in GitHub Desktop.

Select an option

Save DonMag/1f0ebbd0824337a1408fb265c9e16c48 to your computer and use it in GitHub Desktop.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
NotificationCenter.default.addObserver(self, selector: #selector(self.showNotifs(_:)), name: nil, object: nil)
return true
}
func showNotifs(_ notification: Notification) {
print("\n---------------------\nNotification received [", notification.name, "]\n", notification.userInfo?.description ?? "no desc", "\n---------------------")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment