Created
December 12, 2012 05:56
-
-
Save drpancake/4265191 to your computer and use it in GitHub Desktop.
How to use a block instead of a selector for target-action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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