Xcode 11 messes up storyboard

I recently upgraded from Xcode 10.2.1 to 11.3.1. After doing this, the labels on my storyboard appear shifted slightly away from where they were before. However, when I run the app on my phone, everything is normal and appears in the right place. The bigger isue is when I create new layouts and constraints, it appears fine on the interface builder but looks all messed up when the app is run. The only "solution" I can think of is opening the project in 10.2.1 when I want to make storyboard edits and switch back when I'm done. This is usually not a noticable issue but it becomes very obvious when constraining multiple labels to eachother to line up with text fields. I am currently on Mojave. If anyone else has encountered this problem and knows of a solution it would be greatly appreciated.

Accepted Reply

I figured it out. The default UITextField height on ios 12/xcode 10 is 30 while the default on ios 13/xcode 11 is 34. To fix it just manually set the height of every text field.

Replies

No, I did not get such problems when upgrading XCode.


the labels on my storyboard appear shifted slightly away from where they were before.

Have you defined constraints for the labels ?

How do they shift ? Vertically, horizontally ?


Does this occur only with existing projects or with new ones as well ?

You may have an incorrect Autolayout set up.

- Select a viewController in Stroryboard

- Open File inspector

- In "Interface Builder document" section, make sure "Safe Area Layout Guides" is checked

- Repeat for all ViewControllers


Read this:

https://forums.developer.apple.com/thread/123173

https://stackoverflow.com/questions/44492404/safe-area-of-xcode-9


Maybe you should upgrade to XCode 11.5

I figured it out. The default UITextField height on ios 12/xcode 10 is 30 while the default on ios 13/xcode 11 is 34. To fix it just manually set the height of every text field.

You're right, I didn't notice before.


Even if the system font remais size 14, they changed the default tectField height.