Skip to content

Instantly share code, notes, and snippets.

@PetreVane
Last active January 24, 2020 17:14
Show Gist options
  • Save PetreVane/b9de50dfc309b1e13310383e223f282d to your computer and use it in GitHub Desktop.
Save PetreVane/b9de50dfc309b1e13310383e223f282d to your computer and use it in GitHub Desktop.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "showDetailedImage" {
guard let indexPath = tableView.indexPathForSelectedRow,
let destinationVC = segue.destination as? DetailsVC else {return}
let imageToBePassed = UIImage(named: testImages[indexPath.row])
let nameToBePassed = String(describing: "\(testNames[indexPath.row])")
destinationVC.passedImage = imageToBePassed
destinationVC.passedImageName = nameToBePassed
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment