Unrealm enables storing Swift native types (structs, classes, enums) in Realm databases without inheriting from Object.
Unrealm is a Swift library that extends RealmCocoa to allow storing native Swift types—such as structs, classes, and enums—directly in Realm databases. It solves the problem of being forced to inherit from Realm's Object class, enabling a more natural Swift development experience with protocol-oriented design.
iOS and macOS developers using Realm for local persistence who want to use Swift-native types like structs and enums without the limitations of Realm's Object inheritance.
Developers choose Unrealm because it eliminates boilerplate code, reduces Realm-related crashes (like thread access issues), and integrates seamlessly with Swift's Codable and optional types, making Realm usage more Swift-idiomatic.
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables direct storage of Swift structs, classes, and enums in Realm, as highlighted in the README's Features list, eliminating the need for Object inheritance.
Gets rid of @objc dynamic var and RealmOptional boilerplate, using standard Swift syntax for model definitions, reducing code complexity.
Avoids common Realm crashes like thread access errors and invalidated objects, improving app stability as stated in the Pros section.
Works seamlessly with Swift's Codable protocol for encoding and decoding, making integration with JSON and other formats straightforward.
Manual updates are required after modifying objects, losing Realm's automatic real-time synchronization, as admitted in the Cons section of the README.
Requires registering all types in AppDelegate's didFinishLaunchingWithOptions, adding an extra initialization step not needed in vanilla Realm.
Tied to specific Realm versions (e.g., v10.15.1), which may cause compatibility issues or break with future Realm updates, limiting long-term use.