Appdelegate Handling life cycle events for iOS apps

Source: Internet
Author: User

This method is called when the application is started

-(BOOL) Application: (uiapplication*) Application didfinishlaunchingwithoptions: (nsdictionary*) launchOptions{
}

-(void) Applicationwillresignactive: (uiappliction*) application{

This method is called when an application moves from an active state to an inactive state.

Typically, when an application is suddenly interrupted (such as a phone call). When the message comes in), the system will callback the method.

In addition, when the user leaves the program, the program starts to turn back and the method is also called
}

-(void) Applicationdidenterbackground: (uiapplication*) application{

You can usually override this method to free up shared resources, save user data, and cancel timers.

Developers can also use this method to save enough state data so that users can revert to their current state when they restart the app

If the application supports background execution, the method calls instead of application termination when the user exits

}

-(void) Appliactionwillenterforeground: (uiapplication*) application{

This method will be called when the application is about to enter the foreground

}

-(void) Applicationdidbecomeactive: (uiapplication *) Application {

This method is called when the application enters the foreground and moves to the active state

}

-(void) Applicationwillterminate: (uiapplication *) Application {

The system will call this method when the program is terminated.

}

Appdelegate Handling life cycle events for iOS apps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.