---
title: "tableView(_:willDisplayHeaderView:forSection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:willdisplayheaderview:forsection:)"
---

# tableView(_:willDisplayHeaderView:forSection:)

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

## Declaration

```swift
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.

## See Also

### Providing custom header and footer views

- [tableView(_:viewForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:viewforheaderinsection:).md)
- [tableView(_:viewForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:viewforfooterinsection:).md)
- [tableView(_:willDisplayFooterView:forSection:)](uikit/uitableviewdelegate/tableview(_:willdisplayfooterview:forsection:).md)
