<!--
{
  "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/scrollToRow(at:at:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableView(im)scrollToRowAtIndexPath:atScrollPosition:animated:"
  },
  "title" : "scrollToRow(at:at:animated:)"
}
-->

# scrollToRow(at:at:animated:)

Scrolls through the table view until a row that an index path identifies is at a particular location on the screen.

```
func scrollToRow(at indexPath: IndexPath, at scrollPosition: UITableView.ScrollPosition, animated: Bool)
```

## Parameters

`indexPath`

An index path that identifies a row in the table view by its row index and its section index.

    `NSNotFound`     is a valid row index for scrolling to a section with zero rows.

`scrollPosition`

A constant that identifies a relative position in the table view (top, middle, bottom) for `row` when scrolling concludes. See [`UITableView.ScrollPosition`](/documentation/UIKit/UITableView/ScrollPosition) for descriptions of valid constants.

`animated`

<doc://com.apple.documentation/documentation/Swift/true> if you want to animate the change in position; <doc://com.apple.documentation/documentation/Swift/false> if it should be immediate.

## Discussion

Invoking this method doesn’t cause the delegate to receive a [`scrollViewDidScroll(_:)`](/documentation/UIKit/UIScrollViewDelegate/scrollViewDidScroll(_:)) message, as is normal for programmatically invoked user interface operations.

---

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)