---
title: "tableView(_:estimatedHeightForRowAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:estimatedheightforrowat:)"
---

# tableView(_:estimatedHeightForRowAt:)

Asks the delegate for the estimated height of a row in a specified location.

## Declaration

```swift
optional func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat
```

## Parameters

- `tableView`: The table view requesting this information.
- `indexPath`: An index path that locates a row in tableView.

## Mentioned in

Estimating the height of a table’s scrolling area

## Return Value

Return Value A nonnegative floating-point value that estimates the height (in points) that row should be. Return automaticDimension if you have no estimate.

## Discussion

Discussion Providing an estimate the height of rows can improve the user experience when loading the table view. If the table contains variable height rows, it might be expensive to calculate all their heights and so lead to a longer load time. Using estimation allows you to defer some of the cost of geometry calculation from load time to scrolling time.

## See Also

### Related Documentation

- [tableView(_:heightForRowAt:)](uikit/uitableviewdelegate/tableview(_:heightforrowat:).md)

### Estimating heights for the table’s content

- [tableView(_:estimatedHeightForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforheaderinsection:).md)
- [tableView(_:estimatedHeightForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforfooterinsection:).md)
