How to know whether app is terminated by user or iOS (after 10min background)

If your app is in suspended state the applicationWillTerminate will never get called regardless who killed the app iOS or user.

Your applicationWillTerminate will only call when your app is in background and it gets killed (either by iOS or user) the term background means that it is running in background not in suspended state.

Just read this reference

applicationWillTerminate:—Lets you know that your app is being terminated. This method is not called if your app is suspended.

Here is the table of various states
enter image description here

Background – The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an app being launched directly into the background enters this state instead of the inactive state. For information about how to execute code while in the background, see Background Execution.

Leave a Comment