<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/EncodableWithConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation26EncodableWithConfigurationP"
  },
  "title" : "EncodableWithConfiguration"
}
-->

# EncodableWithConfiguration

A protocol for types that support encoding when supplied with an additional configuration type.

```
protocol EncodableWithConfiguration
```

## Topics

### Encoding

[`func encode(to: any Encoder, configuration: Self.EncodingConfiguration) throws`](/documentation/Foundation/EncodableWithConfiguration/encode(to:configuration:))

Encodes the value into the specified encoder with help from the provided configuration.

### Supporting Types

[`associatedtype EncodingConfiguration`](/documentation/Foundation/EncodableWithConfiguration/EncodingConfiguration)

The type of the encoding configuration.

## Relationships

### Conforming Types

[`AttributedString`](/documentation/Foundation/AttributedString)

[`Expression`](/documentation/Foundation/Expression)

[`AttributeContainer`](/documentation/Foundation/AttributeContainer)

[`Predicate`](/documentation/Foundation/Predicate)

---

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)