Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout Interface Builder constraints issue since Xcode 8

Since I have updated my Swift project to Swift 2.3 and Xcode 8 (release version) I can't get my Interface done anymore:

enter image description here

I'm setting all the constraints perfectly. Everything works fine. I reopen Xcode the next day and all my Views look like this.

Also I'm getting tons of warnings:

enter image description here

If I click on Update Frame, the warning disappears and the View looks normal again. But as soon as I restart Xcode (or sometimes even just build the project) it's undone again...

enter image description here

Important: All the Views look PERFECT and as wanted inside any devices, but it's really hard to keep the overview.

I have spent a whole night replacing all the elements of my current project. Everything was fine without any warnings. The next day, the warnings were back and I had changed literally nothing. How do I get rid of this? Help is very much appreciated.

enter image description here

I can "update the frame", everything looks good again. After a couple of builds or at the very latest after re-opening Xcode, it looks like this again.

Latest example: Extreme simple screen. UIViewController. UINavigationBar. UITableView. No segues. One Prototype Cell.

enter image description here

Set all the Constraints perfectly last night. Reopened Xcode. Found this.

Edit:

The suggested work-around to switch desired controller's simulated size to freeform in inspector and then update frames is just a temporary solution.

As soon as I re-open Xcode, all the warnings are back again. I can change the value to fixed then, all the elements "pop back" to their desired position and the warnings disappear -> reopen Xcode and all the warnings are back and the controller's elements are all in a tumble again.

enter image description here

Also the suggestion to change the storyboard file type to 7.x didn't have any effect. I pressed 7.x, it asked me, if I wanted to change. I pressed OK. Loaded. I opened the main.storyboard and it asked me in what device I wanted to open the storyboard on. Xcode 8.0 was re-selected then.

enter image description here

like image 985
David Seek Avatar asked Sep 24 '16 16:09

David Seek


1 Answers

Quick workaround: change the desired controllers' simulated size to freeform in inspector and then update frames. Looks like freeform controllers are not affected by these new Xcode 8 IB features :)

like image 55
Vlad Fedoseev Avatar answered Oct 20 '22 11:10

Vlad Fedoseev