List adapter in iOS — Sections #3

Sayler8182
Sep 8, 2018 · 2 min read

In my previous articles I created simple adapter and complex adapter with many different cells. Now I want to go step further and create adapter that can contain many sections.

To do this I had to create one more protocol for table section

And I also had to improve my previous version of adapter

This version allows me to create simple implementation of plain table view and grouped with new section adapter.

Now I create view and presenter for header (similar as cells)

Of course view (like cells) have to be registered

And finally we can create data source for our new adapter

I didn’t create the footer but as you’ve probably noticed, you can do it analogically to the header.


Source

[Part 1]
[
Part 2]

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade