title: UIScrollView Scrollable Content Size Ambiguity
body: <p>Fellow devs,
  I am having trouble with AutoLayout in Interface Builder (Xcode 5 / iOS 7).
  It's very basic and important so I think everyone should know how this properly works. If this is a bug in Xcode, it is a critical one!</p>
  
  <p>So, whenever I have a view hierarchy such as this I run into trouble:</p>
  
  <pre><code>&gt;UIViewController
  &gt;&gt; UIView
  &gt;&gt;&gt;UIScrollView
  &gt;&gt;&gt;&gt;UILabel (or any other comparable UIKit Element)
  </code></pre>
  
  <p>The UIScrollView has solid constraints, e.g., 50 px from every side (no problem).
  Then I add a Top Space constraint to the UILabel (no problem) (and I can even pin height / width of the label, changes nothing, but should be unneccessary due to the Label's intrinsic size)</p>
  
  <p><strong>The trouble starts when I add a trailing constraint to the UILabel:</strong></p>
  
  <p>E.g., Trailing Space to: Superview Equals: 25</p>
  
  <p>Now two warnings occur - and I don't understand why:</p>
  
  <p><strong>A)</strong> Scrollable Content Size Ambiguity (Scroll View has ambiguous scrollable content height/width)</p>
  
  <p><strong>B)</strong> Misplaced Views (Label Expected: x= -67 Actual: x= 207</p>
  
  <p>I did this minimal example in a freshly new project which you can download and I attached a screenshot. As you can see, Interface Builder expects the Label to sit outside of the UIScrollView's boundary (the orange dashed rectangle). Updating the Label's frame with the Resolve Issues Tool moves it right there.</p>
  
  <p>Please note: If you replace the UIScrollView with a UIView, the behaviour is as expected (the Label's frame is correct and according to the constraint). So there seems to either be an issue with UIScrollView or I am missing out on something important.</p>
  
  <p>When I run the App without updating the Label's frame as suggested by IB it is positioned just fine, exactly where it's supposed to be and the UIScrollView is scrollable.
  If I DO update the frame the Label is out of sight and the UIScrollView does not scroll.</p>
  
  <p><strong>Help me Obi-Wan Kenobi! Why the ambiguous layout? Why the misplaced view?</strong></p>
  
  <p>You can download the sample project here and try if you can figure out what's going on:
  <a href="https://github.com/Wirsing84/AutoLayoutProblem" rel="noreferrer">https://github.com/Wirsing84/AutoLayoutProblem</a></p>
  
  <p><img src="https://i.stack.imgur.com/eqoUh.png" alt="Illustration of the problem in Interface Builder"></p>