Navigate from a ViewController to an another on didSelectRowAt programmatically

后端 未结 3 983
傲寒
傲寒 2021-01-27 17:12

I have a UIViewController that contains a custom UITableView. The table has a custom UITableViewCell too.

How to navigate from the

3条回答
  •  孤街浪徒
    2021-01-27 18:00

    Here is a complete answer:

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let newViewController = NewViewController()
        self.navigationController?.pushViewController(newViewController, animated: true)
    }
    

提交回复
热议问题