---
title: "next(isolation:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/asyncprefixsequence/iterator/next(isolation:)"
---

# next(isolation:)

Produces the next element in the prefix sequence.

## Declaration

```swift
mutating func next(isolation actor: isolated (any Actor)?) async throws(AsyncPrefixSequence<Base>.Failure) -> Base.Element?
```

## Discussion

Discussion Until reaching the number of elements to include, this iterator calls next(isolation:) on its base iterator and passes through the result. After reaching the maximum number of elements, subsequent calls to next(isolation:) return nil.
