<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/scrollToItems(at:scrollPosition:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(im)scrollToItemsAtIndexPaths:scrollPosition:"
  },
  "title" : "scrollToItems(at:scrollPosition:)"
}
-->

# scrollToItems(at:scrollPosition:)

Scrolls the collection view contents until the specified items are visible.

```
func scrollToItems(at indexPaths: Set<IndexPath>, scrollPosition: NSCollectionView.ScrollPosition)
```

## Parameters

`indexPaths`

The index paths of the items. The layout attributes of these items define the bounding box that needs to be scrolled onscreen.

`scrollPosition`

The options for scrolling the bounding box of the specified items into view. You may combine one vertical and one horizontal scrolling option when calling this method. Specifying more than one option for either the vertical or horizontal directions raises an exception.

## Discussion

To animate the scrolling operation, call this method on the collection view’s [`animator()`](/documentation/AppKit/NSAnimatablePropertyContainer/animator()) proxy object instead.

---

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)