【问题标题】:Unwind Segue using performSegueWithIdentifier - Doesn't work - Swift 2.1使用 performSegueWithIdentifier 解开 Segue - 不起作用 - Swift 2.1
【发布时间】:2016-02-15 11:19:33
【问题描述】:

在收到响应后,我正在尝试放松按钮单击。

登录控制器

@IBAction func SignInPressed(sender: AnyObject) {

  if (onSuccess) {
      performSegueWithIdentifier("unwindToGlobal", sender: AnyObject?())
  }
}

这就是它的来源(GlobalController)。

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
{
    if (segue.identifier == "globalToLogin")
    {
        NSOperationQueue.mainQueue().addOperationWithBlock({ () -> Void in
            let loginController = segue.destinationViewController as? LoginController
        })
    }
}

这个有效,一旦我进入应用程序(GlobalController 是起始视图),我就会被定向到登录页面。但是,当我单击 LoginController 上的登录按钮时,不幸的是它并没有展开。

当我尝试删除这些连接并使用ctrl + drag 按钮退出时,它什么也没做。

我找不到我做错了什么,因此它不起作用。我错过了什么?

【问题讨论】:

    标签: ios swift storyboard segue unwind-segue


    【解决方案1】:

    这里有几篇关于 Unwind 的文章,对我来说太棒了,也许对我有帮助

    Unwind

    【讨论】:

    • 我也读过这篇文章,但我不知道如何将它改编成可以在 if 函数中使用的语法
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-01
    • 2014-09-18
    • 1970-01-01
    • 2015-12-18
    • 1970-01-01
    相关资源
    最近更新 更多