How can I detect a double tap on a certain cell in UITableView?

后端 未结 14 1027
悲哀的现实
悲哀的现实 2020-12-01 00:18

How can I detect a double tap on a certain cell in UITableView?

i.e. I want to perform one action if the user made a single touch and a

14条回答
  •  粉色の甜心
    2020-12-01 00:49

    Another answer

    int touches;
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
      touches++;
    
        if(touches==2){
           //your action
        }
    }
    
    - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        touches=0;
    }
    

提交回复
热议问题