Skip to content

Commit 66dbeee

Browse files
committed
iOS: pre-create Application Support dir so SwiftData store opens cleanly on first launch (no CoreData recovery noise on device)
1 parent 5650824 commit 66dbeee

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ios/OpenProgression/App/OpenProgressionApp.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ import SwiftData
44
@main
55
struct OpenProgressionApp: App {
66
@State private var store = DataStore()
7+
8+
init() {
9+
// SwiftData's default store lives in Application Support, which doesn't exist
10+
// on a fresh install. Create it up front so the store opens cleanly (avoids
11+
// the first-launch CoreData "failed to create file" recovery noise).
12+
try? FileManager.default.createDirectory(
13+
at: URL.applicationSupportDirectory, withIntermediateDirectories: true)
14+
}
15+
716
var body: some Scene {
817
WindowGroup {
918
RootView()

0 commit comments

Comments
 (0)