I need to implement event when i close my app in iOS like following pic.
I want to catch that event when i close app with that minus button.
Which event i need to do?
In fact, when you force an app to close on your iPhone, it will not only slow down your app experience but will also use up more battery life. That's because, once an app is closed completely, it needs to re-launch and reload all of its resources the next time you open the app.
Automatically Close Apps after Non-Usage on Your iPhone On iPhone X, iPhone 11, or an iPad with iOS 12 or later, swipe your finger up while on the Home screen, and hold the screen's middle to dismiss apps you don't use. On an iPhone 8 or earlier, click on the Home button twice to show your most recently used apps.
This delegete will be called when your application is going to terminate.
- (void)applicationWillTerminate:(UIApplication *)app
{
}
If you are using iOS 4 or greater and with multi-tasking support, applicationWillTerminate
will not be called.
For receiving the terminate event you need to add UIApplicationExitsOnSuspend
key on your info.plist
Check this article for a good understanding about application events.
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