UICollectionReusableView

I have

UICollectionView
(Multiple selection is allowed) inside
UICollectionReusableView
. When I select any cell of
UICollectionView
it changes
backgroundColor = .blue
and this selection is handled by
overriding isSelected
property of
UICollectionCell
. Problem is When I do the scrolling selection is removed and it shows selection in other
UICollectionReusableView
.

Replies

its your duty to tell the cell if its been selecetd when you get it from the resued cell pool、which means you know each cell's selction state and must update each cell when they are reused.