---
title: UICollectionViewDelegateFlowLayout
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uicollectionviewdelegateflowlayout
---

# UICollectionViewDelegateFlowLayout

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

## Declaration

```swift
@MainActor protocol UICollectionViewDelegateFlowLayout : UICollectionViewDelegate
```

## Overview

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

- [collectionView(_:layout:sizeForItemAt:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:sizeforitemat:).md)

### Getting the section spacing

- [collectionView(_:layout:insetForSectionAt:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:insetforsectionat:).md)
- [collectionView(_:layout:minimumLineSpacingForSectionAt:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:minimumlinespacingforsectionat:).md)
- [collectionView(_:layout:minimumInteritemSpacingForSectionAt:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:minimuminteritemspacingforsectionat:).md)

### Getting the header and footer sizes

- [collectionView(_:layout:referenceSizeForHeaderInSection:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:referencesizeforheaderinsection:).md)
- [collectionView(_:layout:referenceSizeForFooterInSection:)](uikit/uicollectionviewdelegateflowlayout/collectionview(_:layout:referencesizeforfooterinsection:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [UICollectionViewDelegate](uikit/uicollectionviewdelegate.md)
- [UIScrollViewDelegate](uikit/uiscrollviewdelegate.md)
