let profileViewController =
self.storyboard?.instantiateViewController(withIdentifier:
"ProfileViewcontroller") as! ProfileViewController
self.navigationController?.pushViewController(profileViewController,
animated: true)
不明白,为什么会这样。
答案 0 :(得分:0)
您可以尝试初始化故事板吗?
故事板或navigationController都是零。
let storyboard = UIStoryboard(name: "Main", Bundle: Bundle.main)
let profileViewController = storyboard.instantiateViewController(withIdentifier: "ProfileViewcontroller") as! ProfileViewController
self.navigationController?.pushViewController(profileViewController, animated: true)