Skip to content

Instantly share code, notes, and snippets.

@C4Code
Created March 9, 2013 19:47
Show Gist options
  • Save C4Code/5125479 to your computer and use it in GitHub Desktop.
Save C4Code/5125479 to your computer and use it in GitHub Desktop.
Simple test of TAP gesture. All gestures are set, by default, to delay the touchesBegan method in the object to which they are attached. Uncomment lines 4 and 5 to see the difference.
@implementation C4WorkSpace
-(void)setup {
[self addGesture:TAP name:@"tap" action:@"tapped"];
//UIGestureRecognizer *g = [self gestureForName:@"tap"];
//g.delaysTouchesBegan = NO;
}
-(void)tapped {
C4Log(@"Called when the gesture recognizes a tap");
}
-(void)touchesBegan {
C4Log(@"Called only if g.delaysTouchesBegan == NO");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment