<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/UserDefaults/dictionaryRepresentation()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUserDefaults(im)dictionaryRepresentation"
  },
  "title" : "dictionaryRepresentation()"
}
-->

# dictionaryRepresentation()

Returns a dictionary with the union of all key-value pairs found from all domains.

```
func dictionaryRepresentation() -> [String : Any]
```

## Return Value

A dictionary with the combined set of keys and values from all domains.

## Discussion

Use this method to retrieve a union of the keys and values available to your
app. The dictionary contains the data from all of the available domains. If multiple
domains contain a value for the same key, the dictionary includes the value from the
earliest occurrence of that key and discards the values in subsequent domains.

The values in the dictionary are one of the property list object types, such as
<doc://com.apple.documentation/documentation/Foundation/NSNumber>,
<doc://com.apple.documentation/documentation/Foundation/NSString>, [`Data`](/documentation/Foundation/Data), [`Date`](/documentation/Foundation/Date),
<doc://com.apple.documentation/documentation/Foundation/NSArray>, or
<doc://com.apple.documentation/documentation/Foundation/NSDictionary>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)