<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewDelegate/tableView(_:willDisplay:forRowAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDelegate(im)tableView:willDisplayCell:forRowAtIndexPath:"
  },
  "title" : "tableView(_:willDisplay:forRowAt:)"
}
-->

# tableView(_:willDisplay:forRowAt:)

Tells the delegate the table view is about to draw a cell for a particular row.

```
optional func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)
```

## Parameters

`tableView`

The table view informing the delegate of this impending event.

`cell`

A cell that `tableView` is going to use when drawing the row.

`indexPath`

An index path locating the row in `tableView`.

## Discussion

A table view sends this message to its delegate just before it uses `cell` to draw a row, thereby permitting the delegate to customize the cell object before it is displayed. This method gives the delegate a chance to override state-based properties set earlier by the table view, such as selection and background color. After the delegate returns, the table view sets only the alpha and frame properties, and then only when animating rows as they slide in or out.

## See Also

[`tableView(_:cellForRowAt:)`](/documentation/UIKit/UITableViewDataSource/tableView(_:cellForRowAt:))

Asks the data source for a cell to insert in a particular location of the table view.

[`prepareForReuse()`](/documentation/UIKit/UITableViewCell/prepareForReuse())

Prepares a reusable cell for reuse by the table view’s delegate.



---

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)