Can I move the autolayout constraints in Interface Builder?

autolayout, cocoa

Solution

- Select 2 checkboxes

- Click the "H" icon in the right-bottom of the interface builder

- Select Vertical Spacing

Now select the useless constraints and delete it:

Problem

Sometimes the autolayout constraints snap to a wrong anchor point – like when I want a control to be anchored to a control above it and the autolayout constraint gets anchored to the bottom of the window. Is there a way to move the constraint? An ASCII art should make this more clear. This is what I have: ``` +------------------------+ | | | [x] Some checkbox | | | | [x] Another checkbox | | | | | | ← autolayout | | | constraint | | | | +-----+------------------+ ``` And this is what I want instead: ``` +------------------------+ | | | [x] Some checkbox | | | ← A.C. | | [x] Another checkbox | | | | | | | | | +------------------------+ ``` I can anchor the constraint to the upper checkbox by moving the lower checkbox upwards, but that’s not what I want, I want the vertical space to be larger. (The checkboxes are just for an illustration, my real use case has different views.)

Original source