How to segue from one viewcontroller to another

自闭症网瘾萝莉.ら 提交于 2020-01-05 01:50:27

问题


I have a problem about the segue

if signupError == nil {
    println("logged in")
    self.performSegueWithIdentifier("segue", sender:  nil)
} else {
    if let errorString = signupError!.userInfo?["error"] as? NSString {
        // Update - added as! String
        error = errorString as! String
    } else {
        error = "Please try again later."
    }

    self.displayAlert("Could Not Log In", error: error)
}
else {
    if let errorString = signupError!.userInfo?["error"] as? NSString {
        // Update - added as! String
        error = errorString as! String
    } else {
        error = "Please try again later."
    }
    self.displayAlert("Could Not Log In", error: error)
}

I'm quite sure for the first time it worked well, but when I sign out, it seems that the app remember some status, although I input the wrong password, and it shows alert and doesn't print logged in into the console, but it still segue


回答1:


  1. Drag a segue from view controller1 to view controller2,not from any button

  2. Set a identifier of your segue

  1. Use this function to fire a segue.

    self.performSegueWithIdentifier("youridentifer", sender:nil);



来源:https://stackoverflow.com/questions/30294930/how-to-segue-from-one-viewcontroller-to-another

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!