Horizontally scrollable cell within vertically scrollable collection view: best way to implement?

Viewed 289

I already have a UICollectionView whose layout is of UICollectionViewFlowLayout type and scroll direction is vertical. Something similar to this (from this site)

App Store

Now I need to add some sections to this collection view whose cells can show a horizontally scrollable collection of custom cells that will be different from the ones I already have. Something similar to this (also from this site):

enter image description here

I also need the items there to have a width less than the screen's width and to be able to see part of the next and previous items.

Behaviour of the horizontal scrolling could be either continuous like, let's say, the "Stories" section in Facebook app:

Facebook app

or with paging like in the App Store app I showed before.

Question: which would be the best way to implement this?

A) Outer collection view (vertical scroll) --> custom cell containing an inner collection view (horizontal scroll) --> items are inner collection view's cells

In this case, how would pagination be implemented?

B) Outer collection view (vertical scroll) --> custom cell containing a scroll view (horizontal scroll) --> items are views added as scroll view's subviews

In this case, how would pagination be implemented?

C) A different approach would be the most appropriate?

EDIT: another consideration: items to be horizontally scrollable will be different for iPhone and iPad devices.

0 Answers
Related