I have a UICollectionView
with a simple UICollectionViewFlowLayout
. On iOS 15 when first loading the view and setting the items an exception occurs.
This is called on the main thread when the items are set:
var snapshot = NSDiffableDataSourceSnapshot<Section, PageItem>()
snapshot.appendSections([.main])
snapshot.appendItems(filteredPages)
dataSource.apply(snapshot, animatingDifferences: true)
I'm getting the following exception:
'the invalidation context ((null)) sent to -[UICollectionViewFlowLayout invalidateLayoutWithContext:] is not an instance of type UICollectionViewFlowLayoutInvalidationContext or a subclass'
terminating with uncaught exception of type NSException
Running the same project on iOS 14 does not crash.