title: iOS app orientation rotation lock / unlock by app's config
body: <p>Hi,</p>
  
  <p>I'm trying to implement orientation rotation lock / unlock toggle switch to my iOS app.</p>
  
  <p>Locking is OK, but unlocking is a problem.</p>
  
  <p>Suppose a situation that app's orientation and device's orientation are differ. If user unlocks in the situation, app's orientation should follow device's orientation immediately. But I cannot find the way.</p>
  
  <p>How can I simulate device's orientation rotation?</p>
  
  <p>Edit</p>
  
  <p>I'll clarify the situation.</p>
  
  <p>There is a toggle switch in app, enable/disable orientation rotation.</p>
  
  <p>Step by step:</p>
  
  <p>1. The switch is enabled.</p>
  
  <p>2. Device rotates to portlait.</p>
  
  <p>3. UIViewController's shouldAutorotateToInterfaceOrientation returns YES for every orientation.</p>
  
  <p>4. App rotates to portlait.</p>
  
  <p>5. User toggles the switch to disable.</p>
  
  <p>6. Device rotates to landscape.</p>
  
  <p>7. UIViewController's shouldAutorotateToInterfaceOrientation returns NO except portlait.</p>
  
  <p>8. App doesn't rotate.</p>
  
  <p>9. User toggles the switch to enable.</p>
  
  <p>10. App should rotate to landscape. This is the problem.</p>