WorldDownTown / RangeSeekSlider

RangeSeedSlider provides a customizable range slider like a UISlider.
MIT License
755 stars 282 forks source link

How to add extra text to min value and max value? like 1Feet and 10Feet #88

Open sasikumarperumal opened 4 years ago

sasikumarperumal commented 4 years ago

New Issue Checklist

Issue Description

Environment

khurramlodhi commented 4 years ago

You have to change in pod file. On the place of "$" you can put string you want..

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 {
        maxLabel.string = "$ " + numberFormatter.string(from: selectedMaxValue as NSNumber)!
    }

    if let nsstring = minLabel.string as? NSString {
        minLabelTextSize = nsstring.size(withAttributes: [.font: minLabelFont])
    }

    if let nsstring = maxLabel.string as? NSString {
        maxLabelTextSize = nsstring.size(withAttributes: [.font: maxLabelFont])
    }
}