Slider is the touch control or an user interface control in SwiftUI that allows you to choose a value from a linear range of continuous values. The image indicator known as the “thumb” can be slid over the linear “track” to select any value between the minimum and maximum values representing the beginning and end of the track. To read values from the slider, just like the TextField, we must bind it to a state variable.
The Slider in SwiftUI is comparable to the UISlider in the UIKit.
Sliders are largely customizable by a variety of parameters but the basics start with the binding Double state variable, the range of the slider and the incremental value on moving the slider.
Slider(value: $sliderValue, in: 0...20)