Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastianconcept/bbf59b56e388b977a583e3660182e748 to your computer and use it in GitHub Desktop.
Save sebastianconcept/bbf59b56e388b977a583e3660182e748 to your computer and use it in GitHub Desktop.
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