It develops an iOS application and its basic architecture is a MVV ™ design model. Using coordinators for navigation logic.
I have the situation, where I have a complex user interface with different components. It is obvious that I have to modularize my design and create several ViewModels for different subsections or views of the user interface. All of these elements are associated with a parent view.
My question is: where should I keep these ViewModel references?
I have the following options. Help me choose the right approach among these.
1). Having a parent view allows this parent view to retain these references to these child ViewModels and to pass updates between them.
2). Have a parent ViewModel. Match these child ViewModels to this parent ViewModel and manage the ViewModel child updates in ParentViewModel and pass them to the view.
3). Allows the coordinator to have these references to the ViewModels child and to manage updates between them in the coordinator and switch to view.
Or is there another standard practice than this one? Please help me to have a clear path here.
Any suggestions with some examples will be more useful.