tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)]; tapGesture.numberOfTapsRequired = 2; tapGesture.numberOfTouchesRequired = 1;
[self.view addGestureRecognizer:tapGesture]; [tapGesture release];
and
- (void)handleTapGesture:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateRecognized) {
// handling code
NSLog(@"We got double tap here");
DashBoardViewController* dashboardObj = [[DashBoardViewController alloc] initWithNibName:@"DashBoardViewController" bundle:nil];
[self.navigationController pushViewController:dashboardObj animated:YES];
}
what i am trying to do is , i want to call 2 different events on single tap and on double tap. So how can i detect when tap==1 and tap==2? Double tap is recognised in my code, but i am not sure, how to find and work,when a single tap is find.
Thanks