---
title: unkeyedContainer()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/encoder/unkeyedcontainer()
---

# unkeyedContainer()

Returns an encoding container appropriate for holding multiple unkeyed values.

## Declaration

```swift
func unkeyedContainer() -> any UnkeyedEncodingContainer
```

## Return Value

Return Value A new empty unkeyed container.

## Discussion

Discussion You must use only one kind of top-level encoding container. This method must not be called after a call to container(keyedBy:) or after encoding a value through a call to singleValueContainer()
