In AppKit, NSSegmentedControl has various styles defined by NSSegmentStyle
and various tracking modes defined by NSSegmentSwitchTracking
.
How can we set these properties in SwiftUI?
I'm currently using a Picker
with the view modifier .pickerStyle(.segmented)
applied but this seems to produce a segmented control with tracking set to "select one".
In particular I'm looking for momentary tracking so that I can create navigation-style buttons for backward/forward navigation.
Under AppKit, the canonical way to do this is an NSSegmentedControl
of style separated
and tracking momentary
.
Is that possible under SwiftUI for macOS? (Using the latest versions of everything.)