In #SwiftUI, we can use a ControlGroup to group buttons together. Thanks to @adam for telling me about this view, since I completely forgot it existed :
https://danielsaidi.com/blog/2023/06/01/creating-a-bordered-button-group
@danielsaidi IIRC ControlGroup is supposed to do stuff like this, but I have no idea what it looks like on iOS.
@adam I have updated the post to use the ControlGroup instead, thanks again!
@danielsaidi Great find! I didn't know about this one either. In your post you use .frame(width:) to fix the greedy size but you can use .fixedSize() instead and it will keep the size of the content automatically.
@ryanlintott @danielsaidi add me to the list of people that did not know about this.
@ryanlintott Cool, thanks - I will try changing it and see if it behaves better