5

Update, June 2016: As of the most recent documentation for NSPersistentStoreCoordinator, everything related to Core Data with iCloud is marked as deprecated. As a result it should probably be avoided for new development.

Using Core Data, iCloud and CloudKit for syncing and backup and how it works together

Important The use of iCloud with Core Data has been deprecated and is no longer being supported.

About using iCloud with Core Data

I've been reading about integrating iCloud with Core Data. The mentioned Stack Overflow answer mentions the possibility of just syncing the core data database to iCloud, but also says that it's deprecated. What technology is supposed to replace it. Is it CloudKit? Could someone point out documentation about how to integrate Core Data with cloud syncing (whichever API/technology is supposed to replace it)

bcye
  • 758
  • 5
  • 22
  • I believe it is supposed to be done manually according to guidelines, at least for now. I am personally using `Cache` from `RxCloudKit` which handles synchronization for the most part. – Maxim Volgin Nov 13 '18 at 11:47

1 Answers1

7

Apple did not provide a replacement. There is currently no Apple documentation about syncing Core Data between devices, because there is currently no Apple solution for this situation.

Apple does provide CloudKit, which syncs data between devices. It's not a replacement, because it's not designed as an offline data store. There is no built-in Core Data/CloudKit connection, so integrating the two is up to app developers. There are third party frameworks like Seam3 and CloudCore but I haven't used either so I couldn't say how well they work.

There's also the Ensembles framework, which syncs over a variety of server back ends. There are free and paid versions.

Finally, if you don't mind bringing in a third-party service, Google's Firebase is an effective solution to storing data locally and syncing it between devices.

If you think that Apple should provide a syncing solution-- a reasonable idea, I'd say-- please file an enhancement request with Apple describing what you need and how you would use it.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • Tom, which option would you suggest as the most stable? I have also considered Realm.io as a replacement for Core Data because of the lack of syncing options, but they do not have grouping in RLMResults. Is Ensembles the best way to go if one is to stay with Core Data? With iOS apps soon ported to the Mac, it seems like Apple would be addressing this, but it has been *crickets*. – SAHM Nov 27 '18 at 18:52
  • I haven’t used the CloudKit options so I don’t know how good they are. Since their purpose is to sync Core Data over CloudKit though, they’re also options if you’re sticking with Core Data. – Tom Harrington Nov 27 '18 at 19:35