Take a look at @SceneStorage.
Post
Replies
Boosts
Views
Activity
Same issue for me. I filed FB7829539.
@keelay The store is being created lazily - when it's injected into the environment. As far as saving after certain actions, you can use the MOC in SwiftUI just as you would in a UIKit or AppKit app. This example also saves when the scene goes into the background state.
Errr, that last post doesn't look right but hopefully you get the idea.
ZStack {
	 Color.red
	 MyView()
}
I got around this by using a ZStack.
Color.red
MyOtherView()
}
Turns out, DTS tells me this is because of a bug in CoreML... which will hopefully be fixed in the next release.
It looks like your content view isn't wrapped in a NavigationView, only the detail. That won't work, it's like a parent/detail relationship.ContentView.swift:
var body: some View {
NavigationView {
HStack {
NavigationLink(destination: DetailView()) {
Text("Summary")
}
}
}
}
From the DetailView.swift file (remove the second navigation view):
var body: some View {
VStack {
Text("Detail View")
}
}