Contents

sceneDidEnterBackground(_:)

Tells the delegate that the scene is running in the background and is no longer onscreen.

Declaration

optional func sceneDidEnterBackground(_ scene: UIScene)

Parameters

  • scene:

    The scene that entered the background.

Discussion

To use this method, you must implement the UISceneDelegate protocol and configure scenes for your app (see Specifying the scenes your app supports).

Use this method to reduce your scene’s memory usage, free up any shared resources, and clean up your scene’s user interface. Shortly after this method returns, UIKit takes a snapshot of your scene’s interface for display in the app switcher. Make sure your interface doesn’t contain sensitive user information.

In addition to calling this method, UIKit posts a didEnterBackgroundNotification notification from UIApplication and UIScene.

For more information about what to do when your app enters the background, see Preparing your UI to run in the background.

See Also

Transitioning to the background