Middle
What happens if the Router property remains only as a reference without the Published mark, and it is required to initiate its update?
sobes.tech AI
Answer from AI
If the Router property is declared as a regular reference without the @Published annotation, then SwiftUI or Combine will not automatically track changes to this property and will not trigger updates to related views or subscribers.
This means that when the state inside the Router changes, the interface will not update because the reactive update mechanism will not activate. To trigger an update, you need to manually call update methods or use @Published or another mechanism that notifies about changes.
For example, if Router is a class with internal mutable properties, then without @Published, changes will not be broadcast outward, and the UI will remain in its old state.