title: Detect the iOS device entering sleep mode
body: <p>Let's assume I have an app that has the idle timer disabled and will continue to run when the application state is not active (in background while using other apps or in lock screen, think audio playback) but it should stop when the device enters sleep mode (i.e. the screen goes black).</p>
  
  <p>Is there a way to detect that event and stop the app's processes?</p>
  
  <p>Since it would be an app utilising the audio playback required background mode it would continue otherwise.</p>