gestureRecognizer:shouldReceiveTouch: method isnt being called. Have i set it up improperly?
-(id) init
{
UILongPressGestureRecognizer *touchHold = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleTouchHold:)];
touchHold.minimumPressDuration = 1.0f;
touchHold.numberOfTouchesRequired = 1;
[[CCDirector sharedDirector].openGLView addGestureRecognizer:touchHold];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
return NO;
}
Press and hold method is still being called even though i set the bool to no.
Seems like you haven't set the delegate ?
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
Is the part of UIGestureRecognizerDelegate. So you should have set the delegate too.
touchHold.delegate = self;
Edit: You should tell your view controller to implement the UIGestureRecognizerDelegate. Something like
@interface YourViewController <UIGestureRecognizerDelegate>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With