【发布时间】:2015-12-23 23:55:54
【问题描述】:
我正在尝试关闭视图控制器并同时呈现另一个视图控制器。当Level1Controller() 完成并调用self.dismissViewController() 时,我希望它带我到另一个名为EndScene() 的视图控制器。
这是最接近我的代码。
self.dismissViewControllerAnimated(true, completion: {() -> Void in
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let nextViewConroller = storyboard.instantiateViewControllerWithIdentifier("endscene")
self.presentViewController(nextViewConroller, animated: false, completion: nil)
})
【问题讨论】:
-
您在@Rogue Studios 遇到的实际问题是什么?
-
@RaphaelOliveira 它只会引导我回到根视图控制器,这是错误消息
2015-12-23 17:47:35.333 Spin Game[6466:2789372] Warning: Attempt to present <Spin_Game.EndScene: 0x14edc0b20> on <Spin_Game.Level1Controller: 0x14f86d400> whose view is not in the window hierarchy! -
知道了,会写答案的。
标签: ios swift uiviewcontroller instantiation dismiss