Search code examples
iosxcodeautolayoutconstraints

How to edit multiple constraints at once in Xcode's Interface Builder


I have a layout of UIButtons that looks like this:

enter image description here

The horizontal spacing between the buttons is 8. I would like to change this to 4. Of course, I could change them one by one, like this:

enter image description here

But there are a lot of buttons and I don't really feel like doing that.

I tried selecting multiple buttons and then added a horizontal space constraint of 4 but that just adds constraints. It doesn't update the old constraints. This creates conflicting constraints with the old ones.

I didn't see anything to solve this in the Editing Auto Layout Constraints documentation.


Solution

  • Just use Command + click to select multi constraits,

    like the gif

    enter image description here