- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
tableSelection = indexPath;
tapCount++;
switch (tapCount)
{
case 1: //single tap
[self performSelector:@selector(singleTap) withObject: nil afterDelay: .4];
break;
case 2: //double tap
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTap) object:nil];
[self performSelector:@selector(doubleTap) withObject: nil];
break;
default:
break;
}
}
- (void)singleTap
{
tapCount = 0;
}
- (void)doubleTap
{
tapCount = 0;
}
iOS UITableViewCell上的双击事件
最新推荐文章于 2021-01-12 12:46:04 发布