16. CloudKit Sync: Downloading Changes and Handling Deletions

Information is not knowledge.

Albert Einstein

In Chapter 15, “CloudKit Sync: Uploading Objects,” the capability to upload Core Data managed objects into iCloud using CloudKit was added. This chapter completes the circle as the capability to download changed CloudKit records is added. Support for handling deleted objects is implemented too.

CloudKit Building Blocks (Continued)

Similar to the previous chapter, there are several disparate functions intended for CDCloudSync.swift that won’t be brought together until the end of the chapter. To begin with, four base functions are added to the existing GENERAL section. The first function, fetchRecordWithCacheID, is shown in Listing 16.1 ...

Get Learning Core Data for iOS with Swift: A Hands-On Guide to Building Core Data Applications, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.