title: How can I programmatically enable Guided Access (Kiosk mode) on an iPhone?
body: <p><strong>Question</strong></p>
  
  <p>How do I automate <a href="https://stackoverflow.com/q/13254309/328397">Guided Access</a> mode on an iPhone?  I will need to automate the enabling and removal of this feature</p>
  
  <p><strong>Background</strong>
  <a href="http://techcrunch.com/2014/12/14/iowa-launches-an-app-for-your-drivers-license/" rel="noreferrer">This application from the State of Iowa</a> uses an iOS app to display your drivers license.  The issue is that after handing your phone over to authorities, they have full access to the device.</p>
  
  <p>If I have the source code to this, or a similar application, how can I require a password when switching out of temporary "Kiosk mode", so that photos, emails or text messages are not available from either the phone, or (ideally) from USB.</p>
  
  <p>I found this similar <a href="https://stackoverflow.com/a/19313091/328397">solution for Android</a>, but am now looking for an iOS solution</p>