- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//--------------------单击、双击----------------------
UITouch *touch = [touches anyObject];
NSUInteger tapCount = touch.tapCount;
if (tapCount == 1) {
[selfperformSelector:@selector(singleTap) withObject:nilafterDelay:0.2];//0.2或者0.3 根据自己的感官调整
}
else if(tapCount == 2) {
[NSObjectcancelPreviousPerformRequestsWithTarget:selfselector:@selector(singleTap) object:nil];
[self doubleTap];
}
}
加粗的方法就是双击和双击你要实现的功能的方法