Do you need to call super.prepareForSegue:?

Viewed 129

I am following the Apple Books for learning. I am currently working with table view and segues. I got this piece of code:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    super.prepare(for: segue, sender: sender)
    
    guard segue.identifier == "saveUnwid" else {return}
    
    let symbol = symbolTextField.text ?? ""
    let name = nameTextField.text ?? ""
    let description = descriptionTextField.text ?? ""
    let usage = usageTextField.text ?? ""
    emoji = Emoji(symbol: symbol, name: name, description: description, usage: usage)
}

The only thing I do not understand is why they call super.prepare(for: segue, sender: sender).

The code is contained into a object of UITableViewController and the segue leads back to a table view with a list of Emoji objects.

1 Answers
Related