zenangst / Family

:children_crossing: A child view controller framework that makes setting up your parent controllers as easy as pie.
Other
250 stars 10 forks source link

UICollectionView inside FamilyViewController has incorrect behavior. #127

Closed superk589 closed 5 years ago

superk589 commented 5 years ago

The view hierarchy is FamilyViewController --UICollectionView inside a UIViewController --UICollectionView inside a UIViewController

They are added using addChild(viewController, view: { $0.collectionView })

Each collectionView has 50 items retrieved from network with content size over the screen height.

image

The result is that the collectionView does not show all the items when scrolling down. The demo project is here https://github.com/superk589/FamilyDemo What's wrong in my implementation?

zenangst commented 5 years ago

@superk589 Interesting, I haven’t seen this before. I’ll have a look when life allows, on vacation with the family at the moment. (Pun not intended)

zenangst commented 5 years ago

@superk589 I checked out your demo project, thanks for that by the way, it really helped when debugging ❤. I'm happy to report that there is nothing wrong with your implementation, it just seems like there is a rather random rounding bug going on that needs fixing. I've made a PR to fix this here, I tried your demo with that branch and now everything is fine and dandy. A release is on its way.

Thanks for bringing this to my attention 😎

superk589 commented 5 years ago

This bug reappears in the newest version 0.20.7

image

The collection view has 50 items, but only shows the first 20 items. See my demo here: https://github.com/superk589/FamilyDemo

zenangst commented 5 years ago

@superk589 hey mate, I’m gonna investigate this issue as soon as I get to the office. I think I know what is causing this issue, a new release should be just around the corner. Cheers!

zenangst commented 5 years ago

Hey @superk589, would you mind trying this branch to see if that doesn't fix the issues you've been seeing: fix/rendering-issues-with-vertical-collection-views

superk589 commented 5 years ago

The bug above is fixed. Thank you. 😊 But there is another one not fixed, like this one but has more preconditions. I'll try to make another demo to reproduce it tomorrow.

zenangst commented 5 years ago

@superk589 awesome! Keep posting issues when you find them and I’ll do my best to smash them with my giant hammer! 🔨😎

superk589 commented 5 years ago

ezgif-4-8878a7150142 This new issue only occurs on real devices. (The device above is iOS 12.4, iPhone X) Use demo code here(the newest commit): https://github.com/superk589/FamilyDemo

superk589 commented 5 years ago

When a collection view with more than one screen items followed by a new collection view with fewer items, the first collection view will be jumpy. @zenangst

zenangst commented 5 years ago

@superk589 could you open a new issue for this one so that we can keep track on which PR fixes what issue? :)

superk589 commented 5 years ago

@zenangst OK