How can I tell a UIGestureRecognizer to cancel an existing touch?

This little trick works for me.

@implementation UIGestureRecognizer (Cancel)

- (void)cancel {
    self.enabled = NO;
    self.enabled = YES;
}

@end

From the UIGestureRecognizer @enabled documentation:

Disables a gesture recognizers so it
does not receive touches. The default
value is YES. If you change this
property to NO while a gesture
recognizer is currently recognizing a
gesture, the gesture recognizer
transitions to a cancelled state.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)