Google News
logo
IOS - Interview Questions
What are the different iOS app lifecycle methods?
There are the following iOS app lifecycle methods which are called when the app transitions from one state to another.
 
application: didFinishLaunchingWithOptions:-> Bool: when the application is launched initially, this method is called. We can do any initial setup for the application in this method like firebase configuration, user navigation, etc. The storyboard is loaded at this point, but we can maintain the state restoration.

applicationWillEnterForeground : this method is called after didFinishLaunchingWithOptions. It is also called when the application comes from background to foreground.

applicationDidBecomeActive : this method is called after applicationWillEnterForeground. If we need to perform any particular task when the app comes into the foreground, like font update, etc., then we can place the code in this method.

applicationWillResignActive : this method is notified when the application is about to become inactive. For example, the user receives a phone call; the user presses the home button, etc.).

applicationDidEnterBackground : this method is notified when the application goes into a background state after become inactive.

applicationWillTerminate : this method is called when the application is about to be finally terminated from memory. If we need to perform any final cleanups, then we can place the code in this method.
Advertisement