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

# nestedUnkeyedContainer(forKey:)

Returns the data stored for the given key as represented in an unkeyed container.

## Declaration

```swift
func nestedUnkeyedContainer(forKey key: Self.Key) throws -> any UnkeyedDecodingContainer
```

## Parameters

- `key`: The key that the nested container is associated with.

## Return Value

Return Value An unkeyed decoding container view into self.

## Discussion

Discussion note: DecodingError.typeMismatch if the encountered stored value is not an unkeyed container.
