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

# array(forKey:)

Returns the array associated with the specified key.

## Declaration

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

## Parameters

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

## Return Value

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

## 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)
- [dictionary(forKey:)](foundation/nsubiquitouskeyvaluestore/dictionary(forkey:).md)
- [dictionaryRepresentation](foundation/nsubiquitouskeyvaluestore/dictionaryrepresentation.md)
