func prepare(for segue: UIStoryboardSegue, sender: Any?)
There are two methods to select first indexpath in collectionview like below override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let indexPath = self.collectionView!.indexPathsForSelectedItems?.first let indexPaths = self.collectionView!.indexPathsForSelectedItems! let indexPath = indexPaths[0] as NSIndexPath! }
CollectionView
2016. 10. 15. 19:21