CloudKit Service

Sync and Sharing

CloudKit lets Apple platform apps store, sync, and share data through iCloud. This collection maps the practical choices across Core Data with CloudKit, iCloud Documents, NSUbiquitousKeyValueStore, sync-status handling, and multi-device data architecture for indie and small-team apps.

Use the articles below for the larger CloudKit architecture story, then use related snippets for concrete repair work such as CloudKit model rules, macOS sync fixes, and initializeCloudKitSchema troubleshooting.

Core Data with CloudKit

Follow this path when you need Core Data persistence to sync through iCloud, including setup, model constraints, synchronization behavior, and live sync-state handling.

  1. Core Data with CloudKit: The BasicsCore Data with CloudKit brings cloud storage and multi-device synchronization capabilities to Core Data applications. This article will introduce the basic knowledge of it.
  2. Core Data with CloudKit: Syncing Local Database to iCloud Private DatabaseIn this article, we will explore the most common scenario in Core Data with CloudKit applications—synchronizing the local database with the iCloud private database.
  3. Core Data with CloudKit: Exploring the CloudKit DashboardThis article explores the CloudKit dashboard.
  4. Core Data with CloudKit: TroubleshootingThis article discusses some common issues encountered in developing Core Data with CloudKit projects, aiming to help everyone avoid detours and pitfalls.
  5. Core Data with CloudKit: Synchronizing Public DatabaseThis article will introduce how to synchronize a public database to the local environment, creating a local Core Data database mirror using Core Data with CloudKit.
  6. Core Data with CloudKit: Sharing Data in the iCloudIn this article, we will explore how to create applications that share data with multiple iCloud users using Core Data with CloudKit.
  7. Switching Core Data Cloud Sync Status in Real-TimeCore Data with CloudKit itself does not offer an option to enable or disable cloud synchronization in real-time. This article will attempt to propose a solution to this issue.

Cloud Document Service.

For document-based apps, these articles compare iCloud Documents workflows from basic integration to advanced coordination and file handling.

  1. In-Depth Guide to iCloud Documents: Fundamental Setup and File OperationsIn this article, we will discuss how to integrate iCloud Documents into applications, perform file read and write operations, and respond to changes in file content.
  2. Advanced iCloud Documents: Understanding Placeholder Files, Space Optimization, and Operational TechniquesIn this article, we will discuss the unique characteristics of the iCloud Documents folder, the importance and applications of placeholder files, and we will also explore tips and techniques related to file operations and debugging.

Cloud Key-Value Data Storage Service.

A lightweight path for small preference-like values that should follow a user across devices, with NSUbiquitousKeyValueStore as the main API.

  1. Using NSUbiquitousKeyValueStore with SwiftUINSUbiquitousKeyValueStore is an official solution provided by Apple for sharing key-value data across devices. This article offers a simple introduction to its usage, focusing on how to conveniently use NSUbiquitousKeyValueStore in SwiftUI.