Please, help me to understand one line of code.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "toDetailScreenSegue" {
let detail = segue.destination as! DetailScreenViewController
detail.name = item.name
}
}
What is happening in this line of code below?
let detail = segue.destination as! DetailScreenViewController
- Is a copy of the DetailScreenViewController class being made?
- And since this is a class, not a structure, then not a separate copy is created, but a reference to the DetailScreenViewController class?
Is this right?