UICollectionView layout not invalidated on device rotation
- Dominant language
- Swift
- Stars
- 4.6k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
The UICollectionView `.collectionViewLayout` is not being properly invalidated on a rotation. This leads to the following, easily-reproable behavior (do this on the "Empty Chat" screen of the demo app):

The solution is fairly straightforward -- just call
```
collectionView.collectionViewLayout.invalidateLayout()
```
in the method `viewWillTransition` of `BaseChatViewController`.
Contributor guide
Research direction
Start in BaseChatViewController at viewWillTransition and reproduce the rotation behavior on the demo app's Empty Chat screen. Inspect how the UICollectionView layout is handled during transition, then verify on device rotation that the layout is invalidated and the screen no longer shows the reported layout issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100