I have a slider that when it begins to change the values, another label shows up (lets the user see what they are doing). The only problem is that I need to know when the user has finished editing the slider so I can make that UILabel go away again. Is there a way to do this? The code below shows what I do when the sliders value begins to change. Thank you for you help!
- (IBAction)sliderValueChanged:(UISlider *)sender {
tipPercentLabel.text = [NSString stringWithFormat:@"%.f", ([sender value] * 100)];
tipPercentLabel2.text = [NSString stringWithFormat:@"%.f", ([sender value] * 100)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[tipPercentLabel setAlpha:0.3];
[tipPercentLabel2 setAlpha:1.0];
[UIView commitAnimations];
[self performSelector:@selector(autoTipCalc) withObject:nil afterDelay:0.01];
}
You have already added one target/action pair for UIControlEventValueChanged, all you need to do is call addTarget:action:forControlEvents: again with a different selector and a control event of UIControlEventTouchUpInside (or any other that you're interested in).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With