explaingit

realm/realm-swift

Analysis updated 2026-06-24

16,601Objective-CAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

Realm is a mobile database for iOS, macOS, tvOS, and watchOS that lets you persist Swift objects directly without writing SQL or Core Data mapping code.

Mindmap

mindmap
  root((realm-swift))
    Inputs
      Swift model classes
      Encryption keys
      Local files
    Outputs
      On-device database
      Live updating objects
      SwiftUI bindings
    Use Cases
      Replace Core Data in an app
      Build an offline first iOS app
      Encrypt sensitive local data
    Tech Stack
      Swift
      Objective-C
      SwiftUI
      SPM
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Store and query app data locally on iOS without writing SQL

USE CASE 2

Build a SwiftUI app whose views auto refresh when the database changes

USE CASE 3

Replace Core Data in an existing project with a simpler object model

USE CASE 4

Encrypt user data at rest in an iOS or macOS app

What is it built with?

SwiftObjective-CSwiftUISPMCocoaPods

How does it compare?

realm/realm-swiftjdg/mbprogresshudgnachman/iterm2
Stars16,60115,95117,547
LanguageObjective-CObjective-CObjective-C
Setup difficultyeasyeasyeasy
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Cloud sync was deprecated in September 2024, so plan for local-only persistence or pick another backend.

Apache 2.0 lets you use, modify, and ship Realm in commercial apps as long as you keep the license notice and patent terms.

In plain English

Realm is a mobile database built for iOS, macOS, tvOS, and watchOS apps, designed as a replacement for Core Data and SQLite. Rather than forcing you to write complex SQL queries or mapping code, Realm lets you define your data as regular Swift classes and work with them directly as objects. This means you write far less code to store, retrieve, and update your app's data. Realm stores data directly on the device, so your app works just as well without an internet connection as it does online. One of its standout features is live objects: when data changes anywhere in your app, every part of the app that references it updates automatically, making it easy to build reactive user interfaces. Realm integrates natively with SwiftUI, so your views refresh on their own when data changes. It also supports full encryption, letting you protect sensitive data both in storage and in transit. The library can be installed through Swift Package Manager, CocoaPods, or Carthage. Important note: the sync features that connected Realm to a cloud backend were deprecated in September 2024, the core local database functionality continues to be available on the community branch or as version 20 and later. The source code is published under the Apache 2.0 license.

Copy-paste prompts

Prompt 1
Show me how to install realm-swift via Swift Package Manager and define a simple Task model
Prompt 2
Write a SwiftUI view that lists Realm objects and auto refreshes when items are added
Prompt 3
Convert this Core Data stack to realm-swift with the same model relationships
Prompt 4
Show how to enable Realm encryption with a 64 byte key generated at first launch
Prompt 5
Explain what changed when Realm sync was deprecated in 2024 and how to keep using local Realm

Frequently asked questions

What is realm-swift?

Realm is a mobile database for iOS, macOS, tvOS, and watchOS that lets you persist Swift objects directly without writing SQL or Core Data mapping code.

What language is realm-swift written in?

Mainly Objective-C. The stack also includes Swift, Objective-C, SwiftUI.

What license does realm-swift use?

Apache 2.0 lets you use, modify, and ship Realm in commercial apps as long as you keep the license notice and patent terms.

How hard is realm-swift to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is realm-swift for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub realm on gitmyhub

Verify against the repo before relying on details.