ACB quotes the UIGestureRecognizer reference. To make it more specific, suppose you have a view with gestures attached, and you have these methods in your view controller:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesBegan"); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesMoved"); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesEnded"); } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesCancelled"); } - (IBAction)panGestureRecognizerDidUpdate:(UIPanGestureRecognizer *)sender { NSLog(@"panGesture"); }
And, of course, the calendar gesture recognizer is configured to send the panGestureRecognizerDidUpdate: message.
Now suppose you touch the view, just move your finger to recognize the panorama gesture, and then lift your finger. What does the application print?
If the gesture recognizer has cancelsTouchesInView set to YES , the application will record these messages:
touchesBegan touchesMoved touchesCancelled panGesture panGesture (etc.)
You can get more than one touchesMoved before canceling.
So, if you set cancelsTouchesInView to YES (by default), the system will cancel the touch before it sends the first message from the gesture recognizer, and you will not receive any more touch messages for that touch.
If the gesture recognizer has cancelsTouchesInView set to NO , the application will record these messages:
touchesBegan touchesMoved panGesture touchesMoved panGesture touchesMoved panGesture (etc.) panGesture touchesEnded
So, if you set cancelsTouchesInView to NO , the system will continue to send touch messages to touch gestures, alternating with gesture recognizer messages. The touch will end normally and not be canceled (if the system does not cancel the touch for any other reason, for example, pressing the home button while touching).