当前位置 : 主页 > 手机开发 > ios >

ios – 进入Suspended状态后将调用AppDelegate的哪种方法?

来源:互联网 收集:自由互联 发布时间:2021-06-11
我的应用程序进入后台,如果我再次打开,它显示我离开它的同一页面. 虽然,如果iOS将应用程序置于Suspended状态,但它在内存中.如果我回来,将调用哪些AppDelegate方法. 实际上我的目的是将同
我的应用程序进入后台,如果我再次打开,它显示我离开它的同一页面.

虽然,如果iOS将应用程序置于Suspended状态,但它在内存中.如果我回来,将调用哪些AppDelegate方法.

实际上我的目的是将同一屏幕从暂停恢复到应用程序,如果它没有终止.

最后,如果App从SUSPENDED状态返回,将调用Will didFinishLaunchWithOptions.

谢谢..

如 Apple Documentation所述,

  • 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.

所以将调用applicationWillEnterForeground和applicationWillResignActive!

网友评论