BPKRangeSlider
public struct BPKRangeSlider : View
A view that displays a horizontal slider with two thumbs.
-
Creates a new instance of
BPKRangeSlider.If the selected range is outside the bounds of the slider, it will be clamped to the bounds.
Declaration
Swift
public init( selectedRange: Binding<ClosedRange<Float>>, sliderBounds: ClosedRange<Float>, step: Float = 1, minSpacing: Float = 0, thumbnailLabels: ThumbnailLabels? = nil, onDragEnded: @escaping (ClosedRange<Float>) -> Void = { _ in } )Parameters
selectedRangeBinding of the selected range of the slider.
sliderBoundsThe bounds of the slider.
stepThe step size of the slider. Defaults to 1.
minSpacingThe minimum spacing between the two thumbs. Defaults to 0.
thumbnailLabelsThe minimum spacing between the two thumbs. Defaults to 0.
onDragEndedA closure that is called when the user stops dragging the slider.
-
Declaration
Swift
public var body: some View { get } -
Sets the accessibility label for the trailing thumb.
Declaration
Swift
public func trailingAccessibility(label: String) -> BPKRangeSlider -
Sets the accessibility label for the leading thumb.
Declaration
Swift
public func leadingAccessibility(label: String) -> BPKRangeSlider -
Declaration
Swift
struct ThumbnailLabels