UIDiffableDataSource: Crash, iOS 15.0, Xcode 13.0 Beta. Working fine on 14.0 and 13.0 iOS version

  private func applySnapshot() {
    var snapshot = SnapshotDetails()
    inputSections.forEach { 
snapshot.appendSections([$0.section])} 
    inputSections.forEach { section in
      snapshot.appendItems(section.items, toSection: section.section)
    }
    dataSource.apply(snapshot, animatingDifferences: false)
  }

Log: Assertion failure in NSArray<UICollectionViewUpdateItem *> * _Nonnull _UIDiffableDataSourceApplyInsertUpdate(NSObject<_UIDiffableDataSourceUpdate> *__strong _Nonnull, NSMutableOrderedSet *__strong _Nonnull, NSMutableOrderedSet *__strong _Nonnull, _UIDataSourceSnapshotter *__strong _Nonnull, BOOL)(), _UIDiffableDataSourceHelpers.m:654

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Update failed to insert requested items. Please file a bug on UIDiffableDataSource.

Yeah, we're seeing this crash too. Seems to be iOS 15 related as it's affecting our app that was built against the iOS 14 SDK so I assume a bug that will be fixed.

Please try using iOS 15 beta 3. Existing apps that were built using an older SDK (e.g. built with Xcode 12 for iOS 14) should no longer encounter this crash.

However, if you were seeing this crash on beta 1 or 2, it likely means there is an issue with the identifiers you are adding to diffable data source. When building your app using the iOS 15 SDK (with Xcode 13) and running on iOS 15 beta 3 (or later), you will probably see new exception messages that more clearly indicate the specific problem.

Were you able to figure out a solution?

UIDiffableDataSource: Crash, iOS 15.0, Xcode 13.0 Beta. Working fine on 14.0 and 13.0 iOS version
 
 
Q