我正在尝试在用户成功创建帐户后启动 segue。我知道正在调用该函数,但未执行 segue。我尝试使用 presentViewController 作为替代方法,还尝试了 dispatch_async(dispatch_get_main_queue()) 方法。这是我认为应该有效的代码。
func showGoalViewController () {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("ID_SetGoalViewController") as! SetGoalViewController
self.presentViewController(vc, animated: false, completion: nil)
}
这是我试图在 Storyboard中调用的 segue 的屏幕截图:
最佳答案
那是因为没有 UINavigationController 就无法推送 View Controller 。请放置 UINavigationController 或请设置 segue Kind“Modal”而不是“Push”
关于ios - performSegueWithIdentifier 不工作 - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39050553/