Open Source iOS Library For Detecting When A User Is Taking A Screenshot

There are a number of apps that detect whether or not the user has taken a screenshot such as Snapchat and the Facebook app.

There have also been a few ideas on exactly how to do perform this detection.

Here’s library from Clay Allsop called ShotBlocker uses a simple technique to detect if the user has taken a screenshot by polling the camera roll based on a timer and checking if a new image has been added that matches the size of the user’s screen.

The library executes a callback block when a new screenshot is detected.

You can find ShotBlocker with usage instructions on Github here.

A simple solution to this problem. Chpwn has written on his blog about how taking screenshots cancels all screen touches so possibly using UILongPressGestureRecognizer and looking for the state to be UIGestureRecognizerStateCancelled rather than polling based on a timer could be a better approach.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: Open Source iOS Library For Detecting When A User Is Taking A Screenshot

©2012 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *