问题
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:
- Drag a segue from view controller1 to view controller2,not from any
button
 
- Set a identifier of your segue
 
- 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
