title: Maintaining state between touches in custom UIGestureRecognizer
body: <p>I'm implementing a custom <code>UIGestureRecognizer</code>, which does a few things including recognizing a double tap. I'm trying to keep track of whether it's a double tap by keeping track of the number of taps as a local variable of the custom gesture class.</p>
  
  <p>Naturally, as the user initiates a double tap, they have to lift the finger in-between the taps, which causes <code>touchesEnded</code> to be called. However, this always seems to also trigger <code>reset()</code> to be called as well, which I've implemented to reset all my local state (as I should so the state is cleared when the recognizer has indeed properly ended). Due to this, I'm not able to keep track of whether there was a prior tap each time <code>touchesBegan</code> is called.</p>
  
  <p>Is there a proper way to implement this? I guess I'm just curious how <code>UITapGestureRecognizer</code> is implementing multiple taps within one recognizer session.</p>