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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.