Intercept System Events
suggest changeNotificationCenter can observe certain app-wide events. This registration is Swift 3 (NSNotification.Name.UIApplicationDidBecomeActive). ViewController.do(_:) must exist. Observing a notification is not the same as replacing the system’s handling of that event.
NotificationCenter.default.addObserver(
self,
selector: #selector(ViewController.do(_:)),
name: NSNotification.Name.UIApplicationDidBecomeActive,
object: nil)
You can register for many more events. See https://developer.apple.com/reference/foundation/nsnotification.name.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents