'Swift UICollectionView with Multiple Persisted Grids
I've got an approach question here.
I'm trying to make something like the instagram profile, where there is a UICollectionView that has a header, and a UISegmentedControl. I don't want the UISegmented to contorl to reload the data of the collection view with every click, I want the different grids to exist all at once, and swiping between them keeps doesn't reload the data every time (if the grid has already been loaded). Here is a video of what I mean:
Further, I'm trying to figure out how I can make both of these grids interact with the UICollectionVew headers (supplimentary view of kind header), such that when you scroll down past the headers, the grids scroll as well. Here is a video of what I mean:
I've been struggling with how to achieve all of these behaviors. My current attempt was to have a single cell in the collection view that is a paged horizontal ScrollView where each page was its own collection view. This achieved my constraint of having two separate grids that I can change between without reloading the collectionView's data. But, this doesn't interact with the headers in the manner that I had hoped for, and scrolling past the headers comes to an abrupt stop (gif #2).
I'm wondering if there is a way to achieve this with one collection view that I am unaware of. Any ideas are much appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


