badoo / badoo/Chatto

UICollectionView layout not invalidated on device rotation

Open
#712 0 comments 0 reactions 0 assignees View on GitHub
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):

Screen Shot 2021-05-25 at 8 13 53 PM

The solution is fairly straightforward -- just call

```
collectionView.collectionViewLayout.invalidateLayout()
```

in the method `viewWillTransition` of `BaseChatViewController`.

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.