<!--
{
  "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/Continuation/yield()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScS12ContinuationV5yieldAB11YieldResultOyyt__GyytRszlF"
  },
  "title" : "yield()"
}
-->

# yield()

Resume the task awaiting the next iteration point by having it return
normally from its suspension point.

```
@discardableResult func yield() -> AsyncStream<Element>.Continuation.YieldResult where Element == ()
```

## Return Value

A `YieldResult` that indicates the success or failure of the
yield operation.

## Discussion

Use this method with `AsyncStream` instances whose `Element` type is
`Void`. In this case, the `yield()` call unblocks the awaiting
iteration; there is no value to return.

If you call this method repeatedly, each call returns immediately, without
blocking for any awaiting consumption from the iteration.

---

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)