【发布时间】:2016-03-25 10:24:32
【问题描述】:
使用以下代码,我可以更改模式视图后面的rootViewController:
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let signupVC = storyboard.instantiateViewControllerWithIdentifier("SignupNavigationController") as! UINavigationController
let landingPageVC = storyboard.instantiateViewControllerWithIdentifier("LandingPage") as! LandingPageViewController
presentViewController(signupVC, animated: true, completion: {
UIApplication.sharedApplication().delegate?.window??.rootViewController = landingPageVC
UIApplication.sharedApplication().delegate?.window??.sendSubviewToBack(landingPageVC.view)
})
当我关闭我的模态视图控制器时,它会显示上一个 rootViewController(仅在动画期间)。然后我的新视图控制器正确显示。
知道如何防止这种情况吗?
【问题讨论】:
标签: ios swift cocoa-touch uikit