Swift question - I want to pass the values of an instance of a struct from one view controller to another. In the first view controller I created an instance of the struct, assigned values to the various properties, and now, on the click of a button, want to be taken to the second view controller and have the struct from the first view controller at my disposal.
This is what I have in the first view controller below, but not part of, the buttonPressed action.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destVC = segue.destination as! HoleTrackerViewController
destVC.myRound = newRound
}
myRound is the instance of the struct I created in the second view controller. newRound is the instance from the first view controller with the values assigned to the properties.
When I'm taken to the new view controller, the myRound instance doesn't have any of the values that the newRound instance had.