Posted By

ramonprades on 03/20/11


Tagged

gestures


Versions (?)

Tap Gesture Recognizer


 / Published in: Objective C
 

How to detect user's taps on any UIView

  1. - (void) tapHandler: (UITapGestureRecognizer *)gesture {
  2. NSLog(@"This is a tap ...");
  3. }
  4.  
  5. UITapGestureRecognizer *g = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(tapHandler:)];
  6. g.numberOfTapsRequired = 1; // How many taps
  7. g.numberOfTouchesRequired = 1; // How many fingers
  8. [uiTableView addGestureRecognizer: g];
  9. }

Report this snippet  

You need to login to post a comment.