Hello,
I am using compositional layout with a UICollectionView, and each section has a visibleItemsInvalidationHandler
that applies a transform to the section items, the transform is based on contentOffset.y
.
When I load the data the first time and no scroll has happened the transform is not applied because the visibleItemsInvalidationHandler
is not called until scroll happens.
I tried calling collectionView.collectionViewLayout.invalidateLayout()
but it doesn't seems to help. I can scroll the collection view programmatically and that kinda works but I'm still wondering if there's a way to invoke programmatically the visibleItemsInvalidationHandler
.
Edit:
Forgot to add that I'm also using UICollectionViewDiffableDataSource
to load the data.