Tap gesture fires on single tap before conforming to double tap requirement
<p>I've looked at previous answers to this question, but the solutions don't seem to work in my case (e.g. adding a requirement for the gesture recognizer to fail).</p>

<p>I have hooked up my view to a tap gesture recognizer, and I'm trying to use the following handler in my code:</p>

<pre><code>@IBAction func doubleTapView(gesture: UITapGestureRecognizer) {
    gesture.numberOfTapsRequired = 2

    if gesture.state == .Ended {
        print("Works")
    }
}
</code></pre>

<p>This is what happens:</p>

<p>The first tap will print "Works".
From then on, it will require the double-tap to print "Works"</p>

<p>How do I eliminate it printing on the first tap before it defaults to the correct and intended behaviour?</p>