Before you can use the CloudKit in an iOS application, you must add the CloudKit entitlements in the project. You can use your own iOS project or this starter project, CloudKitGuide. Steps presented below assume you will use the starter project.

Now, here are the steps to add the CloudKit entitlements in the starter project.

  1. Click the General tab.
  2. Change the Bundle Identifier name to your reverse domain name, and select your name from the Team menu.
  3. Click the Capabilities tab.
  4. Flick the iCloud switch ON and tick the CloudKit checkbox.

After execute step 3 and 4, the iCloud section should look like this now:

usingcloudkit-lesson1-2

By performing above steps, Xcode added an entitlements file and the CloudKit framework in the project. Xcode also created a container in the CloudKit Dashboard. To access it, click the Dashboard button in the Capabilities tab.

By the way, the Single View Application template was used to create the starter project, with these options. So the container’s name in the CloudKit Dashboard is called “CloudKitGuide”

cloudkkit-figure1-0

Tags:

No responses yet

Leave a Reply

UIDocument Demystified: A Step-by-step Guide on Local and iCloud Document Storage

 

Archives