Working with UICollectionView
In the previous section, we took on the mighty UITableView
– learning all about the delegate pattern and how to build our unique lists with custom cells. In this section, we'll take a look at UICollectionView
, mainly looking at how we are comparing one class to another.
From the outset, when asked what the fundamental differences are between them both, most people will initially say the same thing: "Collection views allow horizontal scrolling" – which is very true, but what it's doing is harnessing the power of UITableView
with the ability to manipulate and override a layout that would allow a grid layout, for example.
If you need to go deeper into a complex custom layout, this again is where UICollectionView
comes into play, with the support of the UICollectionViewDelegateFlowLayout
protocol, allowing you as a developer to manipulate custom layouts.
Setting up our collection view
Let's start by creating...