Stack to Grid UIcollectionView with dynamically changing number of sections

152 views Asked by At

I am using two subclasses of UICollectionViewController, StackViewController and GridViewController. I am using a stack type gallery at first and then the transition happens when pinching any cell.

In the stack I have 5 albums so I passed numberofsections as 5 and then, when the user pinches out, transition to another controller which is using grid layout n then m returning numberofSections as 1.

The problem is all other albums in the stack gallery disappear when I pinch because I had set numberofsections to 1. I tried to return a different datasource for UICollectionView from the different controller but it only uses the StackViewController datasource.

0

There are 0 answers