---
title: "superEncoder(forKey:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/keyedencodingcontainerprotocol/superencoder(forkey:)"
---

# superEncoder(forKey:)

Stores a new nested container for the given key and returns a new encoder instance for encoding super into that container.

## Declaration

```swift
mutating func superEncoder(forKey key: Self.Key) -> any Encoder
```

## Parameters

- `key`: The key to encode super for.

## Return Value

Return Value A new encoder to pass to super.encode(to:).
