title: iOS Today Widget Extension - detect if screen is locked
body: <p>I have a today extension that displays a timer.  I want to pause the timer when the screen is locked, but can't figure out how to detect if the screen is locked.</p>
  
  <p>I tried doing this but the file is always readable even when the screen is locked:
  <a href="https://stackoverflow.com/questions/27933666/finding-out-if-the-device-is-locked-from-a-notification-widget">Finding out if the device is locked, from a Notification Widget</a></p>
  
  <p>I was able to do this in my app using this but am unable to implement it in a widget:
  <a href="https://stackoverflow.com/questions/7888490/how-can-i-detect-screen-lock-unlock-events-on-the-iphone">How can I detect screen lock/unlock events on the iPhone?</a></p>