Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Collection view flickers when page sheet viewcontroller size changes

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.

GIF

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: GIF2

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!