Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Event When i close app in iOS?

I need to implement event when i close my app in iOS like following pic.

enter image description here

I want to catch that event when i close app with that minus button.

Which event i need to do?

like image 250
Fire Fist Avatar asked Jan 12 '13 09:01

Fire Fist


People also ask

What happens when you close an app on iPhone?

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.

Does iOS close apps automatically?

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.


1 Answers

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.

Without mutitasking

With mutitasking

like image 53
Midhun MP Avatar answered Sep 21 '22 08:09

Midhun MP