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

# nestedUnkeyedContainer(forKey:)

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

## Declaration

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

## Parameters

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

## Return Value

Return Value A new unkeyed encoding container.
