SwiftRangeSlider
SwiftRangeSlider copied to clipboard
Is there a way to set the labels?
I would like to create 10 points on the slider stepping by 1. But I want the labels to show custom text for each of the 10 points. Is this possible?
@rschlack were you able to do it?
I was able to do that. Are you asking because you need the solution or were you offering help?
I'm looking for a solution
It's been a really long time since I looked at that project. But it looks like I just used a UILabel to show the value. My slider was a dollar amount filter.
@IBOutlet weak var priceSlider: RangeSlider!
@IBOutlet weak var priceLabel: UILabel!
@IBAction func priceSliderValueChanged(_ slider: RangeSlider) {
self.low = Int(slider.lowerValue)
self.high = Int(slider.upperValue)
self.SetPriceLabel(low: self.low, high: self.high)
}
func SetPriceLabel(low: Int, high: Int) {
self.priceLabel.text = "$" + low.stringWithSeparator + " to $" + high.stringWithSeparator
if (high == 10000) {
self.priceLabel.text = self.priceLabel.text! + "+"
}
}
Ok thank you for the help. Appreciate it!