I have two buttons, which I would like to keep centered in their superview as a group.
Expressed in visual format I want something like |-*-[button1]-5-[button2]-*-|
where *
should be equal and be automatically determined by AutoLayout.
I currently have three workarounds which all seem not very elegant
make the two buttons subviews of a UIView and center that view
calculate the value of
*
manually and manually update the constraintsalign both buttons to the superview's center with an offset manually calculated from the button widths
Any other suggestions?