title: Xcode Autolayout Constraints Confusion
body: <p>I have a landscape based view that has a SKView (<code>skView</code>) inside of it. I want the width of <code>skView</code> to always be 100% of the view and a static height of 288. I have added some constraints but when I start the application in the simulator it ways gives me the same CGSize (568 x 288), regardless of if I pick iPhone 4 or 3.5.</p>
  
  <pre><code>- (void)viewDidLoad {
      CGSize size = self.skView.bounds.size; // 568 x 288
      ...
  }
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <h2>I've set up a sample project to illustrate the issue at hand
  
  <a href="https://github.com/kyledecot/autolayout" rel="nofollow noreferrer">https://github.com/kyledecot/autolayout</a></h2>
  
  <p><img src="https://i.stack.imgur.com/64toU.png" alt="enter image description here"></p>
  
  <p><strong>Update #1</strong></p>
  
  <p>One user suggested that I see what the value of <code>self.skView.bounds.size</code> is in <code>viewWillAppear:</code> which yielded some strange results (I'm not really sure if they're helpful)</p>
  
  <p><img src="https://i.stack.imgur.com/Gau6E.png" alt="enter image description here"></p>
  
  <p><strong>Update #2</strong></p>
  
  <p>After removing all constraints and re-adding them as one commenter (updated in the github sample project I posted) suggested I now have the following (still broken though):</p>
  
  <p><img src="https://i.stack.imgur.com/7ZR9j.png" alt="enter image description here"></p>
  
  <p>The lines in IB are blue which I means there is no ambiguity but it still doesn't seem to be working.</p>
  
  <p><strong>Update #3</strong></p>
  
  <p>After receiving new constraints from user <code>matt</code> and using <code>viewWillAppear</code> instead of <code>viewDidLoad</code> the problem still seems to be prevalent. It seems that <code>skView</code>'s width never gets conformed to that of <code>view</code></p>
  
  <p><img src="https://i.stack.imgur.com/vcqRO.png" alt="enter image description here"> </p>
  
  <p>As you can see in the screenshot the text is cut off because on a 3.5 inch iPhone <code>skView</code> still has the width of 568 (iPhone 4 inch's width in landscape).</p>