So, I have this slider in my view and it has a maximum of 13 and minus 1. Depending on how you move the slider, the number changes and can be displayed on a label that shows the current number on which the slider is installed,
I want to be able to change int from slider to string; therefore, if the slider move is 13, I want the label to read “A +”, 12 with “A”, 11 with “A-”, etc.
Without the need to do 13-inch instructions, because I have more than one slider, is there a way to make a method that checks the progress of the slider, then converts the number to the desired letter class?
here is my code for one of the sliders
-(IBAction)sliderChanged:(id)sender{
UISlider *slider = (UISlider *)sender;
int progress = (int)roundf(slider.value);
c1Grade.text = [NSString stringWithFormat:@"%d",progress];
}
source