title: Custom UIGestureRecognizer for a two finger gesture
body: <p>I have a custom UIGestureRecognizer for a two finger gesture that works perfectly except for it being very picky about how simultaneously the fingers have to touch the iOS-device for <code>touchesBegan</code> to be called with 2 touches. <code>touchesBegan</code> is often called with only one Touch even though I am trying to use two fingers.</p>
  
  <p>Is there any way to make recognition for the number of Touches more forgiving in regards to how simultaneously you have to place your fingers on the touch screen?</p>
  
  <p>I've noticed that a two finger tap is recognized even when you place first one finger and then another much later while still holding the first finger down.</p>
  
  <p>Here is the code for my <code>touchesBegan</code> function:</p>
  
  <pre><code>override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent) {
  
        if touches.count != 2 {
           state = .failed
           return
        }
  
        // Capture the first touch and store some information about it.
        if trackedTouch == nil {
           trackedTouch = touches.min { $0.location(in: self.view?.window).x &lt; $1.location(in: self.view?.window).x }
           strokePhase = .topSwipeStarted
           topSwipeStartPoint = (trackedTouch?.location(in: view?.window))!
           // Ignore the other touch that had a larger x-value
           for touch in touches {
              if touch != trackedTouch {
                 ignore(touch, for: event)
              }
           }
        }
     }
  </code></pre>