Skip to content

Instantly share code, notes, and snippets.

@drpancake
Created December 12, 2012 05:56
Show Gist options
  • Save drpancake/4265191 to your computer and use it in GitHub Desktop.
Save drpancake/4265191 to your computer and use it in GitHub Desktop.
How to use a block instead of a selector for target-action.
UITapGestureRecognizer *recogizer = [[UITapGestureRecognizer alloc] initWithTarget:^{
NSLog(@"Hello!");
} action:@selector(invoke)];
[myView addGestureRecognizer:recogizer];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment