When I closed Xcode last night, I had no constraint errors and when I opened Xcode today, it showed me 58 constraint errors. The number of constraint errors increased and decreased till they came down to 33. I have experienced this in the past also. When I wanted to fix this issue in the past, I would simply uncheck Auto Layout and check it again and the errors would disappear. But unfortunately, I cannot do that now as size classes has to be disabled then and that messes up my entire application.
I am getting more than 50 auto layout constraint errors in xcode 6
220 views Asked by Krish Wadhwana At
3
There are 3 answers
1
On
You said
I would simply uncheck Auto Layout and check it again and the errors would disappear.
I think disabling it will remove all the constraints, that's why the errors would disappear. It doesn't really solve any problem.
A general rule for setting up constraints is to go from general to specific.
In my last application, I first set all the common constraints in Any Width | Any Height
and then set constraints that are specific to landscape iPhone in Any Width | Compact Height
. Then I set the constraints that are specific to iPad and portrait iPhone in Any Width | Regular Height
Setting constraints are indeed a painful thing to do, but they are worth it. Good Luck.
I started working on my iPad project with
Next time when i opened my xcode project it had changed to
and thus it showed too many constraint errors. I again changed it to Regular width and height
and the errors disappeared. Check if your case is the same as mine.