1
在我創建的應用程序中,您不允許截取屏幕截圖。我想知道如何檢測和屏蔽截圖。我發現你可以用ShotBlocker做到這一點,但我不知道如何。有沒有人知道你如何檢測和阻止Objective-C的截圖?Xcode Objective-C ShotBlocker:如何檢測和屏蔽截圖
在我創建的應用程序中,您不允許截取屏幕截圖。我想知道如何檢測和屏蔽截圖。我發現你可以用ShotBlocker做到這一點,但我不知道如何。有沒有人知道你如何檢測和阻止Objective-C的截圖?Xcode Objective-C ShotBlocker:如何檢測和屏蔽截圖
無法阻止iOS屏幕截圖。至少你可以通過這種方式檢測屏幕截圖:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenshotDetected) name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}
- (void)screenshotDetected {
UIAlertView * alert =[[UIAlertView alloc ] initWithTitle:@"Hey!"
message:@"You're not allowed to do that"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles: nil];
[alert addButtonWithTitle:@"GO"];
[alert show];
}