UITableView disable swipe to delete, but still have delete in Edit mode?

后端 未结 7 1923
面向向阳花
面向向阳花 2020-12-07 10:33

I want something similar as the Alarm app, where you can\'t swipe delete the row, but you can still delete the row in Edit mode.

When commented out tableView:commitE

7条回答
  •  爱一瞬间的悲伤
    2020-12-07 11:05

    Just to make things clear, swipe-to-delete will not be enabled unless tableView:commitEditingStyle:forRowAtIndexPath: is implemented.

    While I was in development, I didn't implement it, and therefore swipe-to-delete wasn't enabled. Of course, in a finished app, it would always be implemented, because otherwise there would be no editing.

提交回复
热议问题