---
title: "persistentDomain(forName:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/userdefaults/persistentdomain(forname:)"
---

# persistentDomain(forName:)

Retrieves the settings from the specified persistent domain.

## Declaration

```swift
func persistentDomain(forName domainName: String) -> [String : Any]?
```

## Parameters

- `domainName`: The name of the persistent domain. Specify your app’s bundle identifier to retrieve any app-specific keys. Specify the doc://com.apple.foundation/documentation/Foundation/UserDefaults/globalDomain identifier to retrieve keys in the global domain.

## Return Value

Return Value A dictionary containing the keys and values from the specified domain. If the domain doesn’t contain any keys, or is a volatile domain, the method returns nil.

## Discussion

Discussion This method retrieves only the keys and values from the specified domain. It doesn’t retrieve keys from other persistent or volatile domains.

## See Also

### Managing domain-specific values

- [setPersistentDomain(_:forName:)](foundation/userdefaults/setpersistentdomain(_:forname:).md)
- [volatileDomain(forName:)](foundation/userdefaults/volatiledomain(forname:).md)
- [setVolatileDomain(_:forName:)](foundation/userdefaults/setvolatiledomain(_:forname:).md)
- [removePersistentDomain(forName:)](foundation/userdefaults/removepersistentdomain(forname:).md)
- [removeVolatileDomain(forName:)](foundation/userdefaults/removevolatiledomain(forname:).md)
