Setting the Number of Columns in a CollectionView

Photo by Mauricio Artieda on Unsplash

With just a little bit of code you can control how many columns your collection view will display.

Here’s what to do:

First click on your collection view in the storyboard. Then click on the Size Inspector. Make sure that Estimate Size is set to None and that Section Insets are set to 0.