Prevent screen capture in an iOS app
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
On iOS, you generally cannot completely prevent a user from taking a screenshot of your app. Apple does not expose a public API that disables screenshots globally for an app the way some other platforms expose secure-window flags.
What you can do is reduce the value of captured content, detect some capture events, and hide or blur sensitive data when screen recording or mirroring is active. That is the realistic security model on iOS.
You Cannot Reliably Block Screenshots
This is the most important fact to get right: there is no public iOS API that says "disable screenshots for this screen."
You can observe that a screenshot happened after the fact, but not block it beforehand.
This is useful for auditing or user messaging, but it does not stop the screenshot itself.
Handle Screen Recording and Mirroring
For live capture scenarios such as screen recording or AirPlay mirroring, iOS gives you a better signal through UIScreen.main.isCaptured and the related notification.
This does not prevent all screen capture forever, but it does let you hide sensitive content during active capture sessions.
Protect Content When the App Goes to Background
Another common leak path is the app switcher snapshot. When the app moves to the background, iOS may create a system snapshot for the multitasking UI. If your screen contains sensitive content, cover it before the app resigns active state.
This protects against snapshot exposure in the app switcher, which is a different concern from button-triggered screenshots.
Design for Damage Reduction
Because you cannot guarantee screenshot prevention, you should also think in terms of reducing exposure:
- mask part of account numbers or personal data
- require re-authentication for especially sensitive screens
- avoid displaying secrets longer than necessary
- watermark sensitive views if audit deterrence matters
That design mindset is often more effective than searching for a nonexistent "disable screenshot" switch.
Common Pitfalls
- Claiming that iOS lets you fully block screenshots with a public API.
- Detecting
userDidTakeScreenshotNotificationand assuming that means the capture was prevented. - Ignoring
UIScreen.main.isCaptured, which is useful for live recording or mirroring cases. - Forgetting to protect app-switcher snapshots when the app resigns active state.
- Relying only on client-side UI protection when the real security need is broader than screen capture alone.
Summary
- iOS does not provide a public API to fully prevent screenshots.
- You can detect screenshots after they happen with
UIApplication.userDidTakeScreenshotNotification. - You can react to active recording or mirroring with
UIScreen.main.isCaptured. - Cover sensitive content when the app goes to the background to protect app-switcher snapshots.
- For real protection, design the UI so captured content is less sensitive in the first place.
Related reading
- Privileged containers and capabilities
- problem path for truststore inside docker with spring boot and kafka
- Problems using Maven and SSL behind proxy
- Proper access policy for Amazon Elastic Search Cluster
- Prevent screen rotation on Android
- Prevent segue in prepareForSegue method?
- Property 'security.basic.enabled' is Deprecated The security auto-configuration is no longer customizable
- Pros and cons of RNGCryptoServiceProvider

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.