I know this question is old, but I just want to share how I did it.
Assuming that the UISlider is already initialized, the minimum and maximum values ββof the UISlider must first be set:
mySlider.minimumValue = -2.0; mySlider.maximumValue = 2.0;
Then set the selector that will handle the changes in the slider:
[mySlider addTarget:self action:@selector(sliderDidChangeValue:) forControlEvents:UIControlEventValueChanged];
Also set the spacing (for the property). It is important that the interval is positive. (And, indeed, INTERVAL MUST BE POSITIVE.)
self.interval = 0.5 //_interval is float
Declare method (s):
- (void)sliderDidChangeValue:(id)sender { UISlider *slider = (UISlider *)sender;
yoninja
source share