BPKSlider
public struct BPKSlider : View
A view that displays a horizontal slider with a thumb that can be dragged to select a value.
-
Creates a new instance of
BPKSlider.If the value is outside the bounds of the slider, it will be clamped to the bounds.
Declaration
Swift
public init( value: Binding<Float>, sliderBounds: ClosedRange<Float>, step: Float = 1, onDragEnded: @escaping (Float) -> Void = { _ in } )Parameters
valueBinding of the value of the slider.
sliderBoundsThe bounds of the slider.
stepThe step size of the slider. Defaults to 1.
onDragEndedA closure that will be called when the user stops dragging the slider.
-
Declaration
Swift
public var body: some View { get } -
Sets the accessibility label for the thumb.
Declaration
Swift
public func thumbAccessibility(label: String) -> BPKSlider