Posts

Post marked as Apple Recommended
Yes, "It is not supported" and "you can use it, but have to write some extra code" can be read as either saying the same thing, or contradicting each other, and after spending some hours looking through forums and documentation, without more context your intended meaning of "NSPersistentCloudKitContainer does not yet support sharing" isn't obvious to me. Contributing to my confusion, about a year ago the answer given included - https://developer.apple.com/forums/thread/117938?answerId=376835022#376835022: "NSPersistentCloudKitContainer does not support sharing.... " and "As others have (correctly) pointed out, NSPersistentCloudKitContainer maintains a specific zone in the private database, and therefore will never see any shared zones owned by other users." Three weeks ago this answer - https://developer.apple.com/forums/thread/651651?answerId=616641022#616641022 also seems to say no: "NSPersistentCloudKitContainer only supports the private database and the public database. If you want to let your users share data with each other, you need to use the CKShare and CK operations API." Also three weeks ago, in this thread the staff answer here seems to say yes to me (with some additional work) and your answer seems to say no - more like the answers from other threads. I'm currently looking at my CloudKit implementation which needs a serious bugfix/refactor and I'm trying to figure out if I can adopt NSPersistentCloudKitContainer to remove some (or ideally most) of my pretty ****** sync code. That would be amazing, but I know I'm slow and a mediocre programmer and I'd prefer to not spend what will inevitably be hours if in the end I'm barking up the wrong tree. I'm happy to admit I'm an ***** or not comprehending the obvious and if that's the case I apologize. Would you be willing to provide an answer that I can understand?
Post marked as solved
1 Replies
Yes any device that logs into that Apple ID will then be able to sync with the data associated with that Apple ID. You can log in and out as much as you like - the data lives in iCloud, and as long as you have it set up correctly, it will sync between any devices logged in.
Post marked as Apple Recommended
I'm not sure how to rectify the two answers from Apple. The "staff" answer reads to me as yes, with some extra work. The "engineer" answer reads to me as a flat no, don't even try. Can someone please clarify? Does "does not yet support sharing" mean you literally can't use sharing with NSPersistentCloudKitContainer at all, even with additional code?