• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
      • From: Ben Kennedy <email@hidden>
References: 
 >Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired (From: Jeffrey Oleander <email@hidden>)

  • Prev by Date: Re: Changing the appearance of buttons
  • Next by Date: Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
  • Previous by thread: Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
  • Next by thread: Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
  • Index(es):
    • Date
    • Thread