List adapter in iOS #2

Sayler8182
1 min readAug 27, 2018

The basics were raised in my previous article. You can find source code here.

Adapter with multiple cells

Previously we have created presenter for one cell, but adapter isn’t limited for only one cell. So, we can change CellPresenter name for more clearly:

First presenter

And similarly add more cells with their own presenters. Second cell will be as simple as the first one and for third will have custom model.

Second presenter
Third presenter with custom model

At the end just set more presenters in adapter:

Result

Source

[Part 1]

Thank you for reading! If you liked this article, please clap so other people can read it too. I will also have more motivation for next article :) You can also see my other articles, maybe you will find something for you.

If you have any question or suggestion leave a comment.

--

--