Skip to content

Instantly share code, notes, and snippets.

@jen2
Created May 7, 2017 23:36
Show Gist options
  • Save jen2/953a590707fe1c9e9ed3434c61f82dd2 to your computer and use it in GitHub Desktop.
Save jen2/953a590707fe1c9e9ed3434c61f82dd2 to your computer and use it in GitHub Desktop.
"Make a Custom UIGestureRecognizer in Objective-C" Touches Began Method.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
self.strokePrecision = 10.0; //A
if (touches.count > 1) {
self.state = UIGestureRecognizerStateFailed; // B
return;
}
self.firstTap = [touches.anyObject locationInView: self.view.superview]; //C
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment