UICollectionView how to deselect all

后端 未结 6 2188
被撕碎了的回忆
被撕碎了的回忆 2021-02-12 23:26

I have a FollowVC and FollowCell Setup with collection View. I can display all the datas correctly into my uIcollection view cell using the following code with no problem.

6条回答
  •  野的像风
    2021-02-12 23:34

    To simplify further, you could just do

    followCollectionView.allowsSelection = false
    followCollectionView.allowsSelection = true
    

    This will in fact correctly clear your followCollectionView.indexPathsForSelectedItems even though it feels very wrong.

提交回复
热议问题