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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user