A Swift framework that wraps CoreData to simplify context management and enforce best practices.
Cadmium is a Swift framework that wraps Apple's CoreData to simplify persistent data management in iOS and macOS apps. It abstracts the complexity of managed object contexts, provides a clean API for transactions and queries, and enforces best practices by immediately flagging common coding errors.
Swift developers building iOS or macOS applications who use Core Data for persistence but want a simpler, safer abstraction that reduces boilerplate and context management overhead.
Developers choose Cadmium because it makes Core Data feel more like modern databases (e.g., Realm) by hiding context complexity, offering immediate error feedback, and providing a concise API that prevents multi-threading pitfalls common in raw Core Data usage.
A Swift framework that wraps CoreData, hides context complexity, and helps facilitate best practices.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Hides NSManagedObjectContext complexity entirely, allowing interaction via simple, argument-less transactions that make Core Data feel like modern databases such as Realm, as stated in the README's design goals.
Raises exceptions on the offending line for common Core Data mistakes instead of at save time, aggressively protecting developers from pitfalls like threading violations, as emphasized under 'Aggressively Identifying Coding Pitfalls'.
Provides a chained querying mechanism with methods like Cd.objects(), filter(), and sorted() for concise data fetching, reducing boilerplate in typical CRUD operations, demonstrated in the Querying section.
Transactions auto-commit changes by default with options to cancel or force commits, minimizing manual save calls and guiding best practices, as explained in the Implicit Transaction Commit section.
The README admits it's not a complete Core Data wrapper, hiding advanced features needed for complex optimizations, making it unsuitable for enterprise apps requiring low-level control.
Requires deriving managed object classes from CdManagedObject instead of NSManagedObject, tying the codebase to Cadmium and complicating migration to other solutions or raw Core Data.
Enabling serial transactions by default can cause performance bottlenecks for concurrent operations, as acknowledged in the documentation, where it warns of a hit for unrelated, long-running transactions.
Cadmium is an open-source alternative to the following products: