Install Realm for iOS, macOS, tvOS, and watchOS¶
MongoDB Realm's Swift SDK enables your iOS, macOS, tvOS, and watchOS applications to interact with MongoDB 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 10.0 or higher.
- Target of iOS 8.0 or higher, macOS 10.9 or higher, tvOS 9.0 or higher, or watchOS 2.0 or higher.
There are special considerations when using Realm Database with tvOS. See Build for tvOS for more information.
You can use
Carthage to add the
MongoDB Realm Swift SDK to your project.
Add Package Dependency¶
In Xcode, select
Swift Packages >
Add Package Dependency.
Specify the Repository¶
Copy and paste the following into the search/input box, then click
Leave the default value of
Up to Next Major, then click
Select the Package Products¶
RealmSwift, then click
Add the following line at the top of your source files to use MongoDB Realm:
If you have build issues after using one of these methods to install Realm, see our troubleshooting guidelines for information about resolving those issues realm.