On iOS 14 / Xcode 12 this no longer seems to work. Given the following code which creates a new assignment and passes it into the editor view when the user taps a "New Assignment" button, the value of assignment remains nil. Is anyone else experiencing similar behaviour?
Code Block Swift struct ContentView: View { @Environment(\.managedObjectContext) var context @State var assignmentEditorIsPresented = false @State var assignment: Assignment? = nil var Body: some View { [...] Button("New Assignment", action: { self.assignment = Assignment(context: context) self.assignmentEditorIsPresented = true }) .sheet(isPresented: assignmentEditorIsPresented) { [...] } } }
What's even weirder is that I tried adding a random piece of state, an Int, to this view and modifying it right before the assignment state (between lines 9 and 10) and it didn't change either.
Code Block Swift Text("\(assignment?.description ?? "")" .hidden()
I've sent in a bug report (FB7823148) through Feedback Assistant.