Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vanessaaleung/b102fc8076dc6e35639c9d2947842b36 to your computer and use it in GitHub Desktop.
Save vanessaaleung/b102fc8076dc6e35639c9d2947842b36 to your computer and use it in GitHub Desktop.
NotificationCenter.default.addObserver
override func viewDidLoad() {
super.viewDidLoad()
//if receive notification "NotificationName", execute func `isDataGet`
NotificationCenter.default.addObserver(self, selector: #selector(isDataGet(_:)),
name: NSNotification.Name("NotificationName") , object: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment