Dec 16, 2023
It doesn't matter from where it obtains the view. What matters is whether or not someone else is maintaining a hard reference to the object in question.
If they had done an inline initialization and passed the ObservedObject in from the parent in RandomView the result would have been the same.
CounterView(viewModel: CounterViewModel())
See:
https://medium.com/better-programming/swiftui-the-unsafeobservedobject-quiz-467bb8554262