I am building an iOS app right now and I wanna ask how to make it relaunch every time after user goes back to the home screen. For example, you open an app, do whatever you need to do in the app and then you exit to the home screen, now you want to reopen this app, and the question is when you reopen it, how to make it forget what it was doing and start a new session? Thanks :)
Asked
Active
Viewed 824 times
1
-
Take a look at "Execution States for App" in this document. It shows you the life cycle of application and the call-backs that called when application goes to background or to foreground, etc. https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html – Duyen-Hoa Jun 17 '16 at 13:47
1 Answers
5
You can set UIApplicationExitsOnSuspend
to YES
in your plist file. As per documentation
UIApplicationExitsOnSuspend (Boolean - iOS) Specifies that the app should be terminated rather than moved to the background when it is quit. Apps linked against iOS SDK 4.0 or later can include this key and set its value to YES to prevent being automatically opted-in to background execution and app suspension. When the value of this key is YES, the app is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO, the app moves to the background as usual.
It will make sure whenever app goes in background it is terminated.

Vishnu gondlekar
- 3,896
- 21
- 35