6

What is the difference between iCloud Drive and CloudKit? Which would be better for storing manual, periodic app document backups? I did see this question:

iCloud versus iCloud Drive versus CloudKit

but it is about costs and not the differences between the actual services.

Community
  • 1
  • 1
SAHM
  • 4,078
  • 7
  • 41
  • 77

1 Answers1

8

CloudKit

CloudKit provides authentication, a private and a public database, and structured asset storage services. CloudKit is a framework that allows an app to connect to iCloud APIs.

iCloud Drive

iCloud Drive is Apple's online storage service — a place to keep user files and access them from Apple devices, such as an iPhone, iPad, or Mac.

In summary, iCloud Drive is where apps can store user’s data and files for access from other devices. CloudKit is the framework that makes it possible to access iCloud/iCloud Drive.

https://developer.apple.com/icloud/

l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • 1
    So there is no way to use iCloud Drive without CloudKit? Can you provide documentation for that? – SAHM May 03 '17 at 17:10
  • What about this link? Isn't Documents in iCloud the same as iCloud Drive? Why would there be separate sections for Designing for CloudKit and Designing for Documents in iCloud if both needed CloudKit? https://developer.apple.com/library/content/documentation/General/Conceptual/iCloudDesignGuide/Chapters/DesigningForDocumentsIniCloud.html#//apple_ref/doc/uid/TP40012094-CH2-SW1 – SAHM May 03 '17 at 17:18
  • `CloudKit` is the underlying framework that `iOS` and `macOS` both use for `iCloud`, designing documents is only one aspect of utilizing it. – l'L'l May 03 '17 at 17:47
  • I have to ask - are you really sure you know what you are talking about? I see this Apple example app that would probably be of help to me if I could get it to compile (I don't know Swift 3), and it does not use CloudKit. It was just updated by Apple in September. So it seems like maybe CloudKit is not necessary? Which means I still am left with my original question. https://developer.apple.com/library/content/samplecode/ShapeEdit/Introduction/Intro.html – SAHM May 03 '17 at 17:50
  • Where are you confused, and what are you not understanding? In my previous comment "documents" was probably not the right word I should've used - "data" would be more applicable. Regarding the sample project, `CloudKit` is already linked transparently — so you don't see it. In the project go to Capabilites > iCloud, then look under "steps" — notice in-fact it is using `CloudKit`. I suggest you read the documentation rather than apparently skipping through it. – l'L'l May 03 '17 at 17:59
  • I *have* read the documentation. I am telling you that they are not the same - that iCloud Documents can be used *without* CloudKit. Did you down vote the question because of my last response? Nice. Also you are going back and changing or deleting your comments. – SAHM May 03 '17 at 18:08
  • Dude, I am just trying to figure this out. I have seen a lot of people answer questions just to get points and they really don't know what they are talking about. The way you answered the questions before you went back and revised made me think that that was possibly what you were doing. You provided better information in your revised comments. I am reading the documentation - please stop accusing me of not - it is just super unclear to me. I am doing the best I can. – SAHM May 03 '17 at 18:15
  • 4
    You do not need CloudKit to store files in iCloud Drive. Simply use `NSFileManager` and the iCloud related methods. – rmaddy May 03 '17 at 18:18
  • 1
    Anything that uses `iCloud` is using `CloudKit` framework — it's that simple. It can also be used as a "service", which is maybe where you are confused; depending on what your app does depends on whether or not you use that way. You haven't provided any of that info, but maybe that's where the confusion is... – l'L'l May 03 '17 at 18:19
  • 1
    @l'L'l If your code uses `NSFileManager` to store files into the user's iCloud account, the code does not need to import CloudKit. The developer does not need to use any CloudKit APIs. Whether, deep down in the implementation of iOS, CloudKit is used behind the scenes or not by `NSFileManager` is irrelevant to the question being asked. The question is asking what APIs to use. Keep the discussion at that level. The app does not need to use the CloudKit framework and APIs to simply store a file. Using `NSFileManager` is all that is needed. – rmaddy May 03 '17 at 18:25
  • @rmaddy: The point is, they asked what the difference was; I thought that I explained it... – l'L'l May 03 '17 at 18:41
  • Thanks @rmaddy. I will approach this without the CloudKit framework. I have been looking for an objective-c example of how to approach this and I think the following will be helpful - let me know if you think it is out of date. Also, if you want to post your answer as the answer to the question I will go ahead and accept it. github.com/drewmccormack/icloudaccess/blob/master/ICACloud.m – SAHM May 03 '17 at 18:54