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

# nestedUnkeyedContainer(forKey:)

Stores an unkeyed encoding container for the given key and returns it.

## Declaration

```swift
mutating func nestedUnkeyedContainer(forKey key: Self.Key) -> any UnkeyedEncodingContainer
```

## Parameters

- `key`: The key to encode the container for.

## Return Value

Return Value A new unkeyed encoding container.
