Skip to content

Instantly share code, notes, and snippets.

@FabiolaRamirez
Created March 26, 2020 02:25
Show Gist options
  • Save FabiolaRamirez/e43767814ec95021d17a9d07e48f324c to your computer and use it in GitHub Desktop.
Save FabiolaRamirez/e43767814ec95021d17a9d07e48f324c to your computer and use it in GitHub Desktop.
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let photo = photos[indexPath.row]
print("photogg:\(photo)")
showPhotoDetail(photo: photo)
}
func showPhotoDetail(photo: Photo) {
let vc: GalleryDetailViewController = UIViewController.instantiateViewController(storyBoard: "Gallery", identifier: "galleryDetailViewController") as! GalleryDetailViewController
vc.photo = photo
self.navigationController?.pushViewController(vc, animated: false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment