Controlling the screenshot in the iOS 7 multitasking switcher
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The release of iOS 7 brought a significant design overhaul to Apple's operating system. A notable feature introduced was the revamped multitasking switcher, which offered a more visually intuitive method for users to navigate between applications. A key aspect of this multitasking interface is the use of application screenshots to provide users with a quick visual cue of their recently used apps. Understanding how to control these screenshots within the multitasking switcher allows developers to enhance user experience, protect sensitive information, and ensure the seamless operation of their applications.
Technical Overview
How Multitasking Screenshots Work
When a user invokes the multitasking switcher by double-clicking the home button (or swiping up on later models without a home button), a horizontally scrollable list of application cards is displayed. Each card contains an app icon and a live screenshot of the app's last state. These screenshots are automatically generated by the system when an app transitions to the background and retained until the app is terminated or brought back to the foreground.
Default Behavior
By default, iOS captures a screenshot of the app's current state just before it moves to a background state. The screenshot is then displayed in the multitasking switcher, allowing users to quickly recognize and switch back to the desired app. However, in situations where the app contains sensitive information, this default behavior may not be desirable.
Controlling Screenshot Capture
To control the capture of screenshots, developers can implement strategies in the app's lifecycle methods. The primary method of interest is applicationDidEnterBackground
, which is a part of the UIApplicationDelegate
protocol.
Solution: Obscuring the App's View
One approach to preventing sensitive data from appearing in screenshots is to obscure the app's UI just before it transitions to the background. Here is an example of how to implement this in Swift:

