Different types of application state in IOS
In iOS development, there are three main types of application state that refer to the state of an app at any given time:
Not running state: When the app is not running, there is no application process in memory, and the app has not been launched by the user.
Active state: This is the state when the app is running in the foreground and is receiving events such as touch and motion events. The app is in the active state until the user presses the home button, locks the screen, or switches to another app.
Background state: When the app is running in the background, it is not receiving any user events, but it can still perform certain tasks such as playing audio, updating location data, or downloading data. The app can remain in the background state for a limited amount of time before it is suspended or terminated by the system.
Additionally, there is a special state known as the Suspended state. In this state, the app is not running, but it remains in memory. The system may purge suspended apps from memory when resources are low, but the app is not terminated completely. When the user launches the app again, it resumes from the suspended state.