I'd like to know if there's a way to determine if the power button was hit to "clos开发者_运维技巧e" the screen on the device.
Is there a way to determine this? I cannot use private api's.
I don't think you can tell if the button is pressed directly without using private APIs, however you might be able to use the applicationWillResignActive:
method of the UIApplicationDelegate
protocol to do what you need to do.
精彩评论