On this page
Realm's Swift SDK enables your iOS, macOS, tvOS, and watchOS applications to interact with Realm using either the Swift or Objective-C programming languages. This page details how to install Realm in your project and get started.
Before getting started, ensure your development environment meets the following prerequisites:
Xcode version 13.1 or higher.
When using Xcode 13, a target of iOS 9.0 or higher, macOS 10.9 or higher, tvOS 9.0 or higher, or watchOS 2.0 or higher.
If using Swift Package Manager with Xcode 13, target of iOS 11+ or macOS 10.10+ is required.
When using Xcode 14, a target of iOS 11.0 or higher, macOS 10.13 or higher, tvOS 11.0 or higher, or watchOS 4.0 or higher.
You can use
Carthage to add the
Realm Swift SDK to your project.
Add the following line at the top of your source files to use Realm:
Realm Database should only add around 5 to 8 MB to your app's download size. The releases we distribute are significantly larger because they include support for the iOS, watchOS and tvOS simulators, some debug symbols, and bitcode, all of which are stripped by the App Store automatically when apps are downloaded.
If you have build issues after using one of these methods to install Realm, see our troubleshooting guidelines for information about resolving those issues in realm.
iOS 9.0+ (iOS 11+ if using Swift Package Manager)
macOS 10.9+ (macOS 10.10+ if using Swift Package Manager)
Starting with Realm Swift SDK Versions 10.15.0 and 10.16.0, many of the Realm APIs support the Swift async/await syntax. Projects must meet these requirements:
Swift SDK Version
Swift Version Requirement
10.15.0 or 10.16.0
If your app accesses Realm in an
async/await context, mark the code
@MainActor to avoid threading-related crashes.