Hello,
I am trying to set up Widgets in my app. I want to fetch my data in the SwiftData container that is shared between my app and my WidgetExtension with App Group.
let modelContext = ModelContext(modelContainer)
let predicate = #Predicate<Test>{
return $0.attribute == true
}
return try modelContext.fetch(FetchDescriptor (predicate: predicate, sortBy: [SortDescriptor(\Test.name)]))
When this code is run in my WidgetExtension, returned objects attributes values are replaced with "<private>" string.
In the logs, Swift Data writes
Query returned unrequested identifiers that have been dropped: <private>
Any idea what I might be doing wrong to share my SwiftData between my App and my Widget?
App Groups capability has been added to both apps and extension with the same identifier.
Thank you