I have a view derived from a UIScrollView controller that I use to view images in a library. It works great.
I overlaid the UIView on the right side to handle the strokes to quickly scroll through the list of images. My problem is that if I pass strokes through "super" or "nextResponder", they never fall into the UIScrollView object below.
My question is: how can I get the UIScrollView below to process strokes that I don't need to process? I set the timer to 0.3 seconds, during which time all touches are transferred to the UIScrollView for processing. Therefore, if a user runs a gesture to turn the page, this will happen.
Here is the code for the touchBegan method:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
touchesTimer = [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(showSlider:) userInfo:nil repeats:NO];
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:self.view];
lastPage = [self page:currentPoint.y];
if ([touch.view isKindOfClass:[UIScrollView class]])
{
if (self.nextResponder != nil &&
[self.nextResponder respondsToSelector:@selector(touchesEnded:withEvent:)])
{
[self.nextResponder touchesEnded:touches withEvent:event];
}
}
}