Swipe to Delete not working

后端 未结 7 2051
说谎
说谎 2021-02-20 15:55

The swipe to delete functionality is not working in my table view. I have implemented the commitEditingStyle delegate and the Edit button in the navigation bar. Hence when the u

7条回答
  •  南笙
    南笙 (楼主)
    2021-02-20 16:34

    You'll need to implement:

    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
    
    
    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
    
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;
    

    With these three things you should be good to go. (I missed off the commitEditingStyle and it never worked.

提交回复
热议问题