Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What method of AppDelegate will be called after entering into Suspended state?

My App goes in background, If I open again, It shows same page where I left it.

While, If iOS puts app into Suspended state, yet it is in memory. If I come back, which AppDelegate methods will be called.

Actually my purpose is to restore same screen from suspended to app, if it is not TERMINATED.

Last thing, Will didFinishLaunchWithOptions will be called if App is returning from SUSPENDED state.?

Thanks..

like image 608
Sam Shaikh Avatar asked Nov 24 '16 07:11

Sam Shaikh


People also ask

What is Appdelegate and methods in Swift?

The app delegate is effectively the root object of your app, and it works in conjunction with UIApplication to manage some interactions with the system. Like the UIApplication object, UIKit creates your app delegate object early in your app's launch cycle so it's always present.

When Applicationwillenterforeground is called?

applicationWillResignActive is called when system is asking for permissions. (in iOS 10).

What is suspended state in iOS?

Active - the normal state of "in use" for an app. Background - the app is no longer on-screen but is still executing code. Suspended - the app is still resident in memory but is not executing code.


1 Answers

As Apple Documentation states,

  • application:willFinishLaunchingWithOptions:—This method is your app’s first chance to execute code at launch time.

  • application:didFinishLaunchingWithOptions:—This method allows you to perform any final initialization before your app is displayed to the user.

  • applicationDidBecomeActive:—Lets your app know that it is about to become the foreground app. Use this method for any last minute
    preparation.

  • applicationWillResignActive:—Lets you know that your app is transitioning away from being the foreground app. Use this method to
    put your app into a quiescent state.

  • applicationDidEnterBackground:—Lets you know that your app is now running in the background and may be suspended at any time.

  • applicationWillEnterForeground:—Lets you know that your app is moving out of the background and back into the foreground, but that it is not yet active.

  • applicationWillTerminate:—Lets you know that your app is being terminated. This method is not called if your app is suspended.

so applicationWillEnterForeground and applicationWillResignActive will be get called!

like image 138
Ketan Parmar Avatar answered Sep 28 '22 14:09

Ketan Parmar