I am using gesture recognizers:
Initialize in viewDidLoad
:
UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[self.view addGestureRecognizer:longPressRecognizer];
This is what longPress
looks like:
- (void)longPress:(UILongPressGestureRecognizer*)gestureRecognizer {
if (gestureRecognizer.minimumPressDuration == 2.0) {
NSLog(@"Pressed for 2 seconds!");
}
}
How can I tie this into?
- (void)tableView:(UITableView *)tblView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
How will didSelectRowAtIndexPath get a reference to gestureRecognizer.minimumPressDuration
?
Basically what I'm trying to achieve is:
**If a user clicks on a cell, check to see if the press is 2 seconds.**