After calling -[UICollectionView reloadData]
it takes some time for cells to be displayed, so selecting an item immediately after calling reloadData
do
I'm handling selection of cells in collectionView: cellForItemAtIndexPath:
. The problem I found was that if the cell didn't exist, simply calling selectItemAtIndexPath: animated: scrollPosition:
wouldn't actually select the item.
Instead you have to do:
cell.selected = YES;
[m_collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone];