Is it possible to programmatically show the red delete button on a UITableViewCell?

后端 未结 4 1939
傲寒
傲寒 2020-12-29 21:41

There are lots of similar questions on here, but none that I think specifically ask this question, which is, is there any way in code to force the red delete button to appea

4条回答
  •  一向
    一向 (楼主)
    2020-12-29 22:30

    In the doubleFingerSwipe gesture's selector method set one variable and assign as no of row swiped and reload the table . In the

    - (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.row == yourVariable) return UITableViewCellEditingStyleDelete;
        else return UITableViewCellEditingStyleNone;
    }
    

    I think thats work for ur problem.

提交回复
热议问题