disable CloudKit until container is set up in Developer Portal

Use explicit ModelConfiguration with cloudKitDatabase: .none
to prevent CloudKit from failing on store load. Can be switched
to .automatic once the iCloud container is created.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 23:13:05 +01:00
parent b442c13719
commit 8892f658f8

View File

@@ -3,10 +3,26 @@ import SwiftUI
@main
struct VoiceDiaryApp: App {
let modelContainer: ModelContainer
init() {
let schema = Schema([DiaryEntry.self, VoiceMemo.self])
let configuration = ModelConfiguration(
"VoiceDiary",
schema: schema,
cloudKitDatabase: .none
)
do {
modelContainer = try ModelContainer(for: schema, configurations: [configuration])
} catch {
fatalError("Failed to create ModelContainer: \(error)")
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
.modelContainer(for: DiaryEntry.self)
.modelContainer(modelContainer)
}
}