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 yabenatti/eb9dfcaf1632f43f4d1f6730d58f4364 to your computer and use it in GitHub Desktop.
Save yabenatti/eb9dfcaf1632f43f4d1f6730d58f4364 to your computer and use it in GitHub Desktop.
MiniCursoIFSPSwiftSegueProgramaticamente
// MARK: - Table View
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let animal = self.animalsArray[indexPath.row]
//programaticamente
let storyboard = UIStoryboard(name: "Home", bundle: nil)
if let vc = storyboard.instantiateViewController(withIdentifier: "DetailViewControllerID") as? DetailViewController {
vc.selectedAnimal = animal
vc.delegate = self;
self.navigationController?.pushViewController(vc, animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment