Swipe to Delete not working

后端 未结 7 2271
说谎
说谎 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:48

    The key to make it work is to implement:

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

    And remember to put it inside "UITableViewDataSource" instead of "UITableViewDelegate"

提交回复
热议问题