<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/AsyncStream/Iterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScS8IteratorV"
  },
  "title" : "AsyncStream.Iterator"
}
-->

# AsyncStream.Iterator

The asynchronous iterator for iterating an asynchronous stream.

```
struct Iterator
```

## Overview

This type doesn’t conform to `Sendable`. Don’t use it from multiple
concurrent contexts. It is a programmer error to invoke `next()` from a
concurrent context that contends with another such call, which
results in a call to `fatalError()`.

## Topics

### Iterating over Elements

[`func next() async -> Element?`](/documentation/Swift/AsyncStream/Iterator/next())

The next value from the asynchronous stream.

### Instance Methods

[`func next(isolation: isolated (any Actor)?) async -> Element?`](/documentation/Swift/AsyncStream/Iterator/next(isolation:))

The next value from the asynchronous stream.

### Default Implementations

[AsyncIteratorProtocol Implementations](/documentation/Swift/AsyncStream/Iterator/AsyncIteratorProtocol-Implementations)

## Relationships

### Conforms To

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

---

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)