<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSIndexSetIterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation18NSIndexSetIteratorV"
  },
  "title" : "NSIndexSetIterator"
}
-->

# NSIndexSetIterator

An iterator suitable for enumerating the elements of an index set.

```
struct NSIndexSetIterator
```

## Overview

You typically obtain an index set iterator by calling the [`makeIterator()`](/documentation/Foundation/NSIndexSet/makeIterator()) function of an [`NSIndexSet`](/documentation/Foundation/NSIndexSet) instance.

## Relationships

### Conforms To

[`IteratorProtocol`](/documentation/Swift/IteratorProtocol)

---

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)