<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/ScrollPosition",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSCollectionViewScrollPosition"
  },
  "title" : "NSCollectionView.ScrollPosition"
}
-->

# NSCollectionView.ScrollPosition

Constants indicating the options for scrolling the collection view’s content.

```
struct ScrollPosition
```

## Topics

### Constants

[`top`](/documentation/AppKit/NSCollectionView/ScrollPosition/top)

Scroll so that the top edge of the selected items’ bounding box is adjacent to the top edge of the collection view’s bounds. This option must not be combined with the [`centeredVertically`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredVertically), [`bottom`](/documentation/AppKit/NSCollectionView/ScrollPosition/bottom), and [`nearestHorizontalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestHorizontalEdge) options, but may be combined with other options.

[`centeredVertically`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredVertically)

Scroll so that the bounding box of the selected items is centered vertically in the collection view’s bounds. This option must not be combined with the [`top`](/documentation/AppKit/NSCollectionView/ScrollPosition/top), [`bottom`](/documentation/AppKit/NSCollectionView/ScrollPosition/bottom), or [`nearestHorizontalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestHorizontalEdge) options, but may be combined with other options.

[`bottom`](/documentation/AppKit/NSCollectionView/ScrollPosition/bottom)

Scroll so that the bottom edge of the bounding box is adjacent to the bottom of the collection view’s bounds. This option must not be combined with the [`top`](/documentation/AppKit/NSCollectionView/ScrollPosition/top), [`centeredVertically`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredVertically), or [`nearestHorizontalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestHorizontalEdge) options, but may be combined with other options.

[`nearestHorizontalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestHorizontalEdge)

Scroll so that the bounding box is adjacent to the nearest edge (top or bottom) of the collection view. This option must not be combined with the [`top`](/documentation/AppKit/NSCollectionView/ScrollPosition/top), [`centeredVertically`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredVertically), or [`bottom`](/documentation/AppKit/NSCollectionView/ScrollPosition/bottom) options, but may be combined with other options.

[`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left)

Scroll so that the left edge of the selected items’ bounding box is adjacent to the left edge of the collection view’s bounds. This option must not be combined with the [`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally), [`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right), [`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge), [`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge), or [`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge) options, but may be combined with other options.

[`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally)

Scroll so that the selected items’ bounding box is centered horizontally in the collection view’s bounds. This option must not be combined with the [`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left),  [`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right), [`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge), [`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge), or [`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge) options, but may be combined with other options.

[`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right)

Scroll so that the right edge of the selected items’ bounding box is adjacent to the right edge of the collection view’s bounds. This option must not be combined with the [`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left), [`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally), [`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge), [`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge), or [`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge) options, but may be combined with other options.

[`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge)

Scroll so that the leading edge of the selected items’ bounding box is adjacent to the leading edge of the collection view’s bounds. Use this option to support both left-to-right and right-to-left layouts appropriately. This option must not be combined with the [`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left), [`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally), [`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right), [`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge), or [`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge) options, but may be combined with other options.

[`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge)

Scroll so that the trailing edge of the selected items’ bounding box is adjacent to the trailing edge of the collection view’s bounds. Use this option to support both left-to-right and right-to-left layouts appropriately. This option must not be combined with the [`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left), [`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally), [`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right), [`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge), or [`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge) options, but may be combined with other options.

[`nearestVerticalEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/nearestVerticalEdge)

Scroll so that the bounding box is adjacent to the nearest edge (leading or trailing) of the collection view. Use this option to support both left-to-right and right-to-left layouts appropriately. This option must not be combined with the [`left`](/documentation/AppKit/NSCollectionView/ScrollPosition/left), [`centeredHorizontally`](/documentation/AppKit/NSCollectionView/ScrollPosition/centeredHorizontally), [`right`](/documentation/AppKit/NSCollectionView/ScrollPosition/right), [`leadingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/leadingEdge), or [`trailingEdge`](/documentation/AppKit/NSCollectionView/ScrollPosition/trailingEdge) options, but may be combined with other options.

[`NSCollectionViewScrollPositionNone`](/documentation/AppKit/NSCollectionViewScrollPosition/NSCollectionViewScrollPositionNone)

Do not scroll.

### Initializers

[`init(rawValue:)`](/documentation/AppKit/NSCollectionView/ScrollPosition/init(rawValue:))



---

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)