This course is available as part of the raywenderlich.com Professional subscription. To learn more click here
Pro

CloudKit

Dec 9 2021 · Video Course (25 mins) · Intermediate

CloudKit is Apple’s remote data storage service. Based on iCloud, it provides a low-cost option to store and share app data.

Version

  • Swift 5.5, iOS 15, Xcode 13

CloudKit

Introduction

2:34 Free

There are three main reasons why you should choose CloudKit over other commercial BaaS offerings, or even your own server: simplicity, trust, and cost.

1

To create the CKContainer that will hold all of the app’s records, you first need to enable the iCloud entitlements for your app.

2

The CloudKit Console is the web interface that allows you to manage your database in a visual way.

3

A Record Type is a set of fields that defines an individual CKRecord. You can think of it like a Swift class.

4

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.

5

With your query object ready to go, you’ll need to use a CloudKit database to perform it.

6

An asset is binary data, such as an image, that you associate with a record.

7

You can create a relationship between different record types in CloudKit. You’ll use a one-to-many relationship.

8

Initializing arrays based on CKReferences is similar to working with other CKRecords. But it’s somewhat simpler, given that the reference provides information.

9

Conclusion

2:05

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.

10

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.

Covered concepts

  • CKContainer
  • CKRecord
  • CKQuery
  • Entitlements
  • Databases
  • CloudKit Console
  • async/await

Contributors

Comments