title: Unlock iphone and run app triggered by the starting and stopping of charging
body: <p>This is a bit of an odd one. </p>
  
  <p>I am very new to iPhone programming and more interested in how doable/possible this is. </p>
  
  <p>What I want is to have my old iPhone connected to the power and once I remove the electricity (stop it charging) the screen unlocks and displays a counter app, just a simple seconds/minutes/hours counter. 
  During the counting the screen would stay on. </p>
  
  <p>Then when the power returns (it starts charging again) the timer is reset and the screen is allowed to be turned off (phone can lock itself as it usually does after a period of inactivity). </p>