How can I correctly invalidate cell layout in Chatto in order to relaclulate specific cell height?
- Dominant language
- Swift
- Stars
- 4.6k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
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)
}
```
Contributor guide
Research direction
Start with the collection view layout invalidation calls and the `enqueueModelUpdate` path described in the report. Reproduce the behavior for one cell, then determine whether its specific height can be recalculated without redrawing unrelated cells. Done means the targeted cell updates reliably after invalidation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100