Our code worked for iOS 14.x with Xcode 12.5.x. Updating to Xcode 13.x, we are receiving the following crash anytime we attempt to call collectionView.reloadData() or collectionView.setContentOffset(...).
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath: does not match the element kind it is being used for. When asked for a view of element kind 'HomeSectionBackgroundView' the data source dequeued a view registered for the element kind '(null)'.'
If we replace .reloadData() with .reloadItems(_: ) or .reconfigureItems(_: ), it fixes one of two errors, but how would we correct the .setContentOffset(...) crash?
6
0
5.6k