私はジェスチャーレコグナイザーを使用しています:
で初期化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.**