---
title: superEncoder()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/keyedencodingcontainer/superencoder()
---

# superEncoder()

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

## Declaration

```swift
mutating func superEncoder() -> any Encoder
```

## Return Value

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

## Discussion

Discussion Equivalent to calling superEncoder(forKey:) with Key(stringValue: "super", intValue: 0).
