Douglas W. Palme
Douglas W. Palme

Reputation: 573

PerformSegueWithIdentifier blowing up

I have a weird situation happening. Here is a brief description of my layout:

Sign-in View controller -> Main Table View Controller (has logoff button) -> Second Table View Controller (has logoff button) -> Help Menu.

So when the user gets to the help menu and clicks the logoff button it dumps them back to the second view controller which at that point it blows up saying:

Thread 1: Exception: "Receiver (<xxx.SecondViewController: 0x7fa72b9cc040>) has no segue with identifier 'SignupViewController'"

The code for the logoff button is as follows:

@IBAction func btnLogoutPressed(_ sender: Any) {
        try! Auth.auth().signOut()
        performSegue(withIdentifier: "SignupViewController", sender: self)
    }

Within the SecondViewController I also have a logoff button which has the exact same code as the help view controller.

Any idea how to fix this?

Upvotes: 0

Views: 32

Answers (1)

Nandish
Nandish

Reputation: 1177

You must add a segue in your storyboard for SecondViewController to SignupViewController and set that segue identifier to "SignupViewController". Then it will work.

I guess now the segue is available only from Main Table View Controller to SignupViewController with identifier "SignupViewController", if so it will work only from Main Table View Controller.

Upvotes: 1

Related Questions