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.
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
setCollectionViewLayout
inviewDidAppear
in the collection view controller.viewDidAppear
gets called again. You can do this a few times.