Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gesture settings not taking effect #45

Closed
traviskirton opened this issue Apr 8, 2012 · 1 comment
Closed

Gesture settings not taking effect #45

traviskirton opened this issue Apr 8, 2012 · 1 comment

Comments

@traviskirton
Copy link
Collaborator

for the following code:

myCustomShape = [CustomShape new];
[myCustomShape rect:CGRectMake(284, 412, 200, 200)];

[myCustomShape addGesture:TAP name:@"singleTap" action:@"methodA"];
[myCustomShape addGesture:TAP name:@"doubleTap" action:@"methodB"];

[myCustomShape numberOfTapsRequired:1 forGesture:@"singleTap"];
[myCustomShape numberOfTapsRequired:2 forGesture:@"doubleTap"];

[self.canvas addShape:myCustomShape];

the gestures aren't setting the right number of taps...

the @"doubleTap" gesture triggers only with a single tap

@traviskirton
Copy link
Collaborator Author

Fixed...

The following works...

#import "C4WorkSpace.h"

@interface C4WorkSpace ()
-(void)tap;
@end

@implementation C4WorkSpace 

-(void)setup {
    [self addGesture:TAP name:@"tapGesture" action:@"tap"];
    [self numberOfTapsRequired:2 forGesture:@"tapGesture"];
    [self numberOfTouchesRequired:2 forGesture:@"tapGesture"];
}

-(void)tap {
    C4Log(@"tapped");
}
@end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant