Guest User

Untitled

a guest
Oct 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. override func viewDidAppear(_ animated: Bool) {
  2. super.viewDidAppear(animated)
  3.  
  4. NotificationCenter.default.addObserver(forName:Notification.Name(rawValue: kCustomNotification), object:nil, queue:nil) { notification in
  5. // my code
  6. }
  7. }
  8.  
  9. override func viewDidDisappear(_ animated: Bool) {
  10. super.viewDidDisappear(animated)
  11. NotificationCenter.default.removeObserver(kCustomNotification)
  12. NotificationCenter.default.removeObserver(self)
  13. }
Add Comment
Please, Sign In to add comment