<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewFlowLayout/headerReferenceSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewFlowLayout(py)headerReferenceSize"
  },
  "title" : "headerReferenceSize"
}
-->

# headerReferenceSize

The default sizes to use for section headers.

```
var headerReferenceSize: CGSize { get set }
```

## Discussion

If the delegate does not implement the [`collectionView(_:layout:referenceSizeForHeaderInSection:)`](/documentation/UIKit/UICollectionViewDelegateFlowLayout/collectionView(_:layout:referenceSizeForHeaderInSection:)) method, the flow layout object uses the default header sizes set in this property.

During layout, only the size that corresponds to the appropriate scrolling direction is used. For example, for the vertical scrolling direction, the layout object uses the height value returned by your method. (In that instance, the width of the header would be set to the width of the collection view.) If the size in the appropriate scrolling dimension is 0, no header is added.

The default size values are (0, 0).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)