Swiftpack.co -  realm/realm-cocoa as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Realm is a mobile database: a replacement for Core Data & SQLite
.package(url: "https://github.com/realm/realm-cocoa.git", from: "vv5.0.0-beta.1")


Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the iOS, macOS, tvOS & watchOS versions of Realm Swift & Realm Objective-C.


  • Mobile-first: Realm is the first database built from the ground up to run directly inside phones, tablets and wearables.
  • Simple: Data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Most of our users pick it up intuitively, getting simple apps up & running in minutes.
  • Modern: Realm supports relationships, generics, vectorization and Swift.
  • Fast: Realm is faster than even raw SQLite on common operations, while maintaining an extremely rich feature set.

Getting Started

Please see the detailed instructions in our docs to add Realm Objective-C or Realm Swift to your Xcode project.


Realm Objective-C

The documentation can be found at realm.io/docs/objc/latest.
The API reference is located at realm.io/docs/objc/latest/api/.

Realm Swift

The documentation can be found at realm.io/docs/swift/latest.
The API reference is located at realm.io/docs/swift/latest/api/.

Getting Help

  • Need help with your code?: Look for previous questions with therealm tag on Stack Overflow or ask a new question. For general discussion that might be considered too broad for Stack Overflow, use the Community Forum.
  • Have a bug to report? Open a GitHub issue. If possible, include the version of Realm, a full log, the Realm file, and a project that shows the issue.
  • Have a feature request? Open a GitHub issue. Tell us what the feature should do and why you want the feature.

Building Realm

In case you don't want to use the precompiled version, you can build Realm yourself from source.


  • Building Realm requires Xcode 11.x or newer.
  • Building Realm documentation requires jazzy

Once you have all the necessary prerequisites, building Realm.framework just takes a single command: sh build.sh build. You'll need an internet connection the first time you build Realm to download the core binary.

Run sh build.sh help to see all the actions you can perform (build ios/osx, generate docs, test, etc.).


See CONTRIBUTING.md for more details!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to info@realm.io.


Realm Objective-C & Realm Swift are published under the Apache 2.0 license.
Realm Core is also published under the Apache 2.0 license and is available here.

This product is not being made available to any person located in Cuba, Iran, North Korea, Sudan, Syria or the Crimea region, or to any other person that is not eligible to receive the product under U.S. law.


If you use Realm and are happy with it, all we ask is that you please consider sending out a tweet mentioning @realm to share your thoughts!

And if you don't like it, please let us know what you would like improved, so we can fix it!



Stars: 14459
Last commit: 14 hours ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Related Packages

Release Notes



  • Realms opened in read-only mode can now be invalidated (although it is unlikely to be useful to do so).
  • Thread-safe references can now be created for read-only Realms. (#5475).


  • Fix an availability warning when building Realm. The code path which gave the warning can not currently be hit, so this did not cause any runtime problems (#7219, since 10.7.3).
  • Proactively check the expiry time on the access token and refresh it before attempting to initiate a sync session. This prevents some error logs from appearing on the client such as: "ERROR: Connection[1]: Websocket: Expected HTTP response 101 Switching Protocols, but received: HTTP/1.1 401 Unauthorized" (RCORE-473, since v10.0.0)
  • Fix a race condition which could result in a skipping notifications failing to skip if several commits using notification skipping were made in succession (since v5.0.0).
  • Fix a crash on exit inside TableRecycler which could happen if Realms were open on background threads when the app exited. (Core #4600, since v5.0.0)
  • Fix errors related to "uncaught exception in notifier thread: N5realm11KeyNotFoundE: No such object" which could happen on synchronized Realms if a linked object was deleted by another client. (JS #3611, since v10.0.0).
  • Reading a link to an object which has been deleted by a different client via a string-based interface (such as value(forKey:) or the subscript operator on DynamicObject) could return an invalid object rather than nil. (Core #4687, since v10.0.0)
  • Recreate the sync metadata Realm if the encryption key for it is missing from the keychain rather than crashing. This can happen if a device is restored from an unencrypted backup, which restores app data but not the app's keychain entries, and results in all cached logics for sync users being discarded but no data being lost. Core #4285


  • Realm Studio: 10.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 10.x.y series.
  • Carthage release for Swift is built with Xcode 12.5.
  • CocoaPods: 1.10 or later.


  • Upgraded realm-core from v10.6.0 to v10.7.2

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API