Contents

UICollectionViewDelegateFlowLayout

The methods that let you coordinate with a flow layout object to implement a grid-based layout.

Declaration

@MainActor protocol UICollectionViewDelegateFlowLayout : UICollectionViewDelegate

Overview

The methods of this protocol define the size of items and the spacing between items in the grid. All of the methods in this protocol are optional. If you don’t implement a particular method, the flow layout delegate uses values in its own properties for the appropriate spacing information.

The UICollectionViewFlowLayout object expects the collection view’s delegate object to adopt this protocol. Therefore, implement this protocol on the object assigned to your collection view’s delegate property.

Topics

Getting the size of items

Getting the section spacing

Getting the header and footer sizes