Let's suppose I have an app using CloudKit + Core Data sync.
My use case is:
For doing that:
My entities are: "Entity1" and "Entity2".
My Configurations are: "Config1" and "Config2". Both have entity1 and entity2 and both are "usedWithCloudKit".
In my coreDataStack, I have 2 descriptions. The first one is for Config1 and the second one is for Config2 and has "databaseScope = .public
"
By doing this, if the user saves something into the app, the record will appear in the private db.
If I manually add something to the public DB via iCloud Dashboard, it will be fetched by the user.
So far so good.
Now, if I'm an admin, how can I specify that my SAVE will go to the public DB and not the private one?
I managed to do this via:
assign(_ object: Any, to store: NSPersistentStore)