# Defaults

> Swifty and modern UserDefaults

Source: https://talira.ai/catalog/defaults-3mbcbate
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / local storage](https://talira.ai/categories/libraries/local-storage), [languages / swift](https://talira.ai/categories/languages/swift)
- Platforms: macos, ios, tvos, watchos, visionos[^2]
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Backed by: [Sindre Sorhus](https://talira.ai/orgs/sindresorhus.md)

Defaults is Sindre Sorhus's Swift package for storing key-value settings across app launches. It wraps Apple's `UserDefaults` in a type-safe API: each key is declared once with its type and default value, any `Codable` or `NSSecureCoding` value can be stored, changes can be observed, a SwiftUI property wrapper updates views when a value changes, and values can sync between devices through iCloud. Its README says it runs in production in its author's apps.

## Links

- GitHub: https://github.com/sindresorhus/Defaults
- Docs: https://swiftpackageindex.com/sindresorhus/Defaults/documentation/defaults

## Problems it solves

- store user settings in my Swift app with type-safe keys and default values
- save a Codable enum in UserDefaults without writing encoding code
- update my SwiftUI view automatically when a stored setting changes
- sync app preferences between a user's Mac and iPhone through iCloud

## Features

- strongly typed keys with default values declared once
- Codable and NSSecureCoding values
- a SwiftUI property wrapper and Toggle component
- observation of key changes
- iCloud sync between devices
- values stored as JSON for debugging

## Trust

Overall: 0.37 out of 1.
Signals: maintenance 0.27, adoption 0.68, momentum 0.42, community 0.53, backing 0.30, extensibility 0.00.

- latest release 9.0.9 5 months ago
- 2.5k GitHub stars
- 20 contributors
- accepts sponsorship (Github, Open Collective, Buy Me A Coffee)
- backed by Sindre Sorhus

Warnings:

- last commit 5 months ago

## Sources

[^1]: https://github.com/sindresorhus/Defaults/blob/main/license (checked 28 Nov 2026)
[^2]: https://github.com/sindresorhus/Defaults (checked 28 Nov 2026)
