我已经尝试了无数种不同的方法来回到我最初的 viewController,但我什么也做不了。如果你们中的任何一个人能看到我做错了什么,我会非常高兴。
只是为了确保我在每个场景和每个视图控制器中都有一个打印语句,并且最初 rootviewcontroller 打印语句确实有效,但我知道它没有完全过渡,因为打印语句不再发生。
下面是转换代码的片段,下面是我的故事板的图片:
func menu()
{
self.view?.presentScene(nil)
//let theVC = self.viewController?.storyboard?.instantiateViewController(withIdentifier: "menuVC") as! MenuVC?
//self.viewController?.navigationController?.pushViewController(theVC!, animated: true)
self.viewController?.dismiss(animated: false, completion: nil)
self.viewController?.navigationController?.popToRootViewController(animated: true)
print("LastScene")
}