I'm trying to trigger the sliderchanged()
function when the slider value changes, I might be missing something very basic but every similar thing I've found isn't working. Isn't there anything like "action" for the Slider or the old "ValueChanged" action?
Here's my code:
struct CustomSlider1: View {
@State var progress: Float = 0.5
var body: some View {
VStack{
Slider(value: $progress)
.padding(.all)
Text(String(progress))
}
}
func sliderchanged() {
//do things
}
}
Thanks!!