[ad_1]
I wish to create slider in SwiftUI with Worth label.
I’ve write beneath code.
struct SliderView: View {
@State non-public var pace = 50.0
var minValue: Double = 1
var maxValue: Double = 100
var physique: some View {
VStack {
Textual content("(pace,specifier: "%.f")")
.foregroundColor(.blue)
Slider(
worth: $pace,
in: minValue...maxValue,
step: 1
) {
Textual content("Pace")
} minimumValueLabel: {
Textual content("(minValue,specifier: "%.f")")
} maximumValueLabel: {
Textual content("(maxValue,specifier: "%.f")")
}
}.padding()
}
}
However I wish to transfer worth label with slider thumb.
I’m not capable of finding any property to set .body for Y worth.
Query:
Easy methods to transfer Slider Worth label with Thumb and transfer label worth with Thumb change.
[ad_2]



