Hello, I’m trying to push a new view controller when I select a row in a table view that I’ve made. The table view is from a sideMenuNavigationController so there is no storyboard for the table view, it’s just made programmatically. I keep getting the error: Unexpectedly found nil while implicitly unwrapping an Optional value. I don’t know how to fix this. Everything is working except fo that. The code is:
override func tableView( _ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let homeVC = HomeViewController()
self .navigationController?.pushViewController(homeVC, animated: true)
tableView.deselectRow(at: indexPath, animated: true )
}
Any help would be great, thanks in advance!