3

My question is: how do I find more information about "Core Data with iCloud" without finding too much "iCloud Core Data"?

These two things are named very similarly, which makes it very hard to find information about one without also finding the other.

When I say "iCloud Core Data", I am referring to the functionality that has been recently deprecated in iOS10. "iCloud Core Data" involved Core Data stores with ubiquity options, which meant that individual records updates were synchronized using iCloud across various devices.

When I say "Core Data with iCloud", I mean a different functionality that is built on the iCloud Drive service and I believe is based on synchronizing a Core Data store as a whole from device to device. "Cord Data with iCloud" apparently is continuing.

Apple differentiates the two: Only the client Core Data iCloud API symbols are deprecated. Core Data with iCloud is built on top of the iCloud Drive service.

Can anyone help point out some documentation about the newer "Core Data with iCloud" ?

user33675
  • 31
  • 3
  • 2
    I guess *Core Data with iCloud* means `CloudKit` – vadian Aug 01 '17 at 19:06
  • @vadian: I still learning about CloudKit, but my impression so far is that it is very different from both "Core Data with iCloud" and "iCloud Core Data". I think this because CloudKit uses a completely different API than Core Data, and I saw an example where one can use CloudKit without having any Core Data usage at a ll. – user33675 Aug 01 '17 at 19:55
  • 1
    There are only two patterns: `iCloud Core Data` (the deprecated one) and `CloudKit` – vadian Aug 01 '17 at 19:59
  • @vadian: yes, you are correct. There are really only two patterns for designing for Object Persistence if you are involving Apple's cloud services at the object level. (The two you mentioned.) However, I am asking my question because there seems to be a third option if all you want is backup and replication of the entire Core Data datastore as a whole, and that is the aforementioned "Core Data with iCloud". I am looking for documentation on that. – user33675 Aug 01 '17 at 20:25

2 Answers2

1

I think this is what you are looking for Incorporating iCloud with CoreData

Basically you have a CoreData store in your app and enabling iCloud can keep it synced across devices without your app needing to directly communicate with CloudKit.

I think the "iCloud Core Data" refers to using CloudKit as the data store which isn't horrible but it's not as easy as simply using CoreData.

Chris
  • 955
  • 15
  • 20
  • thank you for the link; that is quite useful, and does seem to refer specifically to the new functionality. I do think that CloudKit is NOT "iCloud Core Data", nor is it "Core Data with iCloud", but a third thing. CloudKit seems to use a completely different API, and has example projects that do not use Core Data at all. – user33675 Aug 01 '17 at 19:57
0

There's no system for synchronizing the entire Core Data persistent store file across devices via iCloud. The reason they built the now-deprecated iCloud support into Core Data is because synchronizing the document file doesn't work. Doing so is more or less guaranteed to lose data, corrupt the file, or both.

Using CloudKit is sometimes referred to as using iCloud, which is unfortunate since it confuses two different things.

If you want to synchronize Core Data across devices without using CloudKit, look into Ensembles. It's conceptually the same idea as the old iCloud support but with a different implementation that appears to work.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170