How to detect tableView cell touched or clicked in swift

后端 未结 9 896
灰色年华
灰色年华 2020-12-07 21:46

I\'m trying to get index of selected item in TableView and start some activity after that. Unfortunately most of solutions that I found are in obje

9条回答
  •  甜味超标
    2020-12-07 22:25

     # Check delegate? first must be connected owner of view controller
    
        # Simple implementation of the didSelectRowAt function.
    
        func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
             print("row selection: \(indexPath.row)")
        }
    

提交回复
热议问题