iOS UITableViewCell上的双击事件

来源:互联网 发布:专业淘宝货源批发市场 编辑:程序博客网 时间:2024/05/22 11:34
- (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;  } 

0 0
原创粉丝点击