Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
switch segue.identifier! {
case "showTodoDetail":
// Get the detail view controller in a local var
let todoDetailVC = segue.destination as! TodoDetailViewController
// Get the specific model in a local var
let cell = sender as! TodoTableViewCell
// Set the model in the detail view controller
todoDetailVC.todo = cell.todo
default: break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment