Screenshot restriction in iOS Native

i have a requirement where we need to restrict the user in taking the screen shot. as of now iam using this code  NotificationCenter.default.addObserver(self, selector: #selector(didDetectScreenshot), name: UIApplication.userDidTakeScreenshotNotification, object: nil)

This is triggered after taking the screenshot.

Is there any possibility to completely restrict in taking the screenshot.

AFAIK, there is no direct way to do it. And even if you did it, user could still take a photo with another camera. So, what's the exact goal ?

Some solutions require to work at the image level, doing some frame interleaving, pretty complex.

You could try to show hide overlay at a very rapid pace, which could blur the screenshot.

Have a look at this thread:

https://developer.apple.com/forums/thread/123725

You have also probably seen this:

https://betterprogramming.pub/how-to-prevent-screen-capture-at-ios-14-1f01173c31c0

But it just warns users, do not prevent screenshots.

Screenshot restriction in iOS Native
 
 
Q