---
title: "encode(_:forKey:configuration:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/keyedencodingcontainer/encode(_:forkey:configuration:)-4va3q"
---

# encode(_:forKey:configuration:)

## Declaration

```swift
mutating func encode<T>(_ t: T, forKey key: KeyedEncodingContainer<K>.Key, configuration: T.EncodingConfiguration) throws where T : EncodableWithConfiguration
```
