Can you set an @ObservedObject var with the type of struct (that accepts generics) without explicitly stating that type?

Maybe this is only an example of your code and it normally has more data in it.

Of course this is only an example. The real code calls structs that rely on other View Model than it’s own. For example, I have a custom component that has its own View Model, but also needs another View Model passed to it via @ObservedObject as, when long-pressed, it calls another custom component struct (pop-up menu) that has its own View Model. I hope this makes sense.

Generally you’d create a new specific view model for ContentView and pass that.

If there’s another way to pass a reference View Model down from view to view, other than @EnvironmentObject which I know of, then I’d happily use it. I want to apply proper coding techniques so please let me know if I’m still doing it wrong.

/r/SwiftUI Thread Parent