我想在用户触摸视图时检测JUST双击/单击。只用UIViews检测双击或单击?
我做了这样的事情:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint prevLoc = [touch ]
if(touch.tapCount == 2)
NSLog(@"tapCount 2");
else if(touch.tapCount == 1)
NSLog(@"tapCount 1");
}
但它总是前2分接头检测1次点击。我怎样才能检测到只有1/2的水龙头?
我觉得这是更好的办法。 http://stackoverflow.com/questions/7175086/iphone-single-tap-gesture-conflicts-with-double-one – KJLucid