title: Fast tap gestures in Swift 4 and iOS 11
body: <p>I just made a simple app to try out any type of gestures. I got to the tap gesture. So I thought, what if I made a fast tap game kind of application that counts the amount of taps the user performed. But soon enough I ran into some issues. </p>
  
  <p>It did not count all the taps. If I began to tap as fast as possible, but it skipped taps. </p>
  
  <p>The idea is I programmatically created a view in the superview and added a tapGestureRecognizer on the view. And simply put the “taps” into a label in the app. </p>
  
  <p>It seems to fail to receive a system gesture on time. </p>
  
  <p>The code:</p>
  
  <pre><code>let tap = UITapGestureRecognizer(target: self, action: #selector(tapped(sender:)));
      tap.numberOfTapsRequired = 1;
      animationView.isUserInteractionEnabled = true;
      animationView.addGestureRecognizer(tap);
  </code></pre>
  
  <p>The function:</p>
  
  <pre><code>@objc func tapped (sender :UITapGestureRecognizer) {
     self.counter += 1;
     self.lblScore.text = String(self.counter);
  }
  </code></pre>
  
  <p>I have an animationView that I made "tappable" and it works. Every time I tap the animationView it increments the value of 'counter' that works! but every time I get this error if I tap too fast:</p>
  
  <pre><code>&lt;_UISystemGestureGateGestureRecognizer: 0x1c01c4b00&gt;: Gesture: Failed to receive system gesture state notification before next touch
  </code></pre>