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

# scrollToItem(at:at:animated:)

Scrolls the collection view contents until the specified item is visible.

```
func scrollToItem(at indexPath: IndexPath, at scrollPosition: UICollectionView.ScrollPosition, animated: Bool)
```

## Parameters

`indexPath`

The index path of the item to scroll into view.

`scrollPosition`

An option that specifies where the item should be positioned when scrolling finishes. For a list of possible values, see [`UICollectionView.ScrollPosition`](/documentation/UIKit/UICollectionView/ScrollPosition).

`animated`

Specify <doc://com.apple.documentation/documentation/Swift/true> to animate the scrolling behavior or <doc://com.apple.documentation/documentation/Swift/false> to adjust the scroll view’s visible content immediately.

## Discussion

---

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)