iOS Questions and Answers

How can you respond to state transitions on your app?

On state transitions can be responded to state changes in an appropriate way by calling corresponding methods on app’s delegate object.

For example:

applicationDidBecomeActive method can be used to prepare to run as the foreground app.

applicationDidEnterBackground method can be used to execute some code when app is running in the background and may be suspended at any time.

applicationWillEnterForeground method can be used to execute some code when your app is moving out of the background

applicationWillTerminate method is called when your app is being terminated.

List down app’s state transitions when it gets launched.

Before the launch of an app, it is said to be in not running state.

When an app is launched, it moves to the active or background state, after transitioning briefly through the inactive state.