I need to detect when my app becomes visible? (for example by double tapping the Home button and then tapping on an app that is already in the background) If possible, I would like to detect that event inside my UIViewController. I am working with Swift 2.2.
You can use the applicationDidBecomeActive(_:)
method of your UIApplicationDelegate
. You should read up on the app lifecycle. Your app delegate would then need to inform your view controller in some fashion.
Or you can register your view controller as an observer of the UIApplicationDidBecomeActive
notification. Documentation for that can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With