How to correctly initialize a view model in SwiftUI: https://chris.eidhof.nl/post/swiftui-view-model/ (for when the view needs ownership of the view model).
SwiftUI View Model Ownership — Chris Eidhof

@chris The way I've been handling it (in small hobby apps, take with grain of salt) is to *always* put view models in the environment. In line with your article's advice, this has the advantage that it ensures state is updated in a body function.

Relevant to a discussion I was having with @orj recently, SwiftUI thrives on very few view models so using the environment makes sense (better drives a deep tree of views or passing through utility layout views).

@cocoawithlove @orj yeah, tbh, I don't use view models. The reason I wrote is is that this specific question in this form (the view should own it) comes up so often that I figured it'd be nice to have something to link to.
@chris What approach do you use instead of view models, typically?
@thehonkingsmith mostly plain structs in regular or state properties. I don't really build real apps 😅