I tried to invalidate layer for a specific cell in the collection, it doesn't help, it only turns out to redraw a certain number of cells using the enqueueModelUpdate method.
let layout = collectionView?.collectionViewLayout
layout?.invalidateLayout()
// or
let indexPath = collectionView?.indexPath(for: cell)
if let layout, let indexPath {
let context = UICollectionViewLayoutInvalidationContext()
context.invalidateItems(at: [indexPath])
layout.invalidateLayout(with: context)
}
I tried to invalidate layer for a specific cell in the collection, it doesn't help, it only turns out to redraw a certain number of cells using the
enqueueModelUpdatemethod.