Created
April 26, 2015 07:20
-
-
Save minsOne/8127a57c87eeffccea32 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
| //The setup code (in viewDidLoad in your view controller) | |
| UITapGestureRecognizer *singleFingerTap = | |
| [[UITapGestureRecognizer alloc] initWithTarget:self | |
| action:@selector(handleSingleTap:)]; | |
| [self.view addGestureRecognizer:singleFingerTap]; | |
| [singleFingerTap release]; | |
| //The event handling method | |
| - (void)handleSingleTap:(UITapGestureRecognizer *)recognizer { | |
| CGPoint location = [recognizer locationInView:[recognizer.view superview]]; | |
| //Do stuff here... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment