2016-08-20 47 views
1

我想在用户成功创建一个帐户后启动一个segue。我知道这个函数正在被调用,但是segue没有被执行。我试图使用presentViewController作为替代方法,并尝试使用dispatch_async(dispatch_get_main_queue())方法。这是我认为应该工作的代码。performSegueWithIdentifier不能正常工作 - Swift

func showGoalViewController() { 

    let storyboard = UIStoryboard(name: "Main", bundle: nil) 
    let vc = storyboard.instantiateViewControllerWithIdentifier("ID_SetGoalViewController") as! SetGoalViewController 
    self.presentViewController(vc, animated: false, completion: nil) 

} 

而这里的SEGUE截图我想在故事板打电话:

enter image description here

+0

'showGoalViewController()'不工作? –

+0

我相信这个问题是在引用'navigateToMainAppScreen()'不起作用。 – cpimhoff

+0

这个'LoginViewController'是从包含“ShowSetGoal”segue的故事板实例化的吗? – cpimhoff

回答

3

那是因为你不能没有的UINavigationController推视图控制器。请把UINavigationController或请设置继续种类“Modal”不是“推”

+0

3小时后调试.... XCode应该提供一个警告,说明是这种情况。 –