Increment UISlider by 1 in range 1 to 100
//Only generate update events on release
slider.continuous = NO;
//Round the value and set the slider
- (IBAction)sliderChange:(id)sender
{
int rounded = sender.value; //Casting to an int will truncate, round down
[sender setValue:rounded animated:NO];
NSLog(@"%f", sender.value);
}
you could try this:
float RoundValue(UISlider * slider) {
return roundf(slider.value * 2.0) * 1;
}