<p>Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.</p>

<p>There's this somewhat-related method in UIApplication:</p>

<pre><code>[UIApplication sharedApplication].idleTimerDisabled;
</code></pre>

<p>It'd be nice if you instead had something like this:</p>

<pre><code>NSTimeInterval timeElapsed = [UIApplication sharedApplication].idleTimeElapsed;
</code></pre>

<p>Then I could set up a timer and periodically check this value, and take some action when it exceeds a threshold.</p>

<p>Hopefully that explains what I'm looking for. Has anyone tackled this issue already, or have any thoughts on how you would do it? Thanks.</p>

Ultimately you need to define what you consider to be idle - is idle the result of the user not touching the screen or is it the state of the system if no computing resources are being used? It is possible, in many applications, for the user to be doing something even if not actively interacting with the device through the touch screen.  While the user is probably familiar with the concept of the device going to sleep and the notice that it will happen via screen dimming, it is not necessarily the case that they'll expect something to happen if they are idle - you need to be careful about what you would do.  But going back to the original statement - if you consider the 1st case to be your definition, there is no really easy way to do this. You'd need to receive each touch event, passing it along on the responder chain as needed while noting the time it was received. That will give you some basis for making the idle calculation.  If you consider the second case to be your definition, you can play with an NSPostWhenIdle notification to try and perform your logic at that time.