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 设置文件
- 下一篇: 订阅广告一个微博大号的微信生存记