Greetings, Sparrow community!
What is the best way to correctly handle different types of "click" events? In particular, i'm trying to have my code react differently to a single tap vs. double tap. The logic looks roughly like this:
touches = [[event touchesWithTarget:self andPhase:SPTouchPhaseEnded] allObjects]; if (touches.count == 1) { SPTouch *touch = [touches objectAtIndex:0]; if (touch.tapCount == 1) { NSLog(@"clicked."); //... } else if (touch.tapCount == 2) { NSLog(@"double clicked!"); //... } }
This works, but with a caveat that when i do a double-tap, two 2 events are generated instead of one, and i see this in the log window:
2011-10-27 09:33:09.016 MaximQuad[4232:207] clicked.
2011-10-27 09:33:09.192 MaximQuad[4232:207] double clicked!
Is there a way to have Sparrow only generate one event (double-tap)?
Thanks.