<!--
{
  "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/LazyPrefixWhileSequence/Iterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s23LazyPrefixWhileSequenceV8IteratorV"
  },
  "title" : "LazyPrefixWhileSequence.Iterator"
}
-->

# LazyPrefixWhileSequence.Iterator

An iterator over the initial elements traversed by a base iterator that
satisfy a given predicate.

```
@frozen struct Iterator
```

## Overview

This is the associated iterator for the `LazyPrefixWhileSequence`,
`LazyPrefixWhileCollection`, and `LazyPrefixWhileBidirectionalCollection`
types.

## Topics

### Type Aliases

[`typealias Element`](/documentation/Swift/LazyPrefixWhileSequence/Iterator/Element)

The type of element traversed by the iterator.

### Default Implementations

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

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

## Relationships

### Conforms To

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

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

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

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

---

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)