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

# indexPathsForVisibleSupplementaryElements(ofKind:)

Returns the index paths of the currently active supplementary views.

```
func indexPathsForVisibleSupplementaryElements(ofKind elementKind: NSCollectionView.SupplementaryElementKind) -> Set<IndexPath>
```

## Parameters

`elementKind`

The kind of the supplementary views you want returned. The layout object defines the kinds of supplementary views it supports. This parameter must not be `nil`.

## Return Value

The set of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects. The returned array may be empty.

## Discussion

The index paths returned by this method correspond to supplementary views that are active and currently being managed by the collection view. The set may include index paths for views that are outside of the collection view’s actual visible rectangle. For example, it might contain index paths for views that were recently visible but have since been scrolled out of the visible rectangle. To test whether a view is actually visible, check to see if its frame rectangle intersects the [`visibleRect`](/documentation/AppKit/NSView/visibleRect) of the collection view.

---

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)