Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
- Subject: Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
- From: Conrad Shultz <email@hidden>
- Date: Tue, 08 Nov 2011 14:17:58 -0800
On 11/8/11 1:14 PM, Jeffrey Oleander wrote:
>> In order to respond to both a single and double tap, do I
>> thus need to attach two gesture recognizers?
>
> Go another layer more primitive:
Please don't drop down to UITouch unless you have to (which mainly means
if you are supporting pre-UIGestureRecognizer devices).
As for your issue of single vs. double taps, from the class reference:
"For the gesture to be recognized, the specified number of fingers must
tap the view a specified number of times."
I'm not sure why you aren't receiving intermediate messages, but trying
to key off intermediates is not a great pattern anyway. Just attach two
gesture recognizers, then you have the benefit of separating your action
methods (which will be nice if you decide to change gestures later on).
If you want to suppress the single tap action in the event of a double
tap, employ the –requireGestureRecognizerToFail: method when setting up
the recognizers, paying special attention to the notes ("Requiring a
Gesture Recognizer to Fail") on this matter in the Event Handling Guide
(http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html).
--
Conrad Shultz
Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________
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