JLT
JLT

Reputation: 3172

Xcode Changes Contraints Of Layout By Itself After Reopening The Project

I set the constraints of layout properly and also tested it on every device. But the next time I open the project, Xcode just ruined the constraints totally. enter image description here

How did this happen?

Upvotes: 3

Views: 117

Answers (2)

pedrouan
pedrouan

Reputation: 12910

You did not specify you Xcode version, but my own experiences with code, that is developed using Xcode 8 Beta 1 to Beta 6: The problem may be caused by bug in XCode.

The explanation, if you use Xcode 8 Beta, could be:

  • New Xcode offers new storyboard-display logic, that shows different difficulties still in Beta 6
  • After fixing both constraints and frames automatically / manually, warnings come back again after reopening project
  • This problem moves from Xcode Beta 2 to Beta 6 after my own researches

Let's give Apple a little more time to fix the issues and let's wait until Apple releases GM Seed. It's only beta though

Upvotes: 0

Duck
Duck

Reputation: 36003

May be the project has a problem and for some reason it is not saving the changes. I have indeed put this solution on my troubleshooting book about Xcode from Apress (shameless advertising... 😃). I have seen this before.

Backup your project and try this:

  1. Quit Xcode
  2. Using finder, right click on the .xcodeproj file of your project and select Show Package Contents.
  3. delete everything from that except the file project.pbxproj.
  4. open the project again fix the constraints and see if the changes are saved the next time you open Xcode.

Upvotes: 1

Related Questions