O'Reilly logo

iOS UICollectionView: The Complete Guide, Second Edition by Ash Furrow

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Crafting Custom Layouts Using UICollectionViewLayout

In the preceding chapter, I wrote that UICollectionViewFlowLayout is great for line-based, breaking layouts and that you should always resort to using it first. Sometimes, however, our layouts are sufficiently complicated to warrant the use of something more powerful. UICollectionViewLayout is the superclass of UICollectionViewFlowLayout and it is hands on. You are responsible for everything—the layout of cells, the size of the collection view—everything. We’ll take a look at an example where you’d want to use it, revisit decoration views, and explore a little bit of changing between layouts programmatically with animation. At the end of this chapter, we build a really cool photos application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required