What about CloudKit?

I am watching Swiftdata videos, but so far they haven't mentioned CloudKit explicitly, and I'm not sure what is the relationship between SwiftData and Cloudkit at this time.

Are these models automatically synced with Cloudkit? If that's the case, do the migration plans work for cloudkit as well?

Post not yet marked as solved Up vote post of raspo Down vote post of raspo
721 views

Replies

I experimented with this briefly, and if you have the iCloud entitlement with a CloudKit container selected it does automatically sync. However it still has all the same restrictions Core Data has for CloudKit integration such as not supporting attributes like Unique.

In the same vein, I have yet to see any sort of Persistent History delegates or observations with SwiftData, such as in my case I have to deduplicate entries because of the lack of unique attributes in CloudKit.

So overall it's great API for simple data models, but quickly runs into needing to drop back to Core Data for anything more realistic.