Post

Replies

Boosts

Views

Activity

Reply to modelContainer in SwiftData
@main struct MonApp: App { var body: some Scene { WindowGroup { ContentView() .modelContainer(for: Valeur.self, inMemory: true) //Preview } .modelContainer(for: Valeur.self) //Recommended by Apple } }I just added inMemory: true after ContentView, it doesn't keep my base in preview in memory. Can you explain to me? Thank you very much.
1w
Reply to modelContainer in SwiftData
Hello Pokpong, Thanks for the reponse, @main struct MonApp: App { var body: some Scene { WindowGroup { ContentView() .modelContainer(for: Valeur.self) } .modelContainer(for: Valeur.self) } }.modelContainer after ContentView works very well when I'm in preview .modelContainer after WindowGroup works very well when I'm in play (Recommended by Apple) I feel like I have 2 different databases, what I write in one does not appear in the other Do you think I should stay on the use recommended by Apple (after the WindowGroup) and when I want to test my application, I use the reading and not the preview. Thanks, good day
1w
Reply to modelContainer in SwiftData
@main struct MonApp: App { var body: some Scene { WindowGroup { ContentView() .modelContainer(for: Valeur.self, inMemory: true) //Preview } .modelContainer(for: Valeur.self) //Recommended by Apple } }I just added inMemory: true after ContentView, it doesn't keep my base in preview in memory. Can you explain to me? Thank you very much.
Replies
Boosts
Views
Activity
1w
Reply to modelContainer in SwiftData
Hello Pokpong, Thanks for the reponse, @main struct MonApp: App { var body: some Scene { WindowGroup { ContentView() .modelContainer(for: Valeur.self) } .modelContainer(for: Valeur.self) } }.modelContainer after ContentView works very well when I'm in preview .modelContainer after WindowGroup works very well when I'm in play (Recommended by Apple) I feel like I have 2 different databases, what I write in one does not appear in the other Do you think I should stay on the use recommended by Apple (after the WindowGroup) and when I want to test my application, I use the reading and not the preview. Thanks, good day
Replies
Boosts
Views
Activity
1w