Created
May 7, 2017 23:56
-
-
Save jen2/a2ef95ffc620504cb420a2cd29895e43 to your computer and use it in GitHub Desktop.
"Make a Custom UIGestureRecognizer in Objective-C" ViewController.m File and Selector Method.
This file contains 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
#import “ViewController.h” | |
#import “zLetterGestureRecognizer.h” | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[self.view addGestureRecognizer:[[ZLetterGestureRecognizer alloc] initWithTarget:self action:@selector(zLetterMade:)]]; | |
} | |
-(void)zLetterMade:(ZLetterGestureRecognizer *)zLetterRecognizer { | |
NSLog(@”Z letter made by the user!!”); //This will be printed when the gesture is recognized. | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment