I already have a slider that controls the output of a text label.
-(IBAction)mySlider:(UISlider *)sender
{
_myTextLabel.text = [NSString stringWithFormat:@"%i", (int) sender.value];
}
However, I also want a stepper to be able to changer the slider's position. So, if the slider has been set to 50, and the text label says 50, I want the stepper to increment to 51, 52, 53, etc. Does anyone know the code to do this? Thanks!
You will need to keep an reference for the
UISlider
. Make a handler forUIStepper
with valueChanged event.Some settings that need to be done for both stepper and slider
Set minimum value and maximum value for both stepper and slider as 0 and 100 respectively. Set the step size of stepper as 1. Set the default value same for both stepper ans slider.