I have a problem with the screen presented modally. At some point of scroll offset, whenever I change the screen size, the scroll offset flickers with some cells being re-layout, but the delegate is not asked for the new cells at this time.
I hope that the below GIF illustrates it's quite good.
I guess it's due to a change in the collection view height, which Geoff Hackworth showed here.
I'll be glad for any suggestions.
Probably it is worth noticing that I use Compositional Layout and DiffableDataSource.

EDIT:
I've decided to check how the code sample from Implementing Modern Collection Views will work, when the screen will be presented modally. The result is the same.
It seems that this is a bug in UIKit. When the NSCollectionLayoutSize height is estimated, not absolute it forces the layout to calculate the view size, probably based on preferredLayoutAttributesFitting(layoutAttributes:). On change of the view container height, the view is asked to be layout again. At the beginning of the layout loop, UICollectionViewCompositionalLayout returns estimated, not the actual size of the views, which causes reusable views (both supplementary and cells) to jump across the screen. The overall result looks really weird.
Here it is:
