UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
- Subject: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
- From: Ben Kennedy <email@hidden>
- Date: Tue, 08 Nov 2011 12:56:03 -0800
From http://developer.apple.com/library/ios/#documentation/uikit/reference/UITapGestureRecognizer_Class/Reference/Reference.html :
> Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the associated action message is sent when the gesture begins and is sent for each intermediate state until (and including) the ending state of the gesture. Code that handles tap gestures should therefore test for the state of the gesture, for example:
>
> - (void)handleTap:(UITapGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateEnded) { // handling code } }
This suggests that if I set numberOfTapsRequired = 2, I should be able to get action for both a single tap (i.e. the first of a pair of taps), as well a double-tap. However, in iOS 5 this does not appear to be the case; my action method is not called until the numberOfTapsRequired has been satisfied.
In order to respond to both a single and double tap, do I thus need to attach two gesture recognizers?
Do I mis-understand the doc, or has behaviour changed since it was written?
cheers,
-b
--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden