I was wondering whether objects in Core Data (and CloudKit) conform, or are able to be conformed, to the Transferable
protocol. As far as I can see there is no underlying implementation yet, but maybe this will be added as a future feature so that SwiftUI and Core Data can work better together.
In the WWDC22 session "Enhance collaboration experiences with Messages" at 10:21, a struct call Note
was implementing the transferRepresentation
required property and returned an object of type CKShareTransferRepresentation
from its body. I couldn't find any reference to this type anywhere in the documentation and nothing else was mentioned in the session video. Maybe this is something that is going to be added soon or was removed after the video was made.
Since I want to use Core Data in my SwiftUI app and want to enable sharing features, such as collaboration via the shared database, NSManagedObject
subclasses need some way of conforming to the Transferable
protocol. I was hoping there would be a specialised way to do this, and the aforementioned type from the session video sort of hinted at this.
I am just asking here to see if anyone has any information about this – whether this feature is about to be released, how this issue can be solved, or another way to do this. Any help is appreciated.