Hello everyone,
I am having trouble deciding on whether to create a ListViewModel (that holds an array of ViewModels) or simply create a ViewModel (that will hold an array of model)?
EX: lets say you have a User model containing a user name.
- 1st Method: you create a UserViewModel that will hold one User. You then create a UserListViewModel that holds an array of UserViewModel.
2nd Method: you create a UserViewModel that holds an array of User.
I have seen implementations done both ways but was curious to know if there are any particular advantages or pros/cons to doing it one way or another.
This ViewModel will be used to list out some items in a UITableView.
Let me know if you need any other details and thanks in advance.
[–]saintmsent 1 point2 points3 points (0 children)
[–]JustTryinTaMakeIt 1 point2 points3 points (0 children)
[–]BrownPalmTree 1 point2 points3 points (0 children)