How to remove a constraint that is already set in Xcode storyboard
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.
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.
Solution 3
To help the rookies like me out there, here is how to remove a constraint in Xcode 12.0
- Click the object that has the constraint you want to remove on the Storyboard.
- Click the Inspectors button to make sure the sidebar is open.
- Click the Size Inspector button. See image or look for the right triangle icon
- Look for the Constraints section, it is a bit down the sidebar.
- Click the Constraint you want to remove.
- Hit the delete key.
Greeso
Updated on October 01, 2020Comments
-
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 over 9 yearsThank you, this is so simple I did not even think about it.
-
Chandni - Systematix over 7 yearsIf 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 about 3 yearsYeah, 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