Skip to content

Instantly share code, notes, and snippets.

@warriorg
Created September 18, 2013 05:18
Show Gist options
  • Save warriorg/6604847 to your computer and use it in GitHub Desktop.
Save warriorg/6604847 to your computer and use it in GitHub Desktop.
//The setup code (in viewDidLoad in your view controller)
UITapGestureRecognizer *singleFingerTap =
[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(handleSingleTap:)];
[self.view addGestureRecognizer:singleFingerTap];
[singleFingerTap release];
//The event handling method
- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer {
CGPoint location = [recognizer locationInView:[recognizer.view superview]];
//Do stuff here...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment