Search code examples
iosicloudcloudkit

Since iOS8 we should use CloudKit for all iCloud apps?


I've noticed a lot of people creating iCloud apps using Obj-C and importing .h etc. To a noob like me it seems very complex since I've been using Swift from the beginning. People say iCloud apps can be created using only Swift and CloudKit exclusively. Is it possible? Thanks


Solution

  • Actually CloudKit is a layer on top of iCloud. With CloudKit you can work with structural data. With iCloud you probably mean 'iCloud document storage'? In both cases you will be able to do this both with Swift and Objective C. iCloud document storage exists longer, that's probably why most samples are in Objective C.

    With CloudKit you will be able to handle data records and files (as CKAsset). That data will be bound to the containers that you registered in your app. You will not be able to access data of other app's (unless the app is yours and you added the container)

    If you want to decide when to use CloudKit or iCloud document storage, then have a look at table 1-1 at: https://developer.apple.com/library/ios/documentation/General/Conceptual/iCloudDesignGuide/Chapters/iCloudFundametals.html#//apple_ref/doc/uid/TP40012094-CH6-SW1

    If you want to have a look at a sample app that is using Swift and CloudKit, then have a look at this complete functional chat application http://github.com/evermeer/EVCloudKitDao