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

# volatileDomain(forName:)

Retrieves the settings from the specified volatile domain.

## Declaration

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

## Parameters

- `domainName`: The name of the volatile domain. For example, specify the doc://com.apple.foundation/documentation/Foundation/UserDefaults/argumentDomain identifier to retrieve the command-line settings.

## 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 persistent domain, this 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

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