title: Xcode IB Storyboards orientation and container views
body: <p>In an IOS 6 iPad app, I have a container view controller with multiple container views. Currently I have locked my app to landscape and works fine but I'd like to support portrait as well.  Everything is set up using auto layout and constraints via Interface builder.  If possible I'd like to keep one storyboard for consistency, maintainability etc.</p>
  
  <p>The layout is this: Header, Left-side menu, two content panes (side by side in landscape) and a foot pane, I have all panes resizing except the content.  When rotating from landscape to portrait I'd like one content pane to slide below the other (currently it blows off the screen), and both to stick to the edges of the container view.  </p>
  
  <p>In HTML5/CSS3 this would be easy to do but I'm stuck in IB, any help/ideas would be great!</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: </p>
  
  <p>Solution -</p>
  
  <p>Following @Charles A.'s suggestion, I linked the NSLayoutConstraints to IBOutlets and manipulated spacing/priority in code.  Where I really struggled was using Height and Width constraints.  If you moved anything, Interface Builder would delete or override these with Leading/trailing &amp; Top/Bottom constraints.  I finally gave in and got rid off all height &amp; width constraints, and used only leading/trailing/top/bottom.</p>
  
  <p>2 things I figured out: Constraints have milestones(one at priority #750 for instance) so if you pragmatically change priority from 749 to 750, you will get:</p>
  
  <blockquote>
  <pre><code>Mutating a priority from required to not on an installed constraint (or vice-versa) is not supported.
  </code></pre>
  </blockquote>
  
  <p>But if you changed from 750 to 800 you are fine.</p>
  
  <p>Also, after manipulating constraints, I needed to call:</p>
  
  <pre><code>[self updateViewConstraints]
  </code></pre>
  
  <p>I had found a post that suggested [parent updateViewConstraints], which didn't work, the one above did! </p>
  
  <p>Anyway, I hope this helps others in this spot since there's not much out there.</p>