SwiftUI equivalent of popoverTouchBar and pressAndHoldTouchBar

148 Views Asked by At

SwiftUI Touch Bar support seems quite limited.

Is there an equivalent of popoverTouchBar and pressAndHoldTouchBar?

I tried doing a popover as follows:

.touchBar {
     Button(action: { self.showRadiusTouchBarSlider.toggle() }) {
        Text("Radius")
     }.popover(isPresented: self.$showRadiusTouchBarSlider) {
        Slider(value: self.$model.radius, in: Float(0.0)...Float(1.0))
     }
}

Amusingly, that puts a touch-bar styled slider in the corner of the screen:

Touch Bar slider

0

There are 0 best solutions below