2

Is there any possible way to make a blur ViewController in iOS when a user tries to take a screenshot?

Or any option that executes a function before the screenshot is saved?

jscs
  • 63,694
  • 13
  • 151
  • 195
pajtimid
  • 518
  • 1
  • 4
  • 13
  • I'm looking for execute function before screenshot is saved. – pajtimid Mar 08 '19 at 15:19
  • And that question and comments answer your question - it is not possible – mag_zbc Mar 08 '19 at 15:20
  • I find paid possibility like https://screenshieldkit.com/, but I'm looking for any open source? – pajtimid Mar 08 '19 at 15:21
  • 2
    https://security.stackexchange.com/questions/177585/how-does-ios-screenshot-prevention-screenshield-by-confide-work-under-the-hood – mag_zbc Mar 08 '19 at 15:30
  • And that doesn't even work anymore: since iOS 7 taking screenshot doesn't cancel touches. – mag_zbc Mar 08 '19 at 15:30
  • 2
    _ScreenShieldKit’s patent-pending technology (...)_ - what exactly do they expect to patent? Using publicly available APIs? That sounds like load of marketing mumbo-jumbo – mag_zbc Mar 08 '19 at 15:32

2 Answers2

1

Not really, but even if there was one, this doesn't prevent users from taking pictures of the screen so it doesn't protect the data all that much.

Adis
  • 4,512
  • 2
  • 33
  • 40
1

What you want cannot be achieved using any public APIs. In older iOS versions it was possible to rely on touching the screen to show sensitive information, but since iOS 7 taking screenshot no longer cancels touches.

Relying on observing NSNotification.Name.UIApplicationUserDidTakeScreenshot notification is also out of the question, since that notification is posted after the screenshot is taken, not before - it follows iOS naming convention with DidTake statement, and there is no WillTake equivalent of this notification.

The solution linked in comment - ScreenShieldKit - also seem to be useless, since this post on Information Security subforum claims it indeed relies on canceling touches which, as mentioned before, no longer works.

At any rate: no, currently there is no known way to prevent screenshots from being taken, using publicly available APIs.

mag_zbc
  • 6,801
  • 14
  • 40
  • 62