---
title: "init(from:)"
framework: Evaluations
role: symbol
role_heading: Initializer
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, visionOS 27.0+, watchOS 27.0+, xcode 27.0+]
path: "evaluations/toolexpectation/init(from:)"
---

# init(from:)

Creates a tool expectation by decoding from the given decoder.

## Declaration

```swift
init(from decoder: any Decoder) throws
```

## Parameters

- `decoder`: The decoder to read data from.

## Discussion

Discussion note: An error if the data is corrupted or a required value is missing.
