Pushing view controller from table view row selection

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!

@andres0401ec Do you still have issues with this?

This topic was automatically closed after 166 days. New replies are no longer allowed.