There are a few reasons why you would not want your app to run in the background, for example:
- During development it is easier not to run in the background. The default situation is that when you quit an app in the simulator, the app continues running in the background and the debugger also keeps running. Disabling running in the background quits the app immediately and detaches the debugger when you quit the app in the simulator
- If you do special things on startup of your app you might want to disable running in the background.
How do you disable running in the background? That’s possible with a “Custom iOS Target Property”. How to get there?
- Go to the project settings
- Select “Targets”
- Select tab page “Info”
- Click a “+” somewhere in the “Custom iOS Target Properties” list
- Select “Application does not run in the background” from the drop down list
- In the “Value” column select “YES” (See the screenshots below for an example).
If you have done this the app will not continue to run in the background when you quit the app.
“Custom iOS Target Properties” page
Select “YES” in the “Value” column
Thanks! That was very helpful!