diff --git a/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift b/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift index 62c47d6e..af9fce4c 100644 --- a/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift +++ b/MVMCoreUI/BaseControllers/ThreeLayerCollectionViewController.swift @@ -148,6 +148,7 @@ import Foundation /// Should be used to refresh the layout of the collection view. Updates flexible padding. open func invalidateCollectionLayout() { self.collectionView?.collectionViewLayout.invalidateLayout() + // TODO: Improve this workaround (autolayout for cells happens async so contentSize isn't accurate immediately) DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1, execute: { self.updateFlexibleSpace() }) @@ -156,6 +157,7 @@ import Foundation /// Should be used to reload the data of the collection view. Updates flexible padding. open func reloadCollectionData() { collectionView?.reloadData() + // TODO: Improve this workaround (autolayout for cells happens async so contentSize isn't accurate immediately) DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1, execute: { self.updateFlexibleSpace() })