TouchSlider

A slider empowering users to effortlessly adjust values by simply touching anywhere.


CleanShot 2023-10-06 at 11  12 12

Instructions

@State var value: Double = 0

...

TouchSlider(
  direction: .horizontal,
  value: $touchSlider_value,
  speed: 1, // multiplier to track gesture translation.
  foregroundColor: Color.red,
  backgroundColor: Color(white: 0.5, opacity: 0.3),
  cornerRadius: 16
)
.frame(height: 80)

GitHub

View Github