Responding to screen capture in iOS 11.
Q: How can I prevent my application's content from being captured by screen recording, AirPlay, or Screen Mirroring?
A: The iOS 11 SDK introduces new APIs on UIScreen
that applications can use to know when the screen is being captured:
UIScreen.isCaptured Instance Property
When the value of this property is
true
, the contents of this screen are actively being recorded, mirrored, or sent over AirPlay. This property will returntrue
in the following cases:If the screen is being recorded using the Screen Recording Control in the iOS Control Center as discussed in the following support document: How to record the screen on your iPhone, iPad, or iPod touch.
If the screen is being recorded using QuickTime Player over a Lightning cable as discussed in the following support document: How to use QuickTime Player.
If the screen is being displayed using AirPlay or Screen Mirroring as discussed in the following support document: Use AirPlay or Screen Mirroring on your iPhone, iPad, or iPod touch.
If the screen is being cloned to another destination.
UIScreenCapturedDidChange Notification Type Property
UIKit sends the
UIScreenCapturedDidChange
notification when the capture status of the screen changes.The object of the notification is the
UIScreen
object whoseisCaptured
property changed. There is nouserInfo
dictionary.
Your application can then handle this change and prevent your application content from being captured in whatever way is appropriate for your use.
For example, if you are a media application you would observe changes to UIScreen.isCaptured
and if its value is true
you could stop playback and present a useful dialog to the user letting them know that playback was paused due to being captured.
If your application uses FairPlay Streaming (FPS) your video content will automatically not be captured by the iOS 11 screen recording feature or QuickTime Player on macOS. The portion of your application that is playing the content will be blacked out.
To learn more about FairPlay Streaming see the FairPlay Streaming page on the Apple Developer website.
Document Revision History
Date | Notes |
---|---|
2017-10-25 | New document that this document discusses how applications can use new APIs in the iOS 11 SDK to respond to being captured by AirPlay Mirroring and screen recording. |
Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-10-25