Artem Stepanenko
Artem Stepanenko

Reputation: 3501

The issue of Interface Builder in Xcode 8

My storyboards are created in Xcode 7. After I installed Xcode 8, all of them are constantly messed up. When I open one of them, Xcode asks me to select a device (which is a nice new feature). But then it never adjusts views' frames, so I must press "All View: Update Frames" infinite amount of times. And even this doesn't fix all "misplaced" views.

Anybody knows how to fight this problem? Or the only option is to pray that Apple fixes it at some point?

UPDATE 1

It happens every time I open IB, even if I've fixed frames previously.

UPDATE 2

When my colleague fixes same storyboards on his computer, changes stay. No idea what makes my Xcode so special.

Example

Upvotes: 10

Views: 1263

Answers (2)

thetrutz
thetrutz

Reputation: 1545

Xcode 8.0 has the bug, that it does not save the rects from the storyboard xml-s. So if you fix misplaced views in Xcode 8.0, the problem is gone for as long as the storyboard stays in RAM. When the storyboard is closed and re-read from a file, the issue appears again. (Actually Xcode 7.0 had exactly the same problem in the beginning.)

Xcode 8.1 beta 3 (the most recent version at the time of this writing) fixes this issue:

  • frames are not 1000x1000, but they stay as they were.

Upvotes: 1

theDC
theDC

Reputation: 6484

I figured out the following workaround

First, set width and height for your view to the values it will calculate on selected device in your storyboard, then preserve superview margins.

This worked for me

enter image description here

Upvotes: 2

Related Questions