I am trying to navigate from ConversationsListVC
(source) to ConversationVC
(destination) programmatically by instantiating the source VC (self
) as the root navigation controller VC and then instantiating the destination VC so that I can push navigate.
I get the print statements onto the console (see below) but the app does not navigate to the destination VC, the app doesn't crash or throw any error. what am I missing here?
debug 1
debug 2
function:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("debug 1")
var window: UIWindow!
guard let convoVC = storyboard?.instantiateViewController(withIdentifier: "ConversationVC") as? ConversationVC else { return }
window?.rootViewController = UINavigationController(rootViewController: self)
navigationController?.pushViewController(convoVC, animated: true)
print("debug 2")
}//end func