Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created March 2, 2013 06:17
Show Gist options
  • Select an option

  • Save romyilano/5069912 to your computer and use it in GitHub Desktop.

Select an option

Save romyilano/5069912 to your computer and use it in GitHub Desktop.
Add a custom gesture recognizer to a view from a raywenderlich tutorial
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
for (UIView *view in self.view.subviews)
{
// this is how you programmatically add a gustom gesture recognizer
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
recognizer.delegate=self;
[view addGestureRecognizer:recognizer];
// todo - add a custom gesture recognizer too
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment