Double Slider SwiftUI - admiral-team/admiralui-ios GitHub Wiki

Struct

A view that display two movable sashes that slide in for maximum control over ventilation


Declaration

public struct DoubleSliderView: View

Overview

Component present a view with lower and upper thumb image with line of progress. You can also control the maximum and minimum values of DoubleSlider.

Live example

Configure a DoubleSlider

DoubleSliderView(
    valueFrom: .constant(1),
    valueTo: .constant(100),
    minValue: 1,
    maxValue: 100,
    segmentSize: .constant(.zero),
    gestureChange: {}
)

Tracking slider value changes

@State private var sliderValueFrom = 0
@State private var sliderValueTo = 50

DoubleSliderView(
    valueFrom: $sliderValueFrom,
    valueTo: $sliderValueTo,
)
.onChange(of: sliderValueFrom) { value in ...}
.onChange(of: sliderValueTo) { value in ... }

Contribution

You can help us to find bugs or ask us to add features.

  • To start issue please use ready-made templates.
  • To make changes to the repository, you need to create a fork of the project, make changes to the code and create a pull request in our project. You can read more about this in the Github documentation.