In one of my apps, I use NSCollectionViewDiffableDataSource
in tandem with NSFetchedResultsController,
which provides the necessary snapshots. This works great in macOS 14.5.
However, when updating data in Core Data related to a visible item in a NSCollectionView,
the NSCollectionViewDiffableDataSource
no longer calls the ‘itemProvider’
closure of the diffable data source when using macOS 15 Seed 3, after applying a snapshot with animation. As a result of this, the collection view does not update visible items when the related data changes.
I’m talking about this piece of code which is no longer called when it concerns a visible item:
dataSource = NSCollectionViewDiffableDataSource<String, NSManagedObjectID>(collectionView: collectionView, itemProvider: {
// Return an NSCollectionViewItem here
})
Does anyone know a workaround or solution to get updating of visible cells working in macOS 15 Seed 3, without losing animated updates?
In case an Apple engineer is reading this:
- Are there any related API changes that must be taken into account?
- Is this perhaps actually a bug of NSFetchedResultsController? I’m asking this because NSTableViewDiffableDataSource does have a very similar problem in macOS 15 beta.
- See also FB13943853