swiftstoryboardsegue

Storyboard doesn't recognise custom segue identifier


The goal is to unwind from secondVC to firstVC. And I want to do it from the scene itself, but Xcode doesn't recognise this segue.

What I'm doing is:

  1. Control-drag from the secondVC scene in the Document Outline to the secondVC's Exit

  2. Choose my unwind segue, that I created on firstVC

  3. Give newly created segue an identifier - "SaveData".

  4. Trying to call that segue through "performSegue" function

    performSegue(withIdentifier: SaveData, sender: self)

But it shows a mistake, that identifier doesn't exist - "Cannot find 'SaveData' in scope"

Here is the screenshot

enter image description here

What am I doing wrong?

Xcode 14.0.1


Solution

  • OMG, I forgot that identifier should be put in quotation marks. Should be like this:

    performSegue(withIdentifier: "SaveData", sender: self)