how to set up something like a collectionview in a tableview?
<p>Here is a visual example of what I would like to achieve.</p>
<p><img src="https://i.stack.imgur.com/Mvh0D.png" alt="sample of the design" /></p>
<p>My initial idea was to use a UICollectionView with custom cells, but that didn't work out very well and trying out collectionview within a collectionview was even worse.</p>
<p>So I tried to do a collectionview in a tableview and that kind of worked but the tableviewcell's dynamic height proved to be a gigantic issue which was super difficult for me to solve as I have only just begun to learn swift and iOS developing. Please help :(</p>
<p><strong>EDIT:</strong>
note that the &quot;Shopping Mall 1&quot; section is meant to be a sticky header of sort. Similar to this (the turquoise header):</p>
<p><a href="https://web.archive.org/web/20201119115620/https://camo.githubusercontent.com/6b3e2209c0d3634fdd1fccbc8adc1a9276be9e80/687474703a2f2f662e636c2e6c792f6974656d732f3371327533353031336f30793047326f335831762f63617273686172652d33322d31362d68616c662e676966" rel="nofollow noreferrer"><img src="https://web.archive.org/web/20201119115620/https://camo.githubusercontent.com/6b3e2209c0d3634fdd1fccbc8adc1a9276be9e80/687474703a2f2f662e636c2e6c792f6974656d732f3371327533353031336f30793047326f335831762f63617273686172652d33322d31362d68616c662e676966" alt="gif" /></a></p>
<p>credits: <a href="https://github.com/jamztang/CSStickyHeaderFlowLayout" rel="nofollow noreferrer">https://github.com/jamztang/CSStickyHeaderFlowLayout</a></p>
<p>but I was using <a href="https://github.com/petec-blog/CollectionViewStickyHeaders" rel="nofollow noreferrer">https://github.com/petec-blog/CollectionViewStickyHeaders</a> as an example as it was clearer and closer to what I needed.</p>