How to remove a constraint that is already set in Xcode storyboard

30,642

Solution 1

Just select the view you want to remove a constraint from and open the size inspector. You should see a list of all the constraints. Select the one you want to delete, and press the delete key.

Solution 2

Click on a constraint that you want to delete in the Size inspector, it covers with a thin blue border. Even you can select multiple constraints in Size inspector by keep holding command key. The constraint(s) can then be removed/deleted using the backspace.

constraint selected in size inspector Or

You can double click on constraint that you want to delete in the Size inspector and it will shows details of constraint in size inspector. Hit Delete button and it will remove/delete the constraint.

Constraint detail in size inspector

Solution 3

To help the rookies like me out there, here is how to remove a constraint in Xcode 12.0

  1. Click the object that has the constraint you want to remove on the Storyboard.
  2. Click the Inspectors button to make sure the sidebar is open.
  3. Click the Size Inspector button. See image or look for the right triangle icon
  4. Look for the Constraints section, it is a bit down the sidebar.
  5. Click the Constraint you want to remove.
  6. Hit the delete key.

enter image description here

Share:
30,642
Greeso
Author by

Greeso

Updated on October 01, 2020

Comments

  • Greeso
    Greeso over 3 years

    As the title says, I would like to remove a constraint that is already set in the storyboard. However I did not find any UI option in Xcode that allows me to do so. How can I remove an already existing constraint?

    Thanks.

  • Greeso
    Greeso over 9 years
    Thank you, this is so simple I did not even think about it.
  • Chandni - Systematix
    Chandni - Systematix over 7 years
    If you want to delete a constraints then click on a particular constraint in the Size inspector, it acquires a thin blue border. The constraint can then be deleted using the backspace. It is working in Xcode 8 too.
  • Josh Sutterfield
    Josh Sutterfield about 3 years
    Yeah, that's not good UI on their UI builder.. it has a visible "Edit", and no "delete" option within the edit, but to delete you do a keypress