Who is this for?
This course is for iOS developers who have either not yet dived into the CloudKit framework, or who have not seen its latest incarnation. The new CloudKit console, and even newer asynchronous APIs, will be covered.
- CloudKit Console
Part 0: CloudKit
There are three main reasons why you should choose CloudKit over other commercial BaaS offerings, or even your own server: simplicity, trust, and cost.
Set Up Entitlements
To create the CKContainer that will hold all of the app’s records, you first need to enable the iCloud entitlements for your app.
The CloudKit Console is the web interface that allows you to manage your database in a visual way.
A Record Type is a set of fields that defines an individual CKRecord. You can think of it like a Swift class.
To select records from a database, you’ll use CKQuery. A CKQuery describes how to find all records of a specific type that match certain criteria.
With your query object ready to go, you’ll need to use a CloudKit database to perform it.
An asset is binary data, such as an image, that you associate with a record.
You can create a relationship between different record types in CloudKit. You’ll use a one-to-many relationship.
Initializing arrays based on CKReferences is similar to working with other CKRecords. But it’s somewhat simpler, given that the reference provides information.
That’s all for this introduction to CloudKit. We’ll briefly review some things to consider when working with CloudKit as well as where to go from here.