ios - performSegueWithIdentifier 不工作 - Swift

标签 ios swift storyboard segue

我正在尝试在用户成功创建帐户后启动 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 的屏幕截图:

enter image description here

最佳答案

那是因为没有 UINavigationController 就无法推送 View Controller 。请放置 UINavigationController 或请设置 segue Kind“Modal”而不是“Push”

关于ios - performSegueWithIdentifier 不工作 - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39050553/

相关文章:

swift - 无法从 ArcGIS Online 要素服务查询要素属性

ios - Swift/Alamofire 完成处理程序的困难

c# - 使用 MediaElement + Storyboard 连续播放视频

ios - 静态表不显示

wpf - MVVM 中的 Storyboard动画

ios - UIImagePickerController 与 UIImagePickerControllerSourceTypeCamera 崩溃

ios - NSURLConnection 委托(delegate)连接 :willCacheResponse: randomly called

ios - 在 UITableView 上获取 Spotify Track 图稿

ios - WKWebView和身份验证

ios - iOS 8 中 self.view.subviews 为空