<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/EnumeratedSequence/Iterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s18EnumeratedSequenceV8IteratorV"
  },
  "title" : "EnumeratedSequence.Iterator"
}
-->

# EnumeratedSequence.Iterator

The iterator for `EnumeratedSequence`.

```
@frozen struct Iterator
```

## Overview

An instance of this iterator wraps a base iterator and yields
successive `Int` values, starting at zero, along with the elements of the
underlying base iterator. The following example enumerates the elements of
an array:

```
var iterator = ["foo", "bar"].enumerated().makeIterator()
iterator.next() // (0, "foo")
iterator.next() // (1, "bar")
iterator.next() // nil
```

To create an instance, call
`enumerated().makeIterator()` on a sequence or collection.

## Topics

### Default Implementations

[IteratorProtocol Implementations](/documentation/Swift/EnumeratedSequence/Iterator/IteratorProtocol-Implementations)

[Sequence Implementations](/documentation/Swift/EnumeratedSequence/Iterator/Sequence-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

[`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)