Rav*_*vin 11
- (void) buttonTouchDownRepeat:(id)sender event:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if(touch.tapCount == 2) {
NSLog(@"Twice");
}
else {
NSLog(@"otherwise");
}
}
Run Code Online (Sandbox Code Playgroud)
在IB或代码中,将操作连接到按钮的UIControlEventTouchDownRepeat事件.action方法应该有这样的签名:
- (void) buttonTouchDownRepeat:(id)sender event:(UIEvent *)event
Run Code Online (Sandbox Code Playgroud)
在方法的实现中,您可以访问UITouch实例,[[event allTouches] anyObject]然后检查触摸的tapCount值.
| 归档时间: |
|
| 查看次数: |
4562 次 |
| 最近记录: |