是否可以在不调用 self.dismissViewControllerAnimated
的情况下关闭(并释放) View Controller (最好在 Swift 中)?
我试过下面的方法,并没有真正做到:
let loginVC = self.storyboard?.instantiateViewControllerWithIdentifier("LoginVC") as! LoginVC
self.presentViewController(loginVC, animated: true) {
//self.removeFromParentViewController()
self.tabBarController!.removeFromParentViewController()
}
最佳答案
dismissViewController:animated
应该用来关闭一个用 presentViewController:animated:completion:
呈现的 View Controller 。
类似地,UINavigationController 的 popViewControllerAnimated:
方法用于弹出一个用 pushViewController:animated
显示的 View Controller 。
关于ios - 在不调用 self.dismiss ViewController 的情况下关闭 View Controller 的替代方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38965072/