Slider
public struct Slider : View
extension Slider: Renderable
A view that displays a range of values, and a knob that allows selecting a value in the range.
-
Declaration
Swift
public var viewStore: ViewValues -
Declaration
Swift
public var body: View { get } -
Creates an instance that selects a value from within a range.
The
valueof the created instance will be equal to the position of the given value withinbounds, mapped into0...1.Declaration
Swift
@available(tvOS, unavailable) public init(value: Binding<Float>, in bounds: ClosedRange<Float> = 0...1)Parameters
valueThe selected value within
bounds.boundsThe range of the valid values. Defaults to
0...1. -
Creates an instance that selects a value from within a range.
The
valueof the created instance will be equal to the position of the given value withinbounds, mapped into0...1.Declaration
Swift
@available(tvOS, unavailable) public init(value: Binding<Float>, in bounds: ClosedRange<Float>, step: Float = 1)Parameters
valueThe selected value within
bounds.boundsThe range of the valid values. Defaults to
0...1.stepThe distance between each valid value.
labelA
Viewthat describes the purpose of the instance. -
Declaration
Swift
public func createView(context: Context) -> UIView -
Declaration
Swift
public func updateView(_ view: UIView, context: Context)
View on GitHub
Slider Structure Reference