I've got a subclass of UISlider hooked up to a storyboard for valueChanged:
- (IBAction)valueChanged:(RSSlider*)slider {
// do some super cool stuff with my new value
}
And in my subclass viewDidLoad, I've got:
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sliderTapped:)];
[self addGestureRecognizer:gestureRecognizer];
And then in that same subclass, a nice tap handler that moves the slider along and updates the current value:
- (void)sliderTapped:(UIGestureRecognizer *)tap
{
if (self.highlighted)
return;
CGPoint locationInView = [tap locationInView: self];
CGFloat percentage = locationInView.x / self.bounds.size.width;
CGFloat delta = percentage * (self.maximumValue - self.minimumValue);
CGFloat value = self.minimumValue + delta;
[self setValue:value];
}
That's all OK, the value gets set, and life goes on. Only problem though, is that my Storyboard handler in the view controller (we'll call it a delegate, though clearly it's not really) never gets called.
How can I trigger an update to the handler method once the value has been changed via tap?