Predict the output
The user swipes up to go home while your app is active. Which scene callbacks run, in order?
// SceneDelegate
func sceneWillResignActive(_ scene: UIScene) { print("resign") }
func sceneDidEnterBackground(_ scene: UIScene) { print("background") }
func sceneDidDisconnect(_ scene: UIScene) { print("disconnect") }Hint 1 of 1
Active → ? → background.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A resign, then background
Correct. Active → inactive → background, and later suspended.
Why not the others?
- B background only. The scene becomes inactive first.
- C resign, background, disconnect. Disconnect happens later, if the system releases the scene.
- D disconnect only. Going home doesn't immediately discard the scene.