zaxy78
zaxy78

Reputation: 1426

iOS: Making an App terminate when leave screen

I've build a simple app activating something in hardware, not important.

Now I just want the app to terminate completely if the user leaves the screen, switches apps, gets a call, press the home button, etc.

I'm all mixed up by all the application states, I couldn't find the right place to handle it. I guess I need to listen to an "going to sleep" event and put a termination command (exit!) or something like that.

Upvotes: 2

Views: 336

Answers (1)

sergio
sergio

Reputation: 69047

This is easier than what one might think.

In your app's plist file define (check) the option "Application does not run in background" (UIApplicationExitsOnSuspend), and you are done.

enter image description here

Upvotes: 11

Related Questions