how to count tap in simulator?
-
20-08-2019 - |
Question
how do i count double tap in simulator?
Solution
- (void) touchesBegan:(NSSet *) touches withEvent:(UIEvent *) event
{
UITouch *touch = [touches anyObject];
if (touch.tapCount == 2)
{
// do your stuff here
}
}
OTHER TIPS
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]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow