Skip to content
How to create a custom UICollectionViewFlowLayout for a UICollectionView
Swift
Branch: master
Clone or download

README.md

UICollectionView Custom Layout: the Ultimate Tutorial

This project shows the basics about how to create a custom UICollectionViewFlowLayout for a UICollectionView.

To cover most of the configurations you can encounter while working on a UICollectionView, I created 3 sections with 3 different layouts:

  • section 1: a cell with fixed size
  • section 2: a cell with a fixed width and a dynamic length
  • sections 3 & 4: multiple cells aligned on a grid, with fixed size

I also added resizable headers in the sections 3 and 4.

Custom layout

Tutorials

You will find all the details about the project in 2 tutorials:

Compatibility

This project works on all iPhones and iPad (portrait, landscape, and with multitasking). Give it a try!

Contact

You can ping me on Twitter @cath_schwz, open an issue on GitHub or leave a comment on my blog strawberrycode.com :)

You can’t perform that action at this time.