How to prevent screenshots and screen recording in an iOS app
Codemia Knowledge Hub ·
You cannot fully prevent screenshots of an iOS app. Apple exposes no public API that disables screenshots for an app, unlike the secure-window flags on some other platforms. What you can do is detect some capture events, hide or blur sensitive data while the screen is being recorded or mirrored, and reduce the value of anything that does get captured.
Detecting a screenshot after it happens
You can observe that a screenshot was taken, but not block it beforehand:
This is useful for auditing or showing the user a message. Receiving the notification does not mean the capture was prevented.
Hiding content during screen recording and mirroring
For live capture such as screen recording or AirPlay mirroring, UIScreen.main.isCaptured and its change notification give a better signal:
This does not stop every form of capture, but it hides sensitive content during active capture sessions.
Covering the app switcher snapshot
When the app moves to the background, iOS may take a snapshot for the multitasking UI. If the screen shows sensitive content, cover it before the app resigns active:
This is a separate leak path from user-triggered screenshots and needs its own protection.
Reducing what a capture exposes
Since you cannot guarantee prevention, limit the damage:
- 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
This is usually more effective than searching for a "disable screenshot" switch that does not exist. And if the real security need is broader than screen capture, client-side UI protection alone is not enough.
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 interview problems on this topic
- Design a Secure Identity Management System: solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough
- Design a Network Security Monitoring Tool: solution and walkthrough
- Design a CAPTCHA System: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.