swift: didSelectRowAtIndexPath

后端 未结 2 1020
自闭症患者
自闭症患者 2021-01-07 11:01

I have tableViewController. I want to click on 1 cell and get print(\"0\") and click on 2 cell and get print(\"1\")

But my code doesn’t wor

相关标签:
2条回答
  • 2021-01-07 11:16

    It seem that you are trying to mix between Swift 3 and older version. Please change it to:

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
    
    0 讨论(0)
  • 2021-01-07 11:25

    In Swift 3 the signature of the method in an UITableViewController is

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
    
    0 讨论(0)
提交回复
热议问题