How can I get NSPersistentCloudKitContainer working with UICollectionViewDiffableDataSource

I am trying to get CoreData(Sync'd via NSPersistentCloudKitContainer, although that is not particularly relevant for the current issue) to play nicely (or even at all) with UICollectionViewDiffableDataSource. The stumbling block seems to be concerned with [NSManagedObject hash]. I need the diffing engine to notice a change when there is a change in the specific managedObject-subclass, AND/OR (at least some) of its child managedObject-subclasses.

Example:

So, in the above example object graph, I need the Posts datasource to notice when the 'name' of the Tag changes, and react accordingly. i.e. {Post.tags.any.name}

  • The simplest solution would be if I could override[Post hash], but of course that's not allowed. Even obj-c method-swizzling does not work without complaining.

Class 'Post' for entity 'Post' has an illegal override of NSManagedObject -hash

  • Adding 'computed values' with the parent managed-object does not work; computed vars don't seem to be included in the [hash] implementation.

Any ideas what to try next?

How can I get NSPersistentCloudKitContainer working with UICollectionViewDiffableDataSource
 
 
Q