Karthikkeyan Bala Sundaram
1 min readJul 26, 2018

--

I really depends on whats the definition of ViewModel in your architecture. In the architecture explained in the the above article, backing layer of a view controller, which talks to service layer and makes service calls, so I wouldn’t recommend using view models to pass around views.

However, if definition of View Model is the literal definition(https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) then you can, of course, pass those to views.

I generally use private categories/extensions for the cells inside the controller files, in order to keep the code clean. If you are following the same architecture as mine, then I would recommend you to do the same. If you really want to create a separate class then I would recommend you to use different terminology(say for example `ProfileCellUserPresentable`) for this purpose.

--

--

No responses yet