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

# next(isolation:)

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element.

## Declaration

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

## Return Value

Return Value The next element, if it exists, or nil to signal the end of the sequence.
