---
title: "indexPathsForVisibleSupplementaryElements(ofKind:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionview/indexpathsforvisiblesupplementaryelements(ofkind:)"
---

# indexPathsForVisibleSupplementaryElements(ofKind:)

Returns the index paths of the currently active supplementary views.

## Declaration

```swift
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

Return Value The set of NSIndexPath objects. The returned array may be empty.

## Discussion

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 of the collection view.

## See Also

### Locating Items and Views

- [visibleItems()](appkit/nscollectionview/visibleitems().md)
- [indexPathsForVisibleItems()](appkit/nscollectionview/indexpathsforvisibleitems().md)
- [visibleSupplementaryViews(ofKind:)](appkit/nscollectionview/visiblesupplementaryviews(ofkind:).md)
- [indexPath(for:)](appkit/nscollectionview/indexpath(for:).md)
- [indexPathForItem(at:)](appkit/nscollectionview/indexpathforitem(at:).md)
- [item(at:)](appkit/nscollectionview/item(at:)-2vx2h.md)
- [supplementaryView(forElementKind:at:)](appkit/nscollectionview/supplementaryview(forelementkind:at:).md)
- [scrollToItems(at:scrollPosition:)](appkit/nscollectionview/scrolltoitems(at:scrollposition:).md)
