I used NSNotification.Name.UIApplicationDidBecomeActive
in many places in my app. but I want to disable all of them in just a ViewController for example named vc
. in vc I called NotificationCenter.default.removeObserver(self)
in viewWillDisappear
method. but when I opened a URL in Safari and use the back-to-app button to come back to my app all the notifications were triggered again.
is there a way to disable all of the notifications in my whole application and enable them again?
Asked
Active
Viewed 316 times
3

tara tandel
- 538
- 5
- 25
-
Grab all notifications which you want to disable using subclassing. Have a look here. This may help https://stackoverflow.com/a/10346882/2545465 – Rajan Maheshwari Apr 08 '18 at 07:10