Created
January 3, 2015 06:53
-
-
Save wethu/06c3e6b228355b98f380 to your computer and use it in GitHub Desktop.
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
| - (void) someSetupMethod { | |
| UIView *view = [UIView new]; | |
| view.userInteractionEnabled = YES; | |
| // Target is self, self is the controller that you're in right now and will call the method iGotTapped: on itself. | |
| UIGestureRecognizer *tap = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(iGotTapped:)]; | |
| // addGesture to view | |
| [view addGestureRecognizer:tap]; | |
| } | |
| - (void)iGotTapped:(UIView *)sender { | |
| NSLog(@"I'm UIView %@", sender); | |
| // Do stuff with it | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment