---
title: CFDictionaryRetainCallBack
framework: corefoundation
role: symbol
role_heading: Type Alias
path: corefoundation/cfdictionaryretaincallback
---

# CFDictionaryRetainCallBack

Prototype of a callback function used to retain a value or key being added to a dictionary.

## Declaration

```swift
typealias CFDictionaryRetainCallBack = (CFAllocator?, UnsafeRawPointer?) -> UnsafeRawPointer?
```

## Parameters

- `allocator`: The dictionary’s allocator.
- `value`: The value being added to the dictionary.

## Return Value

Return Value The value or key to store in the dictionary, which is usually the value parameter passed to this callback, but may be a different   value if a different value should be stored in the collection.

## Discussion

Discussion This callback is passed to CFDictionaryCreate(_:_:_:_:_:_:) in a CFDictionaryKeyCallBacks and CFDictionaryValueCallBacks structure.

## See Also

### Callbacks

- [CFDictionaryApplierFunction](corefoundation/cfdictionaryapplierfunction.md)
- [CFDictionaryCopyDescriptionCallBack](corefoundation/cfdictionarycopydescriptioncallback.md)
- [CFDictionaryEqualCallBack](corefoundation/cfdictionaryequalcallback.md)
- [CFDictionaryHashCallBack](corefoundation/cfdictionaryhashcallback.md)
- [CFDictionaryReleaseCallBack](corefoundation/cfdictionaryreleasecallback.md)
