Instance Method

applicationWillEnterForeground(_:)

Tells the delegate that the app is about to enter the foreground.

Declaration

optional func applicationWillEnterForeground(_ application: UIApplication)

Parameters

application

Your singleton app object.

Discussion

In iOS 4.0 and later, this method is called as part of the transition from the background to the active state. You can use this method to undo many of the changes you made to your app upon entering the background. The call to this method is invariably followed by a call to the applicationDidBecomeActive(_:) method, which then moves the app from the inactive to the active state.

The app also posts a UIApplicationWillEnterForeground notification shortly before calling this method to give interested objects a chance to respond to the transition.