Update: The bug might not be with SwiftData or Observation framework, but rather in SwiftUI registering tracking for the observable.
If I add this to the body above I do get the view updating.
Section {
Text("Planes departing = \(airport.numberOfAirplanesDeparting)")
Text("Planes in flight = \(airport.numberOfAirplanesInFlight)")
Text("Planes landing = \(airport.numberOfAirplanesLanding)")
}
And it updates the text in the footer as well.
But with only the 3 Text views in the footer SwiftUI will not update when the airport's computed properties change.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: