Bhavin
Bhavin

Reputation: 27225

Programmatically lock iPhone screen in iOS 7

I know that we can call GSEventLockDevice (); from the GraphicsServices.framework to lock the screen in iOS 6 and older version, as explained by H2CO3 Here. But unfortunately it's not working in iOS 7.

My Question : How to lock the iPhone Screen programmatically in iOS 7 ?

Note : I don't want this for Appstore.

Upvotes: 8

Views: 3438

Answers (2)

user2882399
user2882399

Reputation:

Cant you disable all the UIGestureRecognizers for the view? I do it for buttons all the time. It is the 'enabled' property for UIButtons. Im sure you can use something like this to achieve satisfactory results. For the view I think it is userInteractionEnabled property for views. Set your view userInteractionEnabled property to NO with a UISwitch.

Upvotes: 0

user2868472
user2868472

Reputation: 21

Hi it's not possible in iOS7. You need special entitlement so until there will be a jailbreak you are out of luck

Upvotes: 1

Related Questions