iOS App wide operations Intercept System Events

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Using the NotificationCenter of iOS, which can be very powerful, you are able to intercept certain app-wide events:

NotificationCenter.default.addObserver(
        self,
        selector: #selector(ViewController.do(_:)),
        name: NSNotification.Name.UIApplicationDidBecomeActive,
        object: nil)

You can register for a lot of more events, just take a look at https://developer.apple.com/reference/foundation/nsnotification.name.



Got any iOS Question?