UIRangeSlider is a subclass of UIControl
and you can get changes with UIControlValueChanged
method.
###Init
let rangeSlider = UIGraphRangeSlider()
rangeSlider.graphPoints = [0,2,6,4,5,8,3,10,12,14,15,16,10,4,1,1,1,1,0]
rangeSlider.frame = CGRect(x:0, y:0, width: self.view.bounds.width, height: 120)
The range slider can be customized and information can be accessed through these properties :
minimumValue
: The minimum possible value of the rangemaximumValue
: The maximum possible value of the rangelowerValue
: The value corresponding to the left thumb current positionupperValue
: The value corresponding to the right thumb current positiontrackTintColor
: The track colorgraphColor
: The color of the graphtrackHighlightTintColor
: The color of the section of the track located between the two thumbs. Alpha component will be applied automaticallygraphPoints
:Array<Int>
to hold the graph points. At this pointInt
works fine, but I could implementFloat
orDouble
if neededthumbTintColor
: The thumb colorcurvaceousness
: From 0.0 for square thumbs to 1.0 for circle thumbs