Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clearing nested collection views on setCollectionViewLayout(_:animated:) #117

Open
gapl opened this issue Sep 20, 2019 · 0 comments
Open

Comments

@gapl
Copy link

gapl commented Sep 20, 2019

Whenever you call collectionView.setCollectionViewLayout(layout, animated: false) with a layout that contains a horizontal scrolling section, a new collection view gets added for the horizontal scrolling section, but older collection views are not removed.

This results in "ghost" views being displayed in the view.

Quick way to replicate

  • Create a navigation controller that navigates to a collection view controller.
  • Call setCollectionViewLayout in viewDidAppear in the collection view controller.
  • Initiate interactive dismiss gesture but cancel halfway so that viewDidAppear gets called again. You can do this a few times.
  • Check debug view hierarchy to see leftover collection views.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant