With CloudKit, you can save key value pairs to a public or private database hosted by Apple. This means your app can keep user data in sync between multiple devices and the data will still be available if the user uninstalls your app. And it requires no server set up at all!

Apple offers different amounts of free storage for your application based on the amount of users you have, details can be found here https://developer.apple.com/icloud/

Screen Shot 2015-08-31 at 10.19.10 AM

Project Set Up

Start by enabling iCloud for your app. With your target selected, go to Capabilities and turn on iCloud, and make sure CloudKit is checked and you have a Container. Once everything is good you can go straight to the dashboard from here to create your tables.

cloudkitEnable

If you haven’t already added the CloudKit framework to your project, do so by going to Build Phases -> Link Binary With Libraries.

Screen Shot 2015-08-31 at 10.22.05 AM

Time to Code!

One thought on “CloudKit with Swift

Leave a Reply