伙计们,我想为触摸设置动作。如果人们进行单触 - 一个动作,否则 - 不同。我在 touchesBegan 方法中编写了这段代码:
UITouch *touch = [event.allTouches anyObject];
BOOL tappedTwice = NO;
if ([touch tapCount] == 2) {
tappedTwice = YES;
NSLog(@"double touch");
}
else if ([touch tapCount] == 1 && !tappedTwice) {
NSLog(@"single touch");
}
但它正在检测单次触摸,然后是双次触摸,但在我的情况下它是不正确的。你有什么想法吗?