UITableView tap to deselect cell

前端 未结 14 1728
野性不改
野性不改 2020-12-16 10:37

I have a UITableViewCell that is selected when tapped. During this selected state, if the user taps the cell again, I want the cell to deselect.

I can\

14条回答
  •  天涯浪人
    2020-12-16 11:28

    When using "Multiple Selection" mode, "didSelectRowAtIndexPath" will not be called when you click a row that is already selected. More than one row can still be selected programatically in "Single Selection" mode and the rows will trigger didSelectRowAtIndexPath on all clicks.

    Just a heads up to anyone who was having the same problems.

提交回复
热议问题