A lightweight Swift library providing a simple, strongly typed wrapper for UserDefaults using Codable.
DefaultsKit is a Swift library that provides a simple, strongly typed wrapper for Apple's UserDefaults. It leverages Swift's Codable protocol to serialize and deserialize complex objects, eliminating the need for manual type casting and reducing boilerplate code in iOS, macOS, and tvOS applications.
Swift developers building apps for Apple platforms (iOS, macOS, tvOS) who need a type-safe and efficient way to store user preferences and app state persistently.
Developers choose DefaultsKit for its minimal code footprint, compile-time type safety, and seamless integration with Codable, making it a more reliable and developer-friendly alternative to raw UserDefaults.
Simple, Strongly Typed UserDefaults for iOS, macOS and tvOS
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Keys are generic over value types, preventing type mismatches at compile time, as highlighted in the README's examples with strongly typed keys.
Automatically serializes and deserializes any Codable-conforming object, eliminating manual JSON handling for complex structs and enums.
Implemented in fewer than 100 lines of code, making it lightweight and easy to integrate without adding bloat to your project.
The has() method checks key existence without deserializing values, saving performance for large or nested objects as noted in the README.
Tied to UserDefaults' constraints, such as size limits and lack of thread-safety guarantees, which can be problematic for scaling or concurrent access.
Does not provide tools for handling schema changes or data migrations, requiring manual effort when app requirements evolve.
Requires all stored data to conform to Codable, which may necessitate additional work for non-Codable objects or custom serialization needs.