Swift UITableView didSelectRowAtIndexPath not getting called

前端 未结 10 2009
野的像风
野的像风 2021-02-06 23:18

New to IOS development and am having trouble with handling cell selection on a table. Whenever I select, the method is not getting called below - any idea why?

My proje

10条回答
  •  生来不讨喜
    2021-02-07 00:07

    • Couple of checks that can help you:-

      myTableView.allowsSelection = true

      myTableView.delegate = self

    • Make sure you written didSelectRowAt correctly:

      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

    • If you are using UIButton on UITableViewCell then it overlaps cell so check Solution here

提交回复
热议问题