从我的ViewController的UINavigationController堆栈中,我呈现了另一个ViewController,并且再也不会回来了,但问题是deinit{}没有被调用。在导航之前,我应该如何从堆栈中删除每个ViewController?还是我应该用别的方法?现在我的代码看起来
let destinationVC = storyboard?.instantiateViewControllerWithIdentifier("revealViewController") as! SWRevealViewController
self.presentViewController(destinationVC, animated: true, completion: nil)发布于 2016-09-13 11:06:58
首先,当您调用presentViewController:animated:completion:时,您将在navigationController's层次结构之外呈现新的viewController modally。
如果希望将其显示在navigationController层次结构中,请使用:
self.navigationController!.pushViewController(destinationVC, animated: true)如果您想要更改视图层次结构,则navigationController有一个属性viewControllers,它可以用动画设置,也可以不使用动画设置。
self.navigationController!.setViewControllers([destinationVC],
animated: true)有关更多信息,请参见iOS开发者库。
https://stackoverflow.com/questions/39468200
复制相似问题