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

# tableView(_:didSelectRowAt:)

Tells the delegate a row is selected.

```
optional func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
```

## Parameters

`tableView`

A table view informing the delegate about the new row selection.

`indexPath`

An index path locating the new selected row in `tableView`.

## Discussion

The delegate handles selections in this method. For instance, you can use this method to assign a checkmark ([`UITableViewCell.AccessoryType.checkmark`](/documentation/UIKit/UITableViewCell/AccessoryType-swift.enum/checkmark)) to one row in a section in order to create a radio-list style. The system doesn’t call this method if the rows in the table aren’t selectable. See [Handling row selection in a table view](/documentation/UIKit/handling-row-selection-in-a-table-view) for more information on controlling table row selection behavior.

---

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)