In macOS 26, there is a new property on NSControl called .borderShape.
The WWDC 2025-310 video says it can be used to "Override preferred shape of control to suit your design." and that it's available on NSButton, NSPopUpButton and NSSegmentedControl.
Is there an equivalent to that property for SwiftUI? For example, given the following SwiftUI code:
Button("Eject") {
}
.borderShape(...) <-- ?
How can I apply a .borderShape that would match those on controls created in AppKit?
I'm aware that SwiftUI offers a plethora of ways to custom design a button such that it can have rounded corners, but I'm interested in this particular property so that SwiftUI buttons and AppKit buttons in the same app have the same look-and-feel.
Yes, you can use the buttonBorderShape(_:) view modifier to customize the shape of individual buttons or for an entire view hierarchy.
The modifier affects views that produce a button, including Button, Menu (.button style), Picker (.menu and .segmented styles), and ControlGroup.
You might also consider using the controlSize(_:) view modifier get larger buttons, if appropriate. The .large and .extraLarge control sizes use a capsule shape by default.