Delaying but not disabling iPhone auto-lock

delay, iphone, python-idle, timer

Solution

You could toggle the value of `[UIApplication sharedApplication].idleTimerDisabled` based on the value of your own NSTimer or behavioral gesture (shaking the phone). It can be set to `YES`/`NO` multiple times in your application.

Problem

I currently have a very simple app for which the only interaction is shaking the iPhone. However eventually the screen dims and auto-locks since the iPhone is not getting any touch events. I was wondering if there is a way to reset the auto-lock time-out when shaken? I know that to disable auto-lock completely I would do this: ``` [[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ] ``` but I don't really want to disable it completely; if the iPhone is legitimately not being used it should auto-lock as expected. Thanks for your help.

Original source