<!--
{
  "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/register(defaults:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUserDefaults(im)registerDefaults:"
  },
  "title" : "register(defaults:)"
}
-->

# register(defaults:)

Specifies the set of default settings and values to use as a fallback in cases
where the app domain doesn’t have them.

```
func register(defaults registrationDictionary: [String : Any])
```

## Parameters

`registrationDictionary`

The dictionary of key-value pairs that contain the
default values for your app’s settings. Build this dictionary programmatically
or load it from a property list resource file in your app’s bundle.

## Discussion

Call this method shortly after launch to specify the default values for your app’s
settings. This method assigns the key-value pairs you provide to the registration
domain, which is typically the last domain in the search list. The registration domain
is volatile, so you must register the set of default values each time your app launches.

---

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)