Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quit app when pressing home

I my testing, when I exit (by pressing the home button) my app, it still is "running" in the background, thanks to the multitasking feature. However, I would like it to quit when the home button is pressed. Is this only happening to me?

Anyway, I have tracked it down to the applicationWillResignActive and the applicationDidBecomeActive methods in the app delegate. These get called for multitasking, but when I want to terminate, the app "resigns active." Any guidance on this issue is greatly appreciated!

like image 801
pop850 Avatar asked Nov 30 '22 18:11

pop850


1 Answers

Your application can opt out of multitasking (see the appropriate section in the iPhone Application Programming Guide) by adding the UIApplicationExitsOnSuspend key to your Info.plist and setting its value to YES.

In practice, Apple strongly recommends you not do this unless you have a very good reason for this behavior.

like image 86
Brad Larson Avatar answered Dec 20 '22 06:12

Brad Larson