【发布时间】:2010-07-23 00:22:38
【问题描述】:
我正在使用手势识别器:
在viewDidLoad中初始化:
UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[self.view addGestureRecognizer:longPressRecognizer];
这是longPress 的样子:
- (void)longPress:(UILongPressGestureRecognizer*)gestureRecognizer {
if (gestureRecognizer.minimumPressDuration == 2.0) {
NSLog(@"Pressed for 2 seconds!");
}
}
我怎样才能把它和它联系起来?
- (void)tableView:(UITableView *)tblView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
didSelectRowAtIndexPath 将如何获得对gestureRecognizer.minimumPressDuration 的引用?
基本上我想要实现的是:
**If a user clicks on a cell, check to see if the press is 2 seconds.**
【问题讨论】:
标签: iphone objective-c cocoa-touch uitableview uigesturerecognizer