---
title: "scrollToRow(at:at:animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableview/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.

## Declaration

```swift
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 doc://com.apple.uikit/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

Discussion Invoking this method doesn’t cause the delegate to receive a scrollViewDidScroll(_:) message, as is normal for programmatically invoked user interface operations.

## See Also

### Scrolling the table view

- [scrollToNearestSelectedRow(at:animated:)](uikit/uitableview/scrolltonearestselectedrow(at:animated:).md)
- [UITableView.ScrollPosition](uikit/uitableview/scrollposition.md)
