How do I programmatically lock and unlock the main screen (i.e. the device itself) of an iPhone?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
Describe lock and unlock. I would try a switch that enabled = YES and enabled = NO for the view property. So basically you can disable all the
UIGestureRecognizers
and 'lock' the screen, if this is what you mean. I do it withUIbuttons
once I add them as anIBOutlet
as well asIBAction
, so they are an object and can be modified at the property level. I am working on this very thing right now. I will post my findings.It can be done by caling GSEventLockDevice (); from your app. This function can be found in GraphicsServices.framework.
It's not possible. However, you can "prevent" your phone from locking when your app is running.
[UIApplication sharedApplication].idleTimerDisabled = YES
should do it.I don't believe that there is a way to achieve this.
One thing that i believe is possible is to stop the IPhone from locking. you could then build a view that copied the lock unlock function and you would still have control over the phone.
This has already been resolved . You can find it on Github: https://github.com/neuroo/LockMeNow (work below IOS 7)
If you want to do this so, Apple never approve this, your app must be jailbreak. you can do this by calling Private framework on your project. you can use
GraphicsServices.framework
.NOTE :
This
GraphicsServices.framework
is a private framework. Apple will never accept your app. By callingGSEventLockDevice()
method you can lock or unlock your Device easily. ThisGSEventLockDevice()
resides in theGSEvent.h
.I hope this one helps you.
Please let me know if you still facing any problem