---
title: "headerView(forSection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableview/headerview(forsection:)"
---

# headerView(forSection:)

Returns the header view for the specified section.

## Declaration

```swift
func headerView(forSection section: Int) -> UITableViewHeaderFooterView?
```

## Parameters

- `section`: An index number that identifies a section of the table. Table views in a plain style have a section index of zero.

## Return Value

Return Value The header view associated with the section, or nil if the section does not have a header view.

## See Also

### Getting cells and section-based views

- [cellForRow(at:)](uikit/uitableview/cellforrow(at:).md)
- [footerView(forSection:)](uikit/uitableview/footerview(forsection:).md)
- [indexPath(for:)](uikit/uitableview/indexpath(for:).md)
- [indexPathForRow(at:)](uikit/uitableview/indexpathforrow(at:).md)
- [indexPathsForRows(in:)](uikit/uitableview/indexpathsforrows(in:).md)
- [visibleCells](uikit/uitableview/visiblecells.md)
- [indexPathsForVisibleRows](uikit/uitableview/indexpathsforvisiblerows.md)
