1

Somewhere towards the bottom of my view hierarchy, I am implementing a touchesBegan method. It fires on all touches except for single finger taps. This leads me to believe that somewhere higher up in the hierarchy, a view is intercepting/handling the single finger taps, but I can't find the view for the life of me. Is there a good way of debugging this?

Mark S
  • 2,509
  • 1
  • 14
  • 7
  • Do you think hitTest:withEvent: will be helpful? Look at this thread http://stackoverflow.com/questions/4961386/event-handling-for-ios-how-hittestwithevent-and-pointinsidewithevent-are-r . – sridevi Jan 15 '13 at 20:51
  • Unfortunately `hitTest:withEvent:` returns the view that is not receiving the tap. It does not appear to be affected by the gesture recognizer. – Mark S Jan 16 '13 at 20:28

1 Answers1

0

Try this way, if it work out:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint touchLocation = [touch locationInView:self.contentView];

    for (UIView *view in self.contentView.subviews)
    {
        if ([view isKindOfClass:[MyCustomView class]] &&
            CGRectContainsPoint(view.frame, touchLocation))
        {

        }
    }
}
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
  • Unfortunately, `touchesMoved` does not get called either for the tap. No touch methods are being called on a single-finger tap. They all work perfectly for multi-finger taps or pans or any other touch other than a single-finger tap. – Mark S Jan 15 '13 at 18:45