Other Classes

The following classes are available globally.

  • A diffable data source created specifically to coordinate UICollectionView.reconfigureItems(at:) with CollectionViewChatLayout.reconfigureItems(at:).

    Apple’s UICollectionViewDiffableDataSource forwards snapshot application to private __UIDiffableDataSource and _UIDiffableDataSourceViewUpdater objects. Those objects use the private _performDiffableUpdate(_:) transaction and an internal commitAlongsideHandler to replace identifier state while UIKit applies the view updates.

    ChatLayoutDiffableDataSource cannot use those private hooks, so commitAlongsideUpdates exposes the equivalent synchronization point within its public performBatchUpdates transaction. Clients must update any application-owned models read by the cell provider and layout delegate in that closure so they remain consistent with the new snapshot.

    See more

    Declaration

    Swift

    @MainActor
    open class ChatLayoutDiffableDataSource<SectionID, ItemID> : NSObject, UICollectionViewDataSource where SectionID : Hashable, SectionID : Sendable, ItemID : Hashable, ItemID : Sendable