Search code examples
iosobjective-ctouches

iPhone: touches on UIViewController


I have a UIViewController, on top I put an UIImageView, then a UIScrollView.

I can process touches on the UIScrollView just fine, however I want to process certain touches on the UIViewController.

I only need touches on the UIScrollView that are held for 5 seconds (This part works fine). Anything less than that I want to pass to the UIViewController.

On the UISCrollView I call this:

- (void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{
// some custom code to process a specific touch.

// all other touches
    [super touchesBegan: touches withEvent: event];
}

Is there a way to pass touches from the UIScrollView to the bottom UIViewController, or do I have to pass a references to the UIViewController into the UIScrollView?


Solution

  • Solved!

    Needed to add:

    [self.nextResponder touchesEnded: touches withEvent:event]; 
    

    to the top most controller.

    Thank you to myself!