1

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

Community
  • 1
  • 1
Taylor
  • 5,871
  • 2
  • 30
  • 64

0 Answers0