测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布时间最后发布 | 2014年12月 |
由Clay Allsopp、Clay Allsopp 维护。
检测 iOS 截图,类似于 Snapchat 和 Facebook Poke。
当前技术是轮询用户的相册并检查类似截图的新图片;如果您想添加其他技术,请务必提交 pull-request!
[[ShotBlocker sharedManager] detectScreenshotWithImageBlock:^(UIImage *screenshot) {
NSLog(@"Screenshot: %@", screenshot);
}];
// Later on...
[[ShotBlocker sharedManager] stopDetectingScreenshots];
以下同样可用:
detectScreenshotWithBlock:^()
detectScreenshotWithBlock:^() 和ErrorBlock:^(NSError * error){}
detectScreenshotWithImageBlock:^(UIImage *screenshot) 和ErrorBlock:^(NSError * error){}
如果用户拒绝您的应用程序访问相册,会引发 NSError
。
将 ShotBlocker 添加为 git submodule。以下是如何添加为 submodules 的步骤
$ cd rootOfYourGitRepo $ git submodule add https://github.com/clayallsopp/ShotBlocker.git Vendor/ShotBlocker $ git submodule update --init --recursive
将 ShotBlocker/ShotBlocker.h
和 ShotBlocker/ShotBlocker.m
添加到您的项目中,但不要复制文件(因此位置是相对的)。
将 AssetsLibrary.framework
添加到您的项目中
#import "ShotBlocker.h"