Juanpe Catalán
1 min readSep 22, 2017

--

Great series of blog posts 👍🏼 . thanks for share it 🙂

But in my opinion, with this solution you’re keeping the if block, you’re just only moving it to another place, in this case, the factory, right?

What do you think if you apply the strategy pattern over cells with a protocol, and each cell know what is his “drawer”(TableCellController)?

Now, when you are creating the view model, you can inject this dependency, and you don’t need to use the if block.

--

--