CloudKit

Store and sync your app's data in iCloud, with no servers to run.

Introduced
2014
WWDC14
Kind
Framework
Runs on
Get it from
iOS
8.0+
iPadOS
8.0+
Mac Catalyst
13.0+
macOS
10.10+
tvOS
9.0+
visionOS
1.0+
watchOS
3.0+

Overview

CloudKit moves data between your app and iCloud containers: a private database for each person, a public database everyone can read, and shared records for collaboration. People sign in with their Apple Account, so there are no accounts or servers for you to manage.

CKSyncEngine handles the hard parts of syncing, and SwiftData and Core Data can use CloudKit to sync automatically.

Databases

Private, public and shared databases in iCloud.

CKSyncEngine

Sync local data with iCloud, handled for you.

Sharing

Collaborate on records with other iCloud users.

No servers

Authentication, storage and push included.

SaveNote.swift
import CloudKit let database = CKContainer.default().privateCloudDatabase let note = CKRecord(recordType: "Note") note["title"] = "Groceries" note["body"] = "Coffee, oat milk, bread" let saved = try await database.save(note) print("Saved", saved.recordID.recordName)

History

How it grew up.

2014

Introduced

Arrives with iOS 8 and OS X Yosemite.

2015

CloudKit JS

Web apps and servers reach CloudKit through CloudKit JS and web services.

2016

Sharing

Share records with other iCloud users in iOS 10.

2019

Core Data sync

Core Data mirrors to CloudKit automatically.

2023

CKSyncEngine

A high-level engine for syncing records.