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

# indexPathsForVisibleSupplementaryElements(ofKind:)

Gets the index paths of all visible supplementary views of the specified type.

```
func indexPathsForVisibleSupplementaryElements(ofKind elementKind: String) -> [IndexPath]
```

## Parameters

`elementKind`

The kind of supplementary view to locate. This value is defined by the layout object. This parameter must not be `nil`.

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSIndexPath> objects, each of which corresponds to a visible supplementary view in the collection view. If there are no visible supplementary views, this method returns an empty array.

---

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)