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

# addSuite(named:)

Inserts settings for the specified domain into the search list of the current object.

```
func addSuite(named suiteName: String)
```

## Parameters

`suiteName`

The bundle identifier for the domain you want to add. You don’t need
to specify a bundle identifier for another app. Instead, you might specify the
app group identifier you use to share data between multiple apps or between your
app and an app extension. Don’t specify your app’s bundle identifier or the [`globalDomain`](/documentation/Foundation/UserDefaults/globalDomain)
identifier in this parameter.

## Discussion

This method inserts the domain for your custom suite of settings after the app domain
and before the global domain. This arrangement causes the `UserDefaults` object to return
your app-specific settings first, followed by settings from the specified suite.
If you call this method multiple times, the `UserDefaults` object searches your suites
in the order you added them.

This method doesn’t affect the destination for write operations. If you want to write
settings to a custom suite, use the [`init(suiteName:)`](/documentation/Foundation/UserDefaults/init(suiteName:)) initializer
to construct a `UserDefaults` object specifically for that suite.

> Important: An app that accesses settings in a suite must also have the
> [App Groups entitlement](doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.security.application-groups).

---

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)