Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to set the labels? #25

Open
rschlack opened this issue Nov 30, 2017 · 5 comments
Open

Is there a way to set the labels? #25

rschlack opened this issue Nov 30, 2017 · 5 comments

Comments

@rschlack
Copy link

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?

@saimt
Copy link

saimt commented Apr 19, 2021

@rschlack were you able to do it?

@rschlack
Copy link
Author

I was able to do that. Are you asking because you need the solution or were you offering help?

@saimt
Copy link

saimt commented Apr 19, 2021

I'm looking for a solution

@rschlack
Copy link
Author

rschlack commented Apr 19, 2021

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! + "+"
        }
    }

@saimt
Copy link

saimt commented Apr 19, 2021

Ok thank you for the help. Appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants