Skip to content

Commit c3f3978

Browse files
A few small docs updates (#224)
* Update some docs. * wip * Update Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md --------- Co-authored-by: Stephen Celis <stephen@stephencelis.com>
1 parent e9b1917 commit c3f3978

2 files changed

Lines changed: 12 additions & 25 deletions

File tree

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,7 @@
144144
}
145145

146146
guard let containerIdentifier else {
147-
throw SchemaError(
148-
reason: .noCloudKitContainer,
149-
debugDescription: """
150-
No default CloudKit container found. Please add a container identifier to your app's \
151-
entitlements.
152-
"""
153-
)
147+
throw SchemaError.noCloudKitContainer
154148
}
155149

156150
let container = CKContainer(identifier: containerIdentifier)
@@ -1868,13 +1862,7 @@
18681862
?? ModelConfiguration(groupContainer: .automatic).cloudKitContainerIdentifier
18691863

18701864
guard let containerIdentifier else {
1871-
throw SyncEngine.SchemaError(
1872-
reason: .noCloudKitContainer,
1873-
debugDescription: """
1874-
No default CloudKit container found. Please add a container identifier to your app's \
1875-
entitlements.
1876-
"""
1877-
)
1865+
throw SyncEngine.SchemaError.noCloudKitContainer
18781866
}
18791867

18801868
let databasePath = try PragmaDatabaseList.select(\.file).fetchOne(self)
@@ -1929,6 +1917,14 @@
19291917
package var errorDescription: String? {
19301918
"Could not synchronize data with iCloud."
19311919
}
1920+
1921+
static let noCloudKitContainer = Self(
1922+
reason: .noCloudKitContainer,
1923+
debugDescription: """
1924+
No default CloudKit container found. Make sure to enable iCloud entitlements in your \
1925+
app's "Signing & Capabilities" and add a container identifier.
1926+
"""
1927+
)
19321928
}
19331929

19341930
fileprivate func validateSchema() throws {

Sources/SQLiteData/Documentation.docc/Articles/CloudKit.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ The steps to set up your SQLiteData project for CloudKit synchronization are the
4141
[same for setting up][setup-cloudkit-apple] any other kind of project for CloudKit:
4242

4343
* Follow the [Configuring iCloud services] guide for enabling iCloud entitlements in your project.
44-
* Follow the [Configuring background execution modes] guide for adding the Background Modes
45-
capability to your project.
44+
* Follow the [Configuring background execution modes] guide for adding the "Background Modes"
45+
capability to your project and turning on "Remote notifications".
4646
* If you want to enable sharing of records with other iCloud users, be sure to add a
4747
`CKSharingSupported` key to your Info.plist with a value of `true`. This is subtly documented
4848
in [Apple's documentation for sharing].
@@ -716,10 +716,6 @@ migrator.registerMigration("Convert 'remindersLists' table primary key to UUID")
716716
// IDs to UUIDs
717717
try #sql("""
718718
INSERT INTO "new_remindersLists"
719-
(
720-
"id",
721-
-- all other columns from 'remindersLists' table
722-
)
723719
SELECT
724720
-- This converts integers to UUIDs, e.g. 1 -> 00000000-0000-0000-0000-000000000001
725721
'00000000-0000-0000-0000-' || printf('%012x', "id"),
@@ -763,11 +759,6 @@ migrator.registerMigration("Convert 'reminders' table primary key to UUID") { db
763759
// IDs to UUIDs
764760
try #sql("""
765761
INSERT INTO "new_reminders"
766-
(
767-
"id",
768-
"remindersListID",
769-
-- all other columns from 'reminders' table
770-
)
771762
SELECT
772763
-- This converts integers to UUIDs, e.g. 1 -> 00000000-0000-0000-0000-000000000001
773764
'00000000-0000-0000-0000-' || printf('%012x', "id"),

0 commit comments

Comments
 (0)