0

I have a UISlider with values from 0 to 5. I want the thumb to stop only at the exact values and not in between. Is moving the slider programmatically the only option? Or is there a property which governs this behavior?

SagarU
  • 426
  • 4
  • 15
  • There is a similar/identical question on stackoverflow: http://stackoverflow.com/questions/12834140/increment-uislider-by-1-in-range-1-to-100 – lahmar Jul 12 '13 at 14:20
  • That seems to be exactly what I wanted. Thanks. – SagarU Jul 12 '13 at 14:27

1 Answers1

0

Use function round to get the value from the slider

NSInteger value = (NSInteger)round(slider.value);
NSLog(@"Slider value is %d", value);
Vojtech Vrbka
  • 5,342
  • 6
  • 44
  • 63