By utilizing two methods, connecting the TouchDownRepeat event of a slider to one (doubleTapSlider) and TouchUpInside event of the same slider to another (releaseSliderBtn), I was able to get the exact functionality I was looking for. I needed this for three separate sliders, so I assigned them tags of 5, 6 & 7 in Interface Builder to detect which one was calling my methods.
User double-taps a slider ball, which moves the ball back to the center and sets the label to 100. If I didn't have the releaseSliderBtn method, when the user released the second tap, the label would stay at 100, but the ball would jump back to where the user released the second tap. Now, by checking the label's current text, when the user releases the second tap, the ball remains at the center location. Slider 1's range is 50~150. Slider 2's range is -12~+12. Slider 3's range is -49~+49.
FYI: For some reason, 'else if' wasn't working for releaseSliderBtn, so that's why I made them three separate if statements.
-(IBAction)doubleTapSlider:(id)sender {
printf ("Sender: %d\n", [sender tag]);
if([sender tag] == 5){
playbackSpeedSlider.value = 100;
playbackSpeedLabel.text = @"100";
} else if ([sender tag] == 6) {
halfStepSlider.value = 0;
halfStepLabel.text = @"0";
} else if ([sender tag] == 7) {
centsSlider.value = 0;
centsLabel.text = @"0";
}
}
-(IBAction)releaseSliderBtn:(id)sender {
printf ("Sender: %d\n", [sender tag]);
if([sender tag] == 5){
if(playbackSpeedLabel.text == @"100"){
playbackSpeedSlider.value = 100;
}
}
if ([sender tag] == 6) {
if(halfStepLabel.text == @"0"){
halfStepSlider.value = 0;
}
}
if ([sender tag] == 7) {
if(centsLabel.text == @"0"){
centsSlider.value = 0;
}
}
}