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

# tableView(_:cellForRowAt:)

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

```
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
```

## Parameters

`tableView`

A table-view object requesting the cell.

`indexPath`

An index path locating a row in `tableView`.

## Return Value

An object inheriting from [`UITableViewCell`](/documentation/UIKit/UITableViewCell) that the table view can use for the specified row. UIKit raises an assertion if you return `nil`.

## Discussion

In your implementation, create and configure an appropriate cell for the given index path. Create your cell using the table view’s [`dequeueReusableCell(withIdentifier:for:)`](/documentation/UIKit/UITableView/dequeueReusableCell(withIdentifier:for:)) method, which recycles or creates the cell for you. After creating the cell, update the properties of the cell with appropriate data values.

Never call this method yourself. If you want to retrieve cells from your table, call the table view’s [`cellForRow(at:)`](/documentation/UIKit/UITableView/cellForRow(at:)) method instead.

---

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)