/ Published in: Objective C
How to detect user's taps on any UIView
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (void) tapHandler: (UITapGestureRecognizer *)gesture { NSLog(@"This is a tap ..."); } UITapGestureRecognizer *g = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(tapHandler:)]; g.numberOfTapsRequired = 1; // How many taps g.numberOfTouchesRequired = 1; // How many fingers [uiTableView addGestureRecognizer: g]; }