Miss a single tap randomly
Posted
by pion
on Stack Overflow
See other posts from Stack Overflow
or by pion
Published on 2010-04-07T22:46:04Z
Indexed on
2010/04/07
22:53 UTC
Read the original article
Hit count: 397
I have the following code snippets
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
NSUInteger numberTaps = [touch tapCount];
// Tapping
if (numberTaps > 0) {
// do something
}
...
The above code basically detects a single tap on a small image (width = 18 and height = 36). It works 90% of the time detecting a single tap.
But it sometime misses it (randomly). I have to tap several times before it picks up the single tap.
What did I do wrong or miss so I could consistently detect the single tap 100%?
Thanks in advance for your help.
© Stack Overflow or respective owner