<!--
{
  "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/UITableViewDelegate/tableView(_:willDisplayHeaderView:forSection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDelegate(im)tableView:willDisplayHeaderView:forSection:"
  },
  "title" : "tableView(_:willDisplayHeaderView:forSection:)"
}
-->

# tableView(_:willDisplayHeaderView:forSection:)

Tells the delegate that the table is about to display the header view for the specified section.

```
optional func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int)
```

## Parameters

`tableView`

The table view informing the delegate of this event.

`view`

The header view that is about to be displayed.

`section`

The index number of the section containing the header view.

## Discussion

---

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)