ios 单击和双击
- (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];
}
}
加粗的方法就是双击和双击你要实现的功能的方法
转载于:https://www.cnblogs.com/mohe/archive/2013/05/17/3084180.html
总结
- 上一篇: 修改nullMyEclipse 设置文件
- 下一篇: 订阅广告一个微博大号的微信生存记