Skip to content

Instantly share code, notes, and snippets.

@antranapp
Last active March 31, 2020 11:02
Show Gist options
  • Save antranapp/cbb6a97ced6b7f487ccf to your computer and use it in GitHub Desktop.
Save antranapp/cbb6a97ced6b7f487ccf to your computer and use it in GitHub Desktop.
[iOS] Send notification from appdelegate to view controller
// App Delegate
NSNotificationCenter.defaultCenter().postNotificationName("EventNotification", object: nil, userInfo: ["data": "dummy"])
// View Controller
NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleEventNotification", name: "EventNotification", object: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment