---
title: "CFDictionaryContainsKey(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfdictionarycontainskey(_:_:)"
---

# CFDictionaryContainsKey(_:_:)

Returns a Boolean value that indicates whether a given key is in a dictionary.

## Declaration

```swift
func CFDictionaryContainsKey(_ theDict: CFDictionary!, _ key: UnsafeRawPointer!) -> Bool
```

## Parameters

- `theDict`: The dictionary to examine.
- `key`: The key for which to find matches in theDict. The key hash and equal callbacks provided when the dictionary was created, are used to compare. If the hash callback is NULL, key is treated as a pointer and converted to an integer. If the equal callback is NULL, pointer equality (in C, ==) is used. If key, or any of the keys in the dictionary, is not understood by the equal callback, the behavior is undefined.

## Return Value

Return Value true if key is in the dictionary, otherwise false.

## See Also

### Examining a dictionary

- [CFDictionaryContainsValue(_:_:)](corefoundation/cfdictionarycontainsvalue(_:_:).md)
- [CFDictionaryGetCount(_:)](corefoundation/cfdictionarygetcount(_:).md)
- [CFDictionaryGetCountOfKey(_:_:)](corefoundation/cfdictionarygetcountofkey(_:_:).md)
- [CFDictionaryGetCountOfValue(_:_:)](corefoundation/cfdictionarygetcountofvalue(_:_:).md)
- [CFDictionaryGetKeysAndValues(_:_:_:)](corefoundation/cfdictionarygetkeysandvalues(_:_:_:).md)
- [CFDictionaryGetValue(_:_:)](corefoundation/cfdictionarygetvalue(_:_:).md)
- [CFDictionaryGetValueIfPresent(_:_:_:)](corefoundation/cfdictionarygetvalueifpresent(_:_:_:).md)
