Skip to content

Instantly share code, notes, and snippets.

@jen2
Created May 7, 2017 23:56
Show Gist options
  • Save jen2/a2ef95ffc620504cb420a2cd29895e43 to your computer and use it in GitHub Desktop.
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.
#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