Cloudkit sharing available in swift instead Core Kit

Hi there,

as far as I know CloudKit sharing is only available when using Core Kit coding instead swift. Are you okaying to open that posibility in further versions of swift?

Answered by Frameworks Engineer in 890702022

Are you asking about sharing support in SwiftData as opposed to CoreData?

Accepted Answer

Are you asking about sharing support in SwiftData as opposed to CoreData?

what I am trying to do with my app is to share an album that you created with family and friends through iCloud (like you can do it with notes already), and complete that album with different IDs (and see the changes Immediately) using CloudKit.

As fas as I know the only way is using Core Kit leaving aside coding in swift. Is there anyway to do it? are you planning to add more CloudKit options in Swift?

You can file a feedback report (to either CloudKit, or SwiftData) with your intended use case for sharing and details about your desired implementation.

i.e. if you have a preference for using SwiftData, CKSyncEngine, or some other implementation.

A small sample application or test would be helpful.

Regarding the implementation of iCloud data sharing for my app, i have evaluated both NSPersistentCloudKitContainer from core data and the newer CKSyncEngine. With the last one i would have to build a custom local database architecture from scratch and manually translate CKRecords into local models. So even if it is a superpower tool I was looking to something more easy like iCloud. But thanks for the heads up ;P

So even if it is a superpower tool I was looking to something more easy like iCloud

We do take feedback reports for "more magic".

I think the details we'd like to understand in your report are:

  • How do you intend to manage participants, what roles will the play, etc?
  • What is the shared "document" in your application, i.e. what are participants collaborating on and how do you want to model that?
  • What information do you want participants to be able to see during their collaboration about the document? i.e. do you want to show individual edits, document history, etc.

To give you the full context, my app is a digital companion for physical sticker album collectors. I want to allow families or groups of friends (e.g., a parent and a child) to collaboratively manage a single sticker album in real-time. Here are the details regarding your questions:

  1. Participant Management & Roles

Management: I plan to use the native system UI (UICloudSharingController or ShareLink) to handle invitations via iMessage/URL. Roles: * Owner: The user who creates the album tracking instance. Participant: Family members or friends. Permissions: Primarily Read/Write (so anyone in the family can check off a sticker they just acquired). We also want to support Read-Only (so a user can share their progress publicly with friends for trading purposes). Visibility: Private (Invite-only).

  1. The Shared "Document" & Data Model

The Document: The shared entity is a specific Sticker Album and its current completion state. Data Model: I am modeling this as a Core Data object graph. A parent Collection entity (containing metadata like Album Name, Total Stickers, and Year). A one-to-many relationship to Sticker entities (containing attributes like stickerNumber, isCollected, duplicatesCount, and timestamp). Sharing Scope: When a user shares a collection, the entire object graph (the Collection and its hundreds of related Stickers) should be moved to the shared record zone.

  1. Collaboration Visibility & Feedback

State Updates: The primary goal is seamless state synchronization. If Participant A marks sticker #45 as "collected," Participant B should see it updated on their grid as close to real-time as CloudKit allows. Conflict Resolution / Deduplication: i need a clean way to handle simultaneous edits (e.g., both users acquire and mark sticker #45 at the exact same time). "The Magic" we'd love to have: It would be incredible to natively show attribution (e.g., a small indicator showing "Dad added this sticker today") and a basic activity history (a feed of recent edits by participants).

Currently, My plan is to migrate from SwiftData to Core Data using NSPersistentCloudKitContainer to achieve this, as SwiftData currently lacks native sharing capabilities. If you have any recommendations, architectural advice, or "magic" APIs that would make this easier (or if SwiftData might support this paradigm soon), i would love to hear your thoughts! Thank you again

Cloudkit sharing available in swift instead Core Kit
 
 
Q