Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share Core Data between users with NSPersistentCloudKitContainer

Apple introduced the NSPersistentCloudKitContainer with iOS 13 which enable us to use CloudKit with Core Data. I got it working pretty much instantly on different devices but my main issue is still left.

Is it possible to share the data in an easy way with other users? I've been reading on CKShare but don't see how I can go from NSPersistentCloudKitContainer to that in an easy way.

like image 685
Jonas Avatar asked Jun 26 '19 08:06

Jonas


People also ask

How to share Core Data?

On device A, tap the Add button (+) to show the photo picker, and then select a photo and add it to the Core Data store. Touch and hold the photo to display the context menu and then tap Create New Share to present the CloudKit sharing UI. Follow the UI to send a link to the Apple ID on device B.

What is CloudKit mirroring?

Configuring CloudKit MirroringSynchronize objects between devices, and handle store changes in the user interface. Reading CloudKit Records for Core Data. Access CloudKit records created from Core Data managed objects.

Should I use CloudKit or firebase?

Rules can be set up in the dashboard: CloudKit has a lot of tabs. Summary: Firebase can be immediately accessed without authentication but also provides the flexibility to define your own rules. CloudKit is probably more secure and can provide a seamless experience for your users too, but only if they are using iOS.

Is CloudKit free?

Cost. Although the running cost of servers is a big deal for developers. But in case of CloudKit you don't have to be worried about paying large expenses at all. As it offers a reasonable storage amount completely free.


1 Answers

As announced in WWDC 2021, you can now share to other iCloud users. https://developer.apple.com/videos/play/wwdc2021/10015/

like image 127
samwize Avatar answered Sep 28 '22 01:09

samwize