Tap Gesture Recognizer


/ Published in: Objective C
Save to your folder(s)

How to detect user's taps on any UIView


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.