Skip to content

Instantly share code, notes, and snippets.

@mluton
Created May 28, 2013 21:41
Show Gist options
  • Save mluton/5666378 to your computer and use it in GitHub Desktop.
Save mluton/5666378 to your computer and use it in GitHub Desktop.
Simple single-tap gesture recognizer
- (void)viewDidLoad
{
[super viewDidLoad];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapFrom:)];
[tapRecognizer setNumberOfTapsRequired:1];
[self.view addGestureRecognizer:tapRecognizer];
}
- (void)handleTapFrom:(UITapGestureRecognizer *)recognizer
{
// do stuff here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment