UICollectionView horizontal paging - can I use Flow Layout?
ios, uicollectionview, uicollectionviewlayout, uikit
Solution
You're right – that's not how a stock horizontally-scrolling collection view lays out cells. I'm afraid that you're going to have to implement your own custom `UICollectionViewLayout` subclass. Either that, or separate your models into sections.
Problem
This is related to but distinct from To use Flow Layout, or to Customize?. Here is an illustration of what I’m trying to do: I’m wondering if I can do this with a `UICollectionViewFlowLayout`, a subclass thereof, or if I need to create a completely custom layout? Based on the WWDC 2012 videos on UICollectionView, it appears that if you use Flow Layout with vertical scrolling, your layout lines are horizontal, and if you scroll horizontally, your layout lines are vertical. I want horizontal layout lines in a horizontally-scrolling collection view. I also don’t have any inherent sections in my model - this is just a single set of items. I could group them into sections, but the collection view is resizable, so the number of items that can fit on a page would change sometimes, and it seems like the choice of which page each item goes on is better left to the layout than to the model if I don’t have any meaningful sections. So, can I do this with Flow Layout, or do I need to create a custom layout?