yonat / MultiSlider

UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.
MIT License
494 stars 113 forks source link

Cannot access value in viewDidLoad() #62

Closed sophiagatliff closed 3 years ago

sophiagatliff commented 3 years ago

Description of the problem: can't seem to access value in view did load. Says "Value is a get only property".

What I'm pretty sure is happening is that when I type in value, its getting two different variables for value, one is [CGFloat] and the other is MultiSlider?. it defaults to MultiSlider? which IS a get only property, and I can't seem to access the value property that will allow me to set the values.

Minimal project that reproduces the problem (so I'll be able to figure out how to fix it): import MultiSlider create add a slider in a tableViewCell in a xib create an outlet for a slider try to set sliderOutlet.value in viewDidLoad()

sophiagatliff commented 3 years ago

Merp. outletSlider.value!.value allows you to access the setter.

Weird.

Leaving open in case you want to change something.

yonat commented 3 years ago

Using https://github.com/sophiagatliff/multisliderbug, this works for me:

multiSlider.value = [20, 30]
yonat commented 3 years ago

@sophiagatliff is this still a problem?

sophiagatliff commented 3 years ago

I've just been using the workaround mutliSlider.value!.value which works fine.