How do I programmatically lock and unlock the main screen (i.e. the device itself) of an iPhone?
It's not possible. However, you can "prevent" your phone from locking when your app is running. [UIApplication sharedApplication].idleTimerDisabled = YES should do it.
[UIApplication sharedApplication].idleTimerDisabled = YES
1.4m articles
1.4m replys
5 comments
57.0k users