Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func viewDidAppear(_ animated: Bool) {
- super.viewDidAppear(animated)
- NotificationCenter.default.addObserver(forName:Notification.Name(rawValue: kCustomNotification), object:nil, queue:nil) { notification in
- // my code
- }
- }
- override func viewDidDisappear(_ animated: Bool) {
- super.viewDidDisappear(animated)
- NotificationCenter.default.removeObserver(kCustomNotification)
- NotificationCenter.default.removeObserver(self)
- }
Add Comment
Please, Sign In to add comment