Sharing data with SwiftData

Hi, I have an app that uses Core Data + CloudKit, and which allows sharing of entities with other iCloud users. It works in a manner similar to the sample application provided on the Apple developer site.

Is this use case supported with SwiftData? The ability to share data with other iCloud users is fundamental to my app, so I cannot migrate to SwiftData unless this functionality is provided.

Same here. How to share data with SwiftData?

Initialize your ModelConfiguration with your cloudKitContainerIdentifier.

init(
    _ name: String? = nil,
    schema: Schema? = nil,
    url: URL,
    readOnly: Bool = false,
    cloudKitContainerIdentifier: String? = nil
)

See here for details. [https://developer.apple.com/documentation/swiftdata/modelconfiguration/init(_:schema:url:readonly:cloudkitcontaineridentifier:)?changes=_2_10)

Sharing data with SwiftData
 
 
Q