Detecting iOS screenshots ala Snapchat and Facebook Poke
Branch: master
Clone or download
clayallsopp Merge pull request #3 from neilparikh/patch-1
Fix installation instructions for xcode in readme
Latest commit f8852c9 Mar 11, 2013
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ShotBlocker.xcodeproj handle multiple orientations. Jan 3, 2013
ShotBlocker
ShotBlockerExample first commit Dec 27, 2012
LICENSE first commit Dec 27, 2012
README.md Fix installation instructions for xcode in readme Mar 11, 2013
ShotBlocker.podspec add 0.0.3 podspec Jan 3, 2013

README.md

ShotBlocker

Detecting iOS screenshots ala Snapchat and Facebook Poke.

Current technique is to poll the user's camera roll and check for new screenshot-esque images; if you would like to add another technique, definitely submit a pull-request!

Usage

[[ShotBlocker sharedManager] detectScreenshotWithImageBlock:^(UIImage *screenshot) {
    NSLog(@"Screenshot: %@", screenshot);
}];

// Later on...

[[ShotBlocker sharedManager] stopDetectingScreenshots];

Also available are:

  • detectScreenshotWithBlock:^()
  • detectScreenshotWithBlock:^() andErrorBlock:^(NSError * error){}
  • detectScreenshotWithImageBlock:^(UIImage *screenshot) andErrorBlock:^(NSError * error){}

The NSError will occur if the user denies your app access to their photos.

Installation

CocoaPods

pod 'ShotBlocker'
#import <ShotBlocker/ShotBlocker.h>

Xcode

  1. Add ShotBlocker as a git submodule. Here's how to add it as a submodule:
$ cd rootOfYourGitRepo
$ git submodule add https://github.com/clayallsopp/ShotBlocker.git Vendor/ShotBlocker
$ git submodule update --init --recursive
  1. Add ShotBlocker/ShotBlocker.h and ShotBlocker/ShotBlocker.m to your project, but don't copy the files (so the location is relative).

  2. Add AssetsLibrary.framework to your project

#import "ShotBlocker.h"

Contact

Clay Allsopp @clayallsopp