Daily iOS
App lifecycle and system

Hiding sensitive screens on background

A lending app has to keep account information out of the app switcher snapshot when it goes to the background. Which lifecycle callback do you put the cover screen up in?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Put the cover up in sceneWillResignActive, the moment the app turns Inactive. The app switcher snapshot is taken right after sceneDidEnterBackground returns, so putting it up there is late; add an opaque view over the window with no animation at the Inactive point and the snapshot holds the cover instead of the account information.

Share a question