I'm trying to figure out how to programmatically select a cell the moment the collectionView starts up. As in, the default load of the collectionView should have the first cell selected.
I'm using shouldSelectItemAtIndexPath for my selection function, so I want to call it for a specific cell index.
So far I have tried:
collectionView(self.collectionView!, shouldSelectItemAtIndexPath: self.collectionView!.indexPathForCell(CVcellArray.first!)!)
In my viewDidLoad function for my custom CollectionView script.
It crashed when the collectionView loaded. Am I doing something wrong?
Thank you.
In
viewDidAppear
just callselectItemAtIndexPath
.