Store and retrieve typed app settings without manually tracking string keys and types.
Bind a SwiftUI view directly to a stored setting so the UI updates automatically when it changes.
Sync user preferences across a person's devices using iCloud.
Store custom Codable types like enums as persisted settings.
| sindresorhus/defaults | sindresorhus/keyboardshortcuts | vorssaint/vorssaint-utils | |
|---|---|---|---|
| Stars | 2,465 | 2,630 | 2,265 |
| Language | Swift | Swift | Swift |
| Last pushed | — | — | 2026-07-03 |
| Maintenance | — | — | Active |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | general |
Figures from each repo's GitHub metadata at analysis time.
Defaults is a Swift library that makes it easier for Apple platform developers to store and retrieve simple settings in their apps. It wraps the built-in UserDefaults system, which is the standard way to save small pieces of data (like user preferences) that persist across app launches on iOS, macOS, watchOS, tvOS, and visionOS. The main improvement over using UserDefaults directly is type safety. With plain UserDefaults you store and retrieve values using string keys and you have to remember the correct type yourself, which can lead to mistakes. With this library you declare each setting once with a name and a default value and a specific type, and the compiler enforces that you always use it correctly from then on. For developers building apps with SwiftUI, Apple's modern UI framework, the library provides a property wrapper that automatically updates the interface whenever a saved value changes, similar to how SwiftUI's own built-in storage property wrapper works. The library documents several advantages over that built-in alternative: definitions are centralized, the default value only needs to be stated once, it works outside of SwiftUI views, and it supports a wider variety of data types including any type that conforms to Swift's Codable standard. The library also supports observing changes to specific keys, synchronizing data to iCloud so settings follow the user across their devices, and storing custom types by providing your own serialization logic. Stored values are saved as JSON, which makes them easy to inspect when debugging. It is available as a Swift Package and is used in production across the author's own apps.
A Swift library that adds type safety, SwiftUI support, and iCloud sync on top of Apple's UserDefaults for storing app settings.
Mainly Swift. The stack also includes Swift, UserDefaults, SwiftUI.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.