How to know whether app is terminated by user or by iOS when restart app>
\'By user\' means \"by Double-clicking Home Button and pressing - button\". killed by user<
iOS might terminate your app if system resources are low - if this happens, you will see applicationWillTerminate
.
It used to be that if a user killed the app (task manager, via the button double-click and then hits the red '-') it's a SIGKILL and applicationWillTerminate is not called. A report mid-2013 suggests this has changed and applicationWillTerminate
now is called.
You could use NSUserDefaults to write some state bit in applicationWillTerminate
to note that this function was called and presumably that's a system kill rather than a user kill.