I would like to create two horizontal Slider. One Slider has a range from 21 to 90 but from 50 the Slider should go in "10 steps". E.g. 21,22,23,...,50,60,70,80,90. The other Slider should be able to display the following double numbers: 1.2, 1.3, 1.4, 1.5, 1.6
I wrote following function:
struct SliderOne: View {
@State var valueArray : [Int] = []
var body: some View {
Text("Placeholder")
}
func initPickerIndex(){
valueArray = []
for index1 in 21..<50 {
valueArray.append(index1)
}
for index2 in 1...5 {
valueArray.append(40 + index2 * 10)
}
}
}
Can I use this?