Overview
- I have a navigation split view.
- The detail view contains a model now this model depends on id from the parent view.
Questions
- How can I pass data from the parent view and yet create the view in the detail view?
- Or should I be pass the model from the parent view, but the problem is the parent view needs to persist model.
- Or is there a better approach?
The 3rd option looks good.
.onAppear() and .task{} are better suited for processing data when the view is displayed than the init{} function. However, a query could be created in init{} to load data. There are different ways to do this; it always depends on what makes sense for the situation.