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

# next(isolation:)

Produces the next element in the filter sequence.

## Declaration

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

## Discussion

Discussion This iterator calls next(isolation:) on its base iterator; if this call returns nil, next(isolation:) returns nil. Otherwise, next() evaluates the result with the predicate closure. If the closure returns true, next(isolation:) returns the received element; otherwise it awaits the next element from the base iterator. If calling the closure throws an error, the sequence ends and next(isolation:) rethrows the error.
