iOS SDK: Is there a way to recognize when a user double taps the home button and when he locks the screen
Is there a way to make a difference between the user tapping the home button twice and the user locking the screen? I know that in both cases the app delegate's method ap开发者_运维百科plicationWillResignActive: is called, but I'd like to able to tell exactly which event has happened. Any method to do that? Thank you!
From looking at UIApplicationDelegate Protocol Reference:
applicationWillResignActive:
// Then when its back, this gets called:
applicationDidBecomeActive:
are the only methods that gets called in this situation. So unfortunately, the answer is no, there is no way to tell the difference between locking the device, and double clicking the home button.
Doesn't appear to be a way in a app store app. You can probably do this with private methods.
I attempted to observe these changes, but the home store double press doesn't modify your frame or window data (like say the phone call status does). So you wouldn't be able to tell when you have been moved up to show the home button bar thru observation.
精彩评论