performSegue not working and result crash

Viewed 365

I am facing weird crash when trying to call performSegue in storyBoard. I already configured view controller segueID and it is UINavigation hierarchy based viewController.I am getting the following error.

ERROR - " has no segue with the identifier 'SEGUE_ID'"

enter image description here

4 Answers

Check direction of your connection.

Its Destination to Source.

It should be Source to destination.

enter image description here

Not sure if it was my mistake or something changed in segue connection. Earlier I used to drag the connection from destination to the source view controller but I feel it is not working now. It starts working when I changed the direction of connection i.e. source to destination ViewController.

Try checking

if segue.identifier == “SegueID”

In the begining of your prepare function

You can check the storyBoard like this :

 print(self.storyboard)
 self.performSegue(withIdentifier: "SEGUE_ID", sender: self)

It cannot be nil

Related