Reputation: 53
Any idea how to modify (if is possible) a ProgressView with drag gestures. To begin with, I think the code will be something like this:
ProgressView(value: progress)
.gesture(DragGesture()
.onChanged({
// code here
})
But I'm really lost. Any help?
Upvotes: 0
Views: 666
Reputation: 159
The .onChanged modifier has a parameter in the closure. You can do something like:
.onChanged{ val in
progress = val.translation.width / 100 // perhaps cut it so the number is between 0 and 1
}
Upvotes: 0