<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableView/deselectRow(at:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableView(im)deselectRowAtIndexPath:animated:"
  },
  "title" : "deselectRow(at:animated:)"
}
-->

# deselectRow(at:animated:)

Deselects a row that an index path identifies, with an option to animate the deselection.

```
func deselectRow(at indexPath: IndexPath, animated: Bool)
```

## Parameters

`indexPath`

An index path identifying a row in the table view.

`animated`

<doc://com.apple.documentation/documentation/Swift/true> if you want to animate the deselection, and <doc://com.apple.documentation/documentation/Swift/false> if the change should be immediate.

## Discussion

Calling this method doesn’t cause the delegate to receive a [`tableView(_:willDeselectRowAt:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:willDeselectRowAt:)) or [`tableView(_:didDeselectRowAt:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:didDeselectRowAt:)) message, nor does it send [`selectionDidChangeNotification`](/documentation/UIKit/UITableView/selectionDidChangeNotification) notifications to observers.

Calling this method doesn’t cause any scrolling to the deselected row.

---

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)