• 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
Double tap inside a UICollectionViewCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Double tap inside a UICollectionViewCell


  • Subject: Double tap inside a UICollectionViewCell
  • From: koko <email@hidden>
  • Date: Wed, 01 May 2013 18:23:10 -0600

The code below from Collection View Programming Guide for iOS: Incorporating Gesture Support does not work as expected.  Is there something Apple has left out?

Does not work as expected means @selector(handleTapGesture:)is not called if a double tap occurs in a UICollectionViewCell.  @selector(handleTapGesture:) is called if the double tap occurs outside a UICollectionViewCell.

The question is how to get a double tap inside a UICollectionViewCell.

-koko


    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
    NSArray* recognizers = [self.collectionView gestureRecognizers];
    for (UIGestureRecognizer* aRecognizer in recognizers)
    {
        if ([aRecognizer isKindOfClass:[UITapGestureRecognizer class]])

            [aRecognizer requireGestureRecognizerToFail:tapGesture];
    }
    [tapGesture setNumberOfTapsRequired:2];
    [self.collectionView addGestureRecognizer:tapGesture];

_______________________________________________

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

  • Prev by Date: Re: Close All Documents
  • Next by Date: Re: View Based TableView - how to use bindings?
  • Previous by thread: Re: Close All Documents
  • Next by thread: Re: Double tap inside a UICollectionViewCell
  • Index(es):
    • Date
    • Thread