5. Crafting Custom Layouts Using UICollectionViewLayout

In Chapter 4, “Organizing Content with UICollectionViewFlowLayout,” I mentioned that UICollectionViewFlowLayout is great for line-based, breaking layouts. You also found out that you should always use it first. Sometimes, however, layouts are sufficiently complicated to warrant the use of something more powerful. UICollectionViewLayout is the superclass of UICollectionViewFlowLayout and it is work-intensive. You are responsible for everything—the layout of cells, the size of the collection view—everything. This chapter provides an example where you’d like to use it, revisits decoration views, and explores a little bit of changing between layouts programmatically with animation. At the end ...

Get iOS UICollectionView: The Complete Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.