title: iPhone Landscape FAQ and Solutions
body: <p>There has been a lot of confusion and a set of corresponding set of questions here on SO how iPhone applications with proper handling for Landscape/Portrait mode autorotation can be implemented. It is especially difficult to implement such an application when starting in landscape mode is desired. The most common observed effect are scrambled layouts and areas of the screen where touches are no longer recognized.</p>
  
  <p>A simple search for questions tagged <code>iphone</code> and <code>landscape</code> reveals these issues, which occur under certain scenarios:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1891395/landscape-only-iphone-app-with-multiple-nibs">Landscape only iPhone app with multiple nibs</a>:
  App started in Landscape mode, view from first nib is rendered fine, everything view loaded from a different nib is not displayed correctly.</p></li>
  <li><p>Iphone Landscape mode switching to Portraite mode on loading new controller:
  Self explanatory</p></li>
  <li><p><a href="https://stackoverflow.com/questions/1632117/iphone-in-landscape-only-after-first-addsubview-uitableviewcontroller-doesnt">iPhone: In landscape-only, after first addSubview, UITableViewController doesn’t rotate properly</a>: Same issue as above.</p></li>
  <li><p><a href="https://stackoverflow.com/questions/525737/iphone-landscape-only-utility-template-application">iPhone Landscape-Only Utility-Template Application</a>: Layout errors, controller does not seem to recognize the view should be rotated but displays a clipped portrait view in landscape mode, causing half of the screen to stay blank.</p></li>
  <li><p><a href="https://stackoverflow.com/questions/1906280/presentmodalviewcontroller-in-landscape-after-portrait-viewcontroller">presentModalViewController in landscape after portrait viewController</a>: Modal views are not correctly rendered either.</p></li>
  </ul>
  
  <p>A set of different solutions have been presented, some of them including completely custom animation via CoreGraphics, while others build on the observation that the first view controller loaded from the main nib is always displayed correct. </p>
  
  <p>I have spent a significant amount of time investigating this issue and finally found a solution that is not only a partial solution but should work under all these circumstances. It is my intend with this CW post to provide sort of a FAQ for others having issues with UIViewControllers in Landscape mode. </p>
  
  <p>Please provide feedback and help improve the quality of this Post by incorporating any related observations. Feel free to edit and post other/better answers if you know of any.</p>