In a SwiftUI view it is easy to pull mainContext out of the Environment (thanks for that).
I have two questions:
(1) In Nick's code he shows:
let context = self.newSwiftContext(from: Trip.self)
can you say more about this method newSwiftContext(). How should we implement it to fetch a new context from the same container?
(2) In Core Data we usually read from the main context but write to a child of main context off the main thread and then the parent is notified it needs to refresh. How do we do that with SwiftData or is that managed for us?
Thanks,
Daniel