---
title: "CFPreferencesCopyKeyList(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpreferencescopykeylist(_:_:_:)"
---

# CFPreferencesCopyKeyList(_:_:_:)

Constructs and returns the list of all keys set in the specified domain.

## Declaration

```swift
func CFPreferencesCopyKeyList(_ applicationID: CFString, _ userName: CFString, _ hostName: CFString) -> CFArray?
```

## Parameters

- `applicationID`: The ID of the application whose preferences to search. Takes the form of a Java package name, com.foosoft.
- `userName`: doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesCurrentUser to search the current-user domain, otherwise doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesAnyUser to search the any-user domain.
- `hostName`: doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesCurrentHost to search the current-host domain, otherwise doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesAnyHost to search the any-host domain.

## Return Value

Return Value The list of keys. Ownership follows the The Create Rule.

## See Also

### Getting Preference Values

- [CFPreferencesCopyAppValue(_:_:)](corefoundation/cfpreferencescopyappvalue(_:_:).md)
- [CFPreferencesCopyMultiple(_:_:_:_:)](corefoundation/cfpreferencescopymultiple(_:_:_:_:).md)
- [CFPreferencesCopyValue(_:_:_:_:)](corefoundation/cfpreferencescopyvalue(_:_:_:_:).md)
- [CFPreferencesGetAppBooleanValue(_:_:_:)](corefoundation/cfpreferencesgetappbooleanvalue(_:_:_:).md)
- [CFPreferencesGetAppIntegerValue(_:_:_:)](corefoundation/cfpreferencesgetappintegervalue(_:_:_:).md)
