I have poured over this for hours and I can say with 99% certainty that I know what is breaking but I don't know why or how to fix it.
@State private var timeSet = false {
willSet {
if newValue {
flyingHours = timeMachine.calculateTotalFlightHours()
}
}
}
The code above stops working when I use
AddSortie().environment(\.managedObjectContext, self.moc)
with the button to trigger the popover. timeSet never becomes true, or if it does it very quickly resets to false.
However, by leaving off the .environment
AddSortie()
timeSet does become true at the appropriate time and the app works as expected... Except without .environmtnt I can not save to CoreData.
Any ideas?
For what it's worth I am working in XCode 12 Beta 2
Thanks