title: How can I shorten the time "delayTouchesBegan" delays touchesBegan?
body: <p>In one of my view controllers I have several views that contain a UITapGestureRecognizer, along with an implementation of <code>touchesBegan</code>. I need to prioritize the taps over <code>touchesBegan</code> so I set the <code>delaysTouchesBegan</code> property of the gesture recognizers to <code>YES</code>. This works correctly, but there's one problem: the gesture recognizer delays <code>touchesBegan</code> for too long. According to the <a href="https://developer.apple.com/LIBRARY/IOS/documentation/UIKit/Reference/UIGestureRecognizer_Class/Reference/Reference.html#jumpTo_4" rel="noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>When the value of the property is YES, the window suspends delivery of touch objects in the UITouchPhaseBegan phase to the view. If the gesture recognizer subsequently recognizes its gesture, these touch objects are discarded. If the gesture recognizer, however, does not recognize its gesture, the window delivers these objects to the view in a touchesBegan:withEvent: message (and possibly a follow-up touchesMoved:withEvent: message to inform it of the touches’ current locations).</p>
  </blockquote>
  
  <p>The problem basically is that when the gesture recognizer does not recognize the gesture and delivers these objects to <code>touchesBegan</code>, that operation takes too long. Is there anyway to expedite it, or is it just that the processing of the gesture to determine whether it's a tap is intensive and is impossible to shorten?</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p>Here's some more info. This is the code I use to setup the gesture recognizer:</p>
  
  <pre><code>UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
  tapRecognizer.cancelsTouchesInView = NO;
  tapRecognizer.delaysTouchesBegan = YES;
  tapRecognizer.delegate = self;
  tapRecognizer.numberOfTapsRequired = 1;
  tapRecognizer.numberOfTouchesRequired = 1;
  [self.someView addGestureRecognizer:tapRecognizer];
  </code></pre>