Michael Long
1 min readJun 7, 2019

--

When the complexity increases, the complexity increases. ;)

Regardless, the end goal is to keep as much of that complexity as you can in the view model where it can be tested.

One might, for example, map the data into an array of arrays, with each sub-array being a mapped struct indicating the type of cell to construct, the cell’s title, etc..

Then you can feed the VM dummy data and ensure that everything maps out as it should.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet