<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/settings",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Settings"
}
-->

# Settings

Configure your app using data you store persistently on the local disk or in iCloud.

## Discussion

Settings are small pieces of data that you use to configure your app’s interface and behavior.
Instead of recompiling your code every time you want to make a change, your code uses settings
to alter your app’s configuration dynamically. Typically, you use this kind of data to
reflect the personal preferences of the person using your app. For example, a drawing app might
store whether someone prefers inches or centimeters for distance measurements. However, you can
also use settings to manage internal behaviors, such as the amount of data your app logs during testing.

The system stores each app’s settings persistently to disk, so that they are available between
launches. You typically store strings, numbers, and other simple data types to disk, but
you can store more complex types as needed. The  [`UserDefaults`](/documentation/Foundation/UserDefaults) type manages settings for your
app on the current device, and doesn’t share those settings with the person’s other devices. To
share settings with instances of your app running on all of the person’s devices, place them in
iCloud using the [`NSUbiquitousKeyValueStore`](/documentation/Foundation/NSUbiquitousKeyValueStore) type.

## Topics

### App-specific settings

[Accessing settings from your code](/documentation/Foundation/accessing-settings-from-your-code)

Retrieve or change settings and monitor external changes to those values while your app runs.

[`class UserDefaults`](/documentation/Foundation/UserDefaults)

An interface to the user’s defaults database, which stores system-wide and app-specific settings.

### Settings interfaces

[Adding a settings interface to your app](/documentation/Foundation/adding-a-settings-interface-to-your-app)

Create a dedicated interface to display and modify your app’s settings.

[Building a Settings bundle for your app](/documentation/Foundation/building-a-settings-bundle-for-your-app)

Integrate your app’s custom settings into the Settings app in iOS, iPadOS, tvOS, and visionOS, and
support a Mac Catalyst settings window.

### iCloud key and value storage

[`class NSUbiquitousKeyValueStore`](/documentation/Foundation/NSUbiquitousKeyValueStore)

An iCloud-based container of key-value pairs you share among instances of your app
running on a person’s devices.



---

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)