8

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.

Community
  • 1
  • 1
Bhavin
  • 27,155
  • 11
  • 55
  • 94

2 Answers2

1

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

0

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.

Bhanu
  • 1,249
  • 10
  • 17
  • 1
    @JmB I'm assuming the suggestions come from a radio button list of pre-fab responses, so they may not be a perfect fit. Stackoverflow isn't flawless by any means, but hang with us, man! – MrBoJangles Apr 09 '14 at 14:40
  • MrBoJangles, at the risk of an instant edit, muchas gracias! First positive experience on this site. Oh.....UIGesture Enabled BOOL = YES; I had to add some kind of code gibberish. ;o) –  Apr 09 '14 at 17:18