So I am trying to pass the arrays from a previous view controller called configNames
to populate my table view controller (basically a scoreboard)
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destVC: scoreboard = segue.destination as! scoreboard
destVC.namesTArray = nameArray
destVC.scoresTArray = scoreArray
}
namesTArray
/scoresTarray
is the array created in the tableview (scoreboard
) and nameArray
/scoreArray
are created and the values are added in the view controller.
I tried passing the arrays through segues, however, the values in the arrays were not passing and are causing a crash when I am trying to call the data from the variables to be displayed.
Thanks for any help.