title: Detect if iPhone screen is on/off
body: <p>Is there any way to detect if an iPhone's screen is on or off?  For example, when the phone's screen lock button is pressed.</p>
  
  <p>I've been using <code>(void)applicationWillResignActive:(UIApplication *)application;</code> to prepare for such events (which works fine for the most part), but this method is also fired for incoming calls, texts, etc.</p>
  
  <p>As far as I can tell, there is no documented method to determine this.</p>
  
  <p>I've been playing with some workarounds, like checking if screen resolution changed, checking if the orientation is unknown, or getting the brightness of the device.  Nothing has panned out yet.</p>
  
  <p>Does anyone have any creative/workaround solutions for this?</p>