Apple introduced the NSPersistentCloudKitContainer with iOS 13 which enable us to use CloudKit with Core Data. I got it working pretty much instantly on different devices bu
There are methods on NSPersistentCloudKitContainer for accessing the underlying cloudkit records: https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainer. For example,
func record(for managedObjectID: NSManagedObjectID) -> CKRecord?
So in theory you could use this method to obtain a CKRecord then create a CKShare manually.
BUT as of the current beta release (beta 3) these methods seem to return nil. It seems like they wouldn't have included these methods if they wanted to keep the implementation hidden. So we're in this spot where you can implement the entire sync yourself and get sharing, or use their sync implementation but not get sharing. I hope the lack of implementation on these methods is simply an early beta issue.