Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created May 6, 2020 13:22
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 stevencurtis/25694b7ac466d992f78da0b74a697519 to your computer and use it in GitHub Desktop.
Save stevencurtis/25694b7ac466d992f78da0b74a697519 to your computer and use it in GitHub Desktop.
ViewControllerprepare
extension ViewController {
// MARK: - Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "detail" {
if let destination = segue.destination as? DetailViewController {
if let index = sender as? IndexPath {
destination.dataString = data[index.row]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment