How to detect if user did a screenshot with home+power in iOS?

3 Solutions Collect From Internet About “How to detect if user did a screenshot with home+power in iOS?”

It is not possible to detect a screenshot has (or will) be taken on iOS 5.

In iOS 4.0, there was a Darwin notification fired PictureWasTakenNotification, but not anymore.

The documentation does not mention anything, and using NSNotificationCenter to subscribe to all notifications only shows silence after taking a screenshot.

before ios 4.0 you can register for PictureWasTakenNotification .This notification is sent when screenshot is taken.No notifications will be sent before the screenshot was taken.
But after that this has been discontinued and IMHO there is no other way round… :/

you can detect it with adding an observer to UIApplicationUserDidTakeScreenshotNotification .

NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification
              object:nil
               queue:mainQueue
          usingBlock:^(NSNotification *note) {
             // executes after screenshot
}];