title: iOS 8 top layout guide auto layout problems
body: <p>One of the screens in my app completely broke when updating to the iOS 8 SDK.
  The problem seems to be that the top layout guide shifts up instead of being an 'anchor' for the rest of the views.</p>
  
  <p>This is what the view looked like on iOS 7:</p>
  
  <p><img src="https://i.stack.imgur.com/JXDn8.png" alt="iOS 7 Screen"></p>
  
  <p>This is what it looks like in iOS 8 (captured from the Xcode 6 View Hierarchy debugger):</p>
  
  <p><img src="https://i.stack.imgur.com/wn7ge.png" alt="iOS 7 Screen"></p>
  
  <p>As you can see, the view appears way above the navigation bar.
  There are two constraints on the top layout guide, one for the upper image view, and one for the white view below it.
  There are no constraints on the bottom layout guide, only height constraints on the views.</p>
  
  <p>For some reason, iOS 8 decides to push the top layout guide to <code>{0 -255; 0 0}</code> after <code>[self.view layoutIfNeeded]</code> is called for the first time.
  Also, the view's bounds sometimes appear too large for the device (i.e. showing up exactly as in the unified storyboard (600x600), instead of 320x480/320x568.</p>
  
  <p>What has changed in iOS 8 that might screw up the layout?</p>
  
  <p>[EDIT]
  Here is a complete list of the constraints on the view:</p>
  
  <pre><code>(lldb) po self.view.constraints
  &lt;__NSArrayM 0x786ac520&gt;(
      &lt;NSLayoutConstraint:0x7c377bd0 V:[_UILayoutGuide:0x7c372f60]-(0)-[UIView:0x7c373120]&gt;,
      &lt;NSLayoutConstraint:0x7c377c00 UIView:0x7c373120.width == UIView:0x7c3730b0.width&gt;,
      &lt;NSLayoutConstraint:0x7c377c30 UIView:0x7c3730b0.centerX == UIView:0x7c373120.centerX&gt;,
      &lt;NSLayoutConstraint:0x7c377c60 H:|-(0)-[UIView:0x7c3716f0]   (Names: '|':UIView:0x7c3730b0 )&gt;,
      &lt;NSLayoutConstraint:0x7c377c90 UIView:0x7c3716f0.width == UIView:0x7c3730b0.width&gt;,
      &lt;NSLayoutConstraint:0x7c372f30 V:[_UILayoutGuide:0x7c372f60]-(129)-[UIView:0x7c3716f0]&gt;
  )
  </code></pre>