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

# init()

Creates a new defaults object and initializes it with the app’s current settings.

```
convenience init()
```

## Discussion

Use this method to create a new defaults object to manage the app’s settings. If
you add a domain using the [`addSuite(named:)`](/documentation/Foundation/UserDefaults/addSuite(named:)) method, the returned object retrieves
values in that domain in addition to the standard ones. Custom domains remain in the
search list until you remove them or release the object. When you write setting
values using this object, it writes them to the current app’s settings.

---

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)