1
votes

I encountered this problem and was able to resolve it as described.

Gesture recognizer and button actions

But when I added a second UIGestureRecognizer to the same UIView the UIButton selector is not called for the second UIGestureRecognizer, only the first.

So I have a single UIView with two UIGestureRecognizers. There is a UIButton on the UIView.

The UIButton selector always get called correctly after the first UIGestureRecognizer. The first touch on the UIButton for the second UIGestureRecognizer does nothing, but the second touch on the UIButton works as expected.

If I remove the first UIGestureRecognizer from the view then the first UIButton press fires the selector as expected after the second gesture is performed.

Any idea why the first touch on the UIButton doesn't fire the selector but the second does?

1
You should post the relevant code.Philippe Sabourin

1 Answers

1
votes

try to put his delegate method in your viewController

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

returning YES to this method is guaranteed to allow simultaneous recognition.