Transfer an array from 1 screen to the other

I'm trying to transfer an array with my answers to my other screen so I can display it. The code is below , however on the other screen I initialized theTransferArr but it says unresolved identifier.

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "passRes" {
if let vc = segue.destination as? ScoreScreenVC {
vc.resLab = self.percentageStringUsed
} else if segue.identifier == "passArr" {
if let vc = segue.destination as? ScoreScreenVC {
vc.transferArr = theTransferArr

    }
}
    }
}

Sorry for the dumb question, but in the new vc you have declared:

   Var transferArr : [String] = []

?

Terms of Service

Privacy Policy

Cookie Policy