I have a view with with an Int property named "score" that I want to adjust with a slider.
struct IntSlider: View {
@State var score:Int = 0
var body: some View {
VStack{
Text(score.description)
Slider(value: $score, in: 0.0...10.0, step: 1.0)
}
}
}
But SwiftUI's Slider only works with doubles/floats.
How can I make it work with my integer?