A UIViewController maintains a reference to a UICollectionView. The controller should modify the built-in flow layout using the UICollectionViewDelegateFlowLayout.
I
Just self.collectionView.delegate = self;
. Note that UICollectionViewDelegateFlowLayout
inherits from UICollectionViewDelegate
.
I admit it caught me off guard at first.
Oh and this will only work if self.collectionView.collectionViewLayout
is actually set to your flow layout. (or set with initWithFrame:collectionViewLayout:
)