---
title: "contains(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/keyeddecodingcontainer/contains(_:)"
---

# contains(_:)

Returns a Boolean value indicating whether the decoder contains a value associated with the given key.

## Declaration

```swift
func contains(_ key: KeyedDecodingContainer<K>.Key) -> Bool
```

## Parameters

- `key`: The key to search for.

## Return Value

Return Value Whether the Decoder has an entry for the given key.

## Discussion

Discussion The value associated with the given key may be a null value as appropriate for the data format.
