Graphics Programs Reference
In-Depth Information
How does a UIResponder not handle an event? It forwards the same message to its
nextResponder . That is what the default implementation of methods like
touchesBegan:withEvent: do. So if a method is not overridden, its next responder
will attempt to handle the touch event.
You can explicitly send a message to a next responder, too. Let's say there is a view that
tracks touches, but if a double tap occurs, its next responder should handle it. The code
would look like this:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
if ([touch tapCount] == 2) {
[[self nextResponder] touchesBegan:touches withEvent:event];
return;
}
... Go on to handle touches that aren't double taps
}
Search WWH ::




Custom Search