I\'m trying to implement a login screen, when login is clicked it does the segue \"login\".
I added a prepareForSegue() override to try to cancel it if the login fai
You could use shouldPerformSegue and return false, therefore blocking all segues. For example:
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
return false
}
Then, once you have a successful login, call performSegue, like this:
performSegue(withIdentifier: "YourSegueIdentifier", sender: nil)
This will ensure that you will only transition to the controller when you have a login success.