问题
I'm planning to develop an App used to share infos about geographic locations (coordinates, notes, pics), a kind of Treasure Hunt and I did not understand if it is possible, using CloudKit, to share part of a private container between users. If it is, how can I do that? I'd need to create something like Apple does in the Reminders App, where a user can "invite" other users and have a common list to share between them all where everybody can insert or edit stuff.
Eventually if it's not possible to do it using CloudKit, can I do that with Parse?
Thank you!
回答1:
Data in the private container can not be shared directly. You should use a public container for that functionality. You just have to create the right filters in your app so that you only share the data with the people you want to share the data with.
回答2:
In iOS 10 / macOS 10.12, it is now possible to share hierarchies of records in a user's private database with other users.
An Overview: [WWDC 2016] Session 226 - What's New with CloudKit
If you want to start diving into the new documentation, check out:
CKShare
CKShareParticipant
CKFetchShareParticipantsOperation
CKFetchShareMetadataOperation
CKAcceptSharesOperation
And this thread in the Apple Developer Forums, which provides some example code.
来源:https://stackoverflow.com/questions/31350136/cloudkit-share-private-container-between-users