25
votes

I just converted my Xcode project from Xcode 7.3 to Xcode 8 GM and I am getting over 80 constraint warnings. In Xcode 7, my storyboards were "big squares" rather than a specific iPhone size. Now, with Xcode 8, you can change to the different iPhone and iPad sizes. My constraints are still showing up as they were with the more squared-off VCs in Xcode 7. Is there a "quick" fix or do I need to go through my entire app and fix each and every constraint (far more than 80)?

UPDATE: September 20,2016 -> Many bug reports have been filed based on this feed and Apple should be aware of the problem. I will update with an answer as soon as the problem is fixed.

3
I encountered the same issue with Xcode 8 GM. I really hope they fix this issue by the time they do the final, final release. At first, I thought it was an issue with Xcode 8 migrating over from Xcode 7 but then after some testing, I notice that wasn't the case. I created a new Storyboard with Xcode 8 and after reopening with Xcode 8, I was getting the same issues you just described. I submitted a DTS and two bugs. You should do the same to get more attention to this issue with Xcode 8. At least a bug. Will let you know if I get a response from Apple this week. - Mario A Guzman
Thanks for the info! - Dan Levy
How to fix that for the time being ? I found that all positions of UI elements change and position improperly. - Raju yourPepe
This exact same thing has happened to me. Every single constraint seems to be broken. - Nicholas Smith

3 Answers

14
votes

Select all the Scenes(View Controllers) in the Storyboard, show the Size inspector, change the Simulated Size to Freeform, then set Width Height = 600.

Then, those tons of warnings disappear.

enter image description here

1
votes

I had the same issue when updating to Xcode 8. My storyboard looked just like you describe. Check your warnings/errors. If they all say something like "set vertical hugging priority to X" or "set compression resistance to Y" then you should be able to fix your issue by setting the priorities as suggested.

Click a warning, then in the attribute inspector under the tab with the ruler icon (not sure what that tab is called) you can set the priorities under the Content Hugging Priority and Content Compression Resistance Priority headers. As you update these properties the warnings should start to change to incorrect frame warnings, at which point you can just update the frames.

This might not be a quick fix, but changing a few priorities for some constraints is easier than redoing all the constraints. I hope this helps!

0
votes

Select the view controllers one by one and press "Update Frames" each time.