After calling -[UICollectionView reloadData]
it takes some time for cells to be displayed, so selecting an item immediately after calling reloadData
does not work. Is there a way to select an item immediately after reloadData
?
Ios – uicollectionview select an item immediately after reloaddata
iosuicollectionview
Best Answer
Along the lines of this answer I found that calling
layoutIfNeeded
afterreloadData
seemed to effectively 'flush' the reload before I do other things to the collectionView:On the page I found this solution, some commenters indicated it didn't work for them on iOS 9, but it's been fine for me so your mileage may vary.