RangeSeekSlider
RangeSeekSlider copied to clipboard
Feature Request : adding positive suffix to just selectedMaxValue
I have a salary range from 0 to 10000, I want when the user selects 10,000 (maxValue) then the label should show "10,000+"
I have do like this RangeSeekSlider.swift
private func updateLabelValues() { minLabel.isHidden = hideLabels || disableRange maxLabel.isHidden = hideLabels
if let replacedString = delegate?.rangeSeekSlider(self, stringForMinValue: selectedMinValue) {
minLabel.string = replacedString
} else {
minLabel.string = numberFormatter.string(from: selectedMinValue as NSNumber)
}
if let replacedString = delegate?.rangeSeekSlider(self, stringForMaxValue: selectedMaxValue)
{
maxLabel.string = replacedString
}
else
{
if selectedMaxValue >= maxValue
{
maxLabel.string = numberFormatter.string(from: selectedMaxValue as NSNumber)! + "+"
}
else
{
maxLabel.string = numberFormatter.string(from: selectedMaxValue as NSNumber)
}
}
if let nsstring = minLabel.string as? NSString {
minLabelTextSize = nsstring.size(attributes: [NSFontAttributeName: minLabelFont])
}
if let nsstring = maxLabel.string as? NSString {
maxLabelTextSize = nsstring.size(attributes: [NSFontAttributeName: maxLabelFont])
}
}