Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Swift
  3. Unrealm

Unrealm

MITSwift1.9.5

Unrealm enables storing Swift native types (structs, classes, enums) in Realm databases without inheriting from Object.

GitHubGitHub
534 stars73 forks0 contributors

What is Unrealm?

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.

Target Audience

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.

Value Proposition

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.

Overview

Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.

Use Cases

Best For

  • Storing Swift structs and enums in Realm databases
  • Eliminating Realm's Object inheritance requirement
  • Reducing boilerplate code in Realm models
  • Integrating Realm with Swift's Codable protocol
  • Avoiding Realm crashes from incorrect thread access
  • Using protocol-oriented programming with Realm

Not Ideal For

  • Real-time collaborative applications requiring automatic object updates across threads
  • Projects dependent on Realm's latest features not yet supported by Unrealm's version lock
  • Teams prioritizing first-party, officially supported solutions over third-party extensions
  • Prototyping with minimal setup where vanilla Realm's Object inheritance suffices

Pros & Cons

Pros

Swift Native Type Support

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.

Boilerplate Code Elimination

Gets rid of @objc dynamic var and RealmOptional boilerplate, using standard Swift syntax for model definitions, reducing code complexity.

Crash Prevention

Avoids common Realm crashes like thread access errors and invalidated objects, improving app stability as stated in the Pros section.

Codable Compatibility

Works seamlessly with Swift's Codable protocol for encoding and decoding, making integration with JSON and other formats straightforward.

Cons

Loss of Live Objects

Manual updates are required after modifying objects, losing Realm's automatic real-time synchronization, as admitted in the Cons section of the README.

Setup Registration Overhead

Requires registering all types in AppDelegate's didFinishLaunchingWithOptions, adding an extra initialization step not needed in vanilla Realm.

Version Dependency Risks

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.

Frequently Asked Questions

Quick Stats

Stars534
Forks73
Contributors0
Open Issues19
Last commit1 year ago
CreatedSince 2019

Tags

#database#ios#structs#enum#realm#mobile-development#realmswift#swift#xcode#struct#protocol-oriented#db#persistence#realmcocoa#enums

Built With

S
Swift

Included in

Swift26.0k
Auto-fetched 46 minutes ago

Related Projects

RealmRealm

Realm is a mobile database: a replacement for Core Data & SQLite

Stars16,612
Forks2,231
Last commit17 days ago
RealmWrapperRealmWrapper

Safe and easy wrappers for RealmSwift

Stars70
Forks17
Last commit5 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub