didSelectRowAtIndexPath: not being called

前端 未结 14 2281
轻奢々
轻奢々 2020-11-29 18:57

I have a UITableView as a subview of my UIScrollVIew, which is the main view controlled by my MainViewController.

In MainView

14条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 19:21

    A cell can be selected by the user (tapping on the row), by calling "tableView.selectRowAtIndexPath(..)" or "cell.setSelected(true, ...).

    • If the cell is selected by calling "cell.setSelected(true)", the user cannot deselect the cell anymore.

    • If the cell is selected by calling "tableView.selectRowAtIndexPath()", the user can deselect the cell as expected.

提交回复
热议问题