Diffable data source behaviour with different iOS versions/devices

I need to support diffable data source for iOS 13+ devices. But I have different unexpected behaviour with the same codebase. Code runs well on iPhone with iOS 15.1 and crashes with iPad iOS 13.1. I am aware that this API evolves and it has different behaviour with different iOS versions. But these changes are not well exposed usually.

Here is the demo project, where the crash happens: https://github.com/Jeka53/diffableCollectionView

Would appreciate any help regarding how API works behind the scenes. (Looks like data source doesn't like to be empty on iOS 13.1 iPad). I assume the solution will use compiler iOS version checks with different code flows for different iOS versions.

The end goal in the real app is simple. Empty the collection view's snapshot before starting network calls. After data from the network was received, build the snapshot from the ground up.

Would be nice to hear something from an Apple Engineer. Thanks.

p.s. I am already thinking to move back to good old data source.

up

Diffable data source behaviour with different iOS versions/devices
 
 
Q