Created
November 10, 2017 12:52
-
-
Save yabenatti/eb9dfcaf1632f43f4d1f6730d58f4364 to your computer and use it in GitHub Desktop.
MiniCursoIFSPSwiftSegueProgramaticamente
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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