Xcode 8 - Autolayouts Issue
<p>I am setting up basic UIView subclass with the new Xcode and came across weird behaviour. The subclassed view appears to load normally at the first glance:</p>
<pre><code>- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
        if (self) {
            [self baseInit];
}
    return self;
}
- (void)awakeFromNib
{
    [super awakeFromNib];
    [self baseInit];
}
</code></pre>
<p>I started to build another container view in storyboards set to size of iPhone 6 as I own one. I had a bit complicated layout with quite few objects and even if I am good at setting constrains, it came out shifted.</p>
<p>So I started to experiment with simple view, to see where the problem is after the Xcode upgrade.</p>
<p>Simple exercise with 2 UIViews.</p>
<p><a href="https://i.stack.imgur.com/bfdgs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bfdgs.jpg" alt="enter image description here" /></a></p>
<p>The preference setting was set to 1000 to each constrain and device was set to iPhone 6s.
<a href="https://i.stack.imgur.com/w4NMd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w4NMd.jpg" alt="enter image description here" /></a></p>
<p>But the result on iPhone 6/s or my device iPhone 6 is shifted:</p>
<p><a href="https://i.stack.imgur.com/6Y9oC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Y9oC.png" alt="enter image description here" /></a></p>
<p>So when I started to fiddle around, I have discovered that if set the storyboard device to iPhone SE, it will show the content correctly on both, iPhone 6 simulator and iPhone 6 device:</p>
<p><a href="https://i.stack.imgur.com/6Rnhm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Rnhm.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/KjqPg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KjqPg.png" alt="enter image description here" /></a></p>
<p>Wrong setting and now it's aligned. Have I missed something in the new Xcode version and how to work with autolayouts and constrains?</p>
<p>Thank you
A.</p>