Reputation: 11005
I can detect Lock screen mode in my App like that:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplicationState state = [application applicationState];
switch (state) {
case UIApplicationStateInactive:
NSLog(@"LockScreen");
[self.viewController addGestureRecognizersToView:self.viewController.view];
break;
case UIApplicationStateBackground:
NSLog(@"Background");
break;
default:
break;
}
}
I want to continue recognizing gestures(tap,longPress...) but don't need to slide to unlock. Is it possible? Which option to control it?
Upvotes: 0
Views: 203
Reputation: 9101
It's impossible. If the device is locked. App can almost do nothing for the event handling(except for the remote control event). Because the device will not handle these events. And this is indeed the correct case. If the device still handling the events it will cost a lot of battery energy.
Upvotes: 1
Reputation:
No, it's not possible. Your application does not receive gesture input while it is not visible (for instance, when the lock screen is up).
Upvotes: 2