title: Handling iDevice rotation on iOS 6
body: <p>I'm having trouble figuring out how to handle device rotation on iOS 6. I have three things that need to change separately when the device is rotated.</p>
  
  <ul>
  <li>I have a parent UIViewController that handles multiple sub UIViewControllers or UINavigationControllers (Its basically a custom UITabBarController). I do not want this to rotate. </li>
  <li>Each of these sub view controllers, will either rotate or not rotate depending on its own settings. (I want some to rotate and some to not).</li>
  <li>In the tab bar, I want each tab icon (a UIView) to rotate to the orientation.</li>
  </ul>
  
  <p>How would I go about making this happen in iOS 6, I got everything working in iOS 5. </p>
  
  <p>Here is what I have so far:</p>
  
  <p>In the parent UIViewController:</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  {
      return UIInterfaceOrientationPortrait;
  }
  
  - (BOOL)shouldAutorotate
  {
      return NO;
  }
  
  - (BOOL)supportedInterfaceOrientations
  {
      return UIInterfaceOrientationMaskPortrait;
  }
  </code></pre>
  
  <p>In the sub view controllers:</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  {
          return YES;
  }
  
  - (BOOL)shouldAutorotate
  {
          return YES;
  }
  
  - (BOOL)supportedInterfaceOrientations
  {
          return UIInterfaceOrientationMaskAll;
  }
  </code></pre>