iOS Application LifeCycle !!!

IOS-Appilication-Lifecycle

 

  1. App Lifecycle events are available in AppDelegate.m file.
  2. When we launching the application first time, then control will goes “application:didFinishLaunchingWithOption” method.
  3. This method will be called only once when we starts the application.
  4. All application related initilization must be take place within this method only.
  5. The next method is called during the application launch i.e “ApplicationDidBecameActive”(if URL(Uniform Resource Locator)is not present).
  6. This method may be called multiple time.
  7. If the URL is available then control will enter info OpenURL or handleOpenURL method,from here control will goes to “ApplicatonDidBecameActive” method.
  8. After applicationDidBecameActive mode control will goes to applicationWillEnterForeground method for handling UI events.
  9. When user hits Home button or any interruption occures using phone calls or message then controll will goes to applicationWillResignActive method.
  10. In this method only we required to pause application related tasks if anything is in running status.
  11. From resignActiveMethod controll will goes to applicationDidEnterBackground method. this method can hold only for 5seconds so if we required more than this time, then required to handle “beginBackGroundTaskWithExpirationHandler” method.
  12. When the application enter into background if the memory is not available then application terminated by OS.
  13. When we double tap the Home button then application will be relaunched, when we are relaunching the application the controll will enter into foreground method, from there openURL or applicationDidBecameActive method will call.
  14. Whenever the application is terminating then, applicationWillTerminate method will call.
  15. Whenever app having memory related problem then applicationDidReceiveMemoryWarning method will called.
  16. In implementation when we are working with push notification services the we require to handle 1)application:didReceiveRemoteNotification 2)application:didReceiveLocalNotification.