---
title: "dictionary(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsubiquitouskeyvaluestore/dictionary(forkey:)"
---

# dictionary(forKey:)

Returns the dictionary object associated with the specified key.

## Declaration

```swift
func dictionary(forKey aKey: String) -> [String : Any]?
```

## Parameters

- `aKey`: The key to retrieve from the iCloud key-value store.

## Return Value

Return Value The dictionary object associated with aKey, or nil if the key isn’t present. This method also returns nil if the retrieved value isn’t a dictionary object.

## See Also

### Getting values

- [bool(forKey:)](foundation/nsubiquitouskeyvaluestore/bool(forkey:).md)
- [double(forKey:)](foundation/nsubiquitouskeyvaluestore/double(forkey:).md)
- [longLong(forKey:)](foundation/nsubiquitouskeyvaluestore/longlong(forkey:).md)
- [string(forKey:)](foundation/nsubiquitouskeyvaluestore/string(forkey:).md)
- [data(forKey:)](foundation/nsubiquitouskeyvaluestore/data(forkey:).md)
- [object(forKey:)](foundation/nsubiquitouskeyvaluestore/object(forkey:).md)
- [array(forKey:)](foundation/nsubiquitouskeyvaluestore/array(forkey:).md)
- [dictionaryRepresentation](foundation/nsubiquitouskeyvaluestore/dictionaryrepresentation.md)
