Daily iOS
Persistence

CloudKit sync constraints

You want to add iCloud sync across devices to a SwiftData/Core Data app that has been local only. What do you have to change in the schema and the design before you turn on NSPersistentCloudKitContainer (or SwiftData's cloudKitDatabase)?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

CloudKit mirroring allows no unique constraints, no required relationships, and no non-optional attributes without a default, so every attribute has to be optional or defaulted and relationships have to be optional with an inverse.

Share a question