I am adding two gesture recognizers to a view with the code below. What I want is: if the user taps once one thing happens. If they tap twice another thing happens.
As it is, the single tap action occurs whether the user taps once or twice. In other words when I double tap I get two actions, instead of one as I would prefer
differentiate
//gesture recognizer.
UITapGestureRecognizer *tapRecognizerShowHideMenu = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doOneThing)];
[tapRecognizerShowHideMenu setDelegate:self];
[tapRecognizerShowHideMenu setNumberOfTapsRequired:1];
[self.view addGestureRecognizer:tapRecognizerShowHideMenu];
UITapGestureRecognizer *tapRecognizerEditEffect = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doAnotherThing)];
[tapRecognizerEditEffect setDelegate:self];
[tapRecognizerEditEffect setNumberOfTapsRequired:2];
[self.view addGestureRecognizer:tapRecognizerEditEffect];