Instance Method

sceneWillEnterForeground(_:)

Tells the delegate that the scene is about to begin running in the foreground and become visible to the user.

Declaration

optional func sceneWillEnterForeground(_ scene: UIScene)

Parameters

scene

The scene that is about to enter the foreground.

Discussion

UIKit calls this method before moving a scene to the foreground. This transition occurs both for newly created and connected scenes and for scenes that were running in the background and were brought to the foreground by the system or a user action. A scene enters the foreground as a precursor to becoming visible onscreen, so this method is invariably followed by a call to the sceneDidBecomeActive(_:) method.

In addition to calling this method, UIKit also posts a didEnterBackgroundNotification notification.

See Also

Transitioning to the Foreground

func sceneDidBecomeActive(UIScene)

Tells the delegate that the scene became active and is now responding to user events.