how do i count double tap in simulator?
+1
A:
Implement one of the touch functions defined in UIResponder (touchesBegan, touchedEnded, etc...). When you get the touches array, you can get a UITouch's tap count using code like this:
UITouch * t = [touches anyObject];
NSLog(@"%d", [t tapCount]);
Ben Gotow
2009-06-25 15:53:50
it always show one in simulator
Rahul Vyas
2009-06-27 05:24:53
Hey! Sorry if this is stupid - but you quickly clicked twice in the same place on the screen, right? It should work in both the simulator and the device.
Ben Gotow
2009-06-27 16:17:14
+3
A:
- (void) touchesBegan:(NSSet *) touches withEvent:(UIEvent *) event
{
UITouch *touch = [touches anyObject];
if (touch.tapCount == 2)
{
// do your stuff here
}
}
Marco Mustapic
2009-06-25 16:03:27