Last active
October 2, 2024 18:26
Revisions
-
StewartLynch renamed this gist
Oct 2, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
StewartLynch created this gist
Oct 2, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ import SwiftData import SwiftUI struct MockData: PreviewModifier { func body(content: Content, context: ModelContainer) -> some View { content .modelContainer(context) } static func makeSharedContext() async throws -> ModelContainer { let container = try! ModelContainer( for: <#Model#>.self, configurations: ModelConfiguration(isStoredInMemoryOnly: true) ) // Insert objects here return container } } extension PreviewTrait where T == Preview.ViewTraits { static var mockData: Self = .modifier(MockData()) }