Document Based SwiftData support in Immersive Scene?

Is it possible to edit a SwiftData document in an immersive scene? If so... how?

At the moment I see that the modelContext is available in the contentView of a documentGroup, but can Document Data be made available to an Immserive scene's content?

Replies

I notice that once I open a second ModelContainer on same URL as the document that's open in the DocumentGroup, then all saves to the DocumentGroup's model container fail with:

Error saving the database Error Domain=NSCocoaErrorDomain Code=134020 "The model configuration used to open the store is incompatible with the one that was used to create the store." UserInfo={NSAffectedObjectsErrorKey=<NSManagedObject: 0x6000021b97c0> (entity: Blah; id: 0x60000026e0c0 <x-coredata:///Blah/tAC19CF5F-052B-4CF6-B7CD-EDA188FC54BE13>; data: {
    id = "91E56F61-CFE0-42E4-9EA9-EAD4256B64AB";
    imageData = nil;
    name = "Untitled Blah";
})}

I will assume that this is just not a good idea right now, and conclude that Document based SwiftData apps do not work well with multiple scenes.