响应应用程序生命周期事件——IOS

func applicationDidBecomeActive(UIApplication)

该应用程序已激活。

func applicationDidEnterBackground(UIApplication)

该应用程序现在处于后台。

func applicationWillEnterForeground(UIApplication)

该应用程序即将进入前台。

func applicationWillTerminate(UIApplication)

应用程序即将终止。

class let didBecomeActiveNotification: NSNotification.Name

当应用程序激活时发布的通知。

class let didEnterBackgroundNotification: NSNotification.Name

当应用程序进入后台时发布的通知。

class let willEnterForegroundNotification: NSNotification.Name

在应用程序离开后台状态成为活动应用程序前不久发布的通知。

class let willResignActiveNotification: NSNotification.Name

当应用程序不再活跃并失去焦点时发布的通知。

class let willTerminateNotification: NSNotification.Name

当应用程序即将终止时发布的通知。

猜你喜欢

转载自blog.csdn.net/renxi0/article/details/132494594