So I read about the VIPER architecture and I was wondering, how you would implement a master-detail view combination using the proposed layer separation between View, View Model, Presenter and View Controller Routing?
Let's say I want to display some contacts. I have the ContactsListViewModel
with its properties name, photo and maybe some detail text. This is known to the ContactsListPresenter
and ContactsListViewController
.
Now I select a contact in my table view, the view controller tells this to the presenter and the presenter tells the wireframe to show the detail view for ... what?
The view model that is known to the List module does not contain enough information to be displayed in detail (like further notes, call list, whatsoever …).
In this case, should there be a view model that can be used for both list and detail view? Would that be a violation of separation of concerns?
As I understand you have 2 options -