I want to add to my UIViewController
:
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; tapGesture.numberOfTapsRequired = 2; [self.view addGestureRecognizer:tapGesture]; [tapGesture release]; UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture2:)]; tapGesture2.numberOfTapsRequired = 1; [self.view addGestureRecognizer:tapGesture2]; [tapGesture2 release];
the problem is that the user presses two methods twice, and I want that if the user double-clicks only the first one will be called (handleTapGesture), and if he makes one tap, he will only call the second one (handleTapGesture2)
source share