I am trying to implement some form of snapping or steps with the UISlider. I have written the following code but it does not work as smooth as I hoped for. It works, but whe
A really simple one:
- (void)sliderUpdated:(UISlider*)sli { CGFloat steps = 5; sli.value = roundf(sli.value/sli.maximumValue*steps)*sli.maximumValue/steps; }
Great if you want a fast solution and you've added the target by UIControlEventValueChanged.