Created
March 2, 2013 06:17
-
-
Save romyilano/5069912 to your computer and use it in GitHub Desktop.
Add a custom gesture recognizer to a view
from a raywenderlich tutorial
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)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