2016-08-20 98 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應該提供一個警告,說明是這種情況。 –