I'm trying to Google this for last 2 hours and found practically nothing useful. Let's say I want to create a messaging application with contacts on CloudKit platform.
You use a public database for Users. Let's say you can search people on the platform via e-mail address. So the e-mail is a public information stored in Users record type. However this user also has secret information that only accepted contacts can see. You invite him to be your contact which saves into Public database and sends a notification of some sort.
What now? How do you share a secret information about User, such as phone number, or, let's say, all of his contacts. CKShare doesn't seem to solve this kind of problem. Also, if I message the other person privately, where does this record get saved? Into a public database? Eh.
Sure I can save it all in a public database but how is that secure? Can't somebody then get the data if the app can? I read about encrypting the data but that sounds to me like a lot of work and confusion and don't even know how could you share the keys on demand.
CKShareallows a user to make a specific record in their private database visible to another user. It may well be that CloudKit is not the datatstore you are looking for - Paulw11