Swiftpack.co - Package - realm/realm-cocoa

Realm

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.

Features

  • 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.

Documentation

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.

Prerequisites:

  • Building Realm requires Xcode 11.x or newer.
  • If cloning from git, submodules are required: git submodule update --init --recursive.
  • 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.).

Contributing

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.

License

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.

Feedback

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!

analytics

Github

link
Stars: 14188

Dependencies

Used By

Total: 0

Releases

v10.1.4 -

Enhancements

  • Add arm64 slices to the macOS builds.

Compatibility

  • 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.2.
  • CocoaPods: 1.10 or later.

Internal

  • Upgraded realm-core from v10.0.1 to v10.1.3
  • Upgraded realm-sync from v10.0.1 to v10.1.3

v10.1.3 -

Enhancements

  • Add Xcode 12.2 binaries to the release package.

Fixed

  • Disallow setting RLMRealmConfiguration.deleteRealmIfMigrationNeeded/Realm.Config.deleteRealmIfMigrationNeeded when sync is enabled. This did not actually work as it does not delete the relevant server state and broke in confusing ways (PR #6931).

Compatibility

  • 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.1.
  • CocoaPods: 1.10 or later.

v10.1.2 -

Enhancements

  • Some error states which previously threw a misleading "NoSuchTable" exception now throw a more descriptive exception.

Fixed

  • One of the Swift packages did not have the minimum deployment target set, resulting in errors when archiving an app which imported Realm via SPM (#6914 and #6874).
  • Reenable filelock emulation on watchOS so that the OS does not kill the app when it is suspended while a Realm is open on watchOS 7 (#6861, since v5.4.8)
  • Fix crash in case insensitive query on indexed string columns when nothing matches (#6836, since v5.0.0).
  • Null values in a List<Float?> or List<Double?> were incorrectly treated as non-null in some places. It is unknown if this caused any functional problems when using the public API. (Core PR #3987, since v5.0.0).
  • Deleting an entry in a list in two different clients could end deleting the wrong entry in one client when the changes are merged (since v10.0.0).

Compatibility

  • 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.1.
  • CocoaPods: 1.10 or later.

Internal

  • Upgraded realm-core from v10.0.0 to v10.1.1
  • Upgraded realm-sync from v10.0.0 to v10.1.1

v10.1.1 -

Enhancements

  • Set the minimum CocoaPods version in the podspec so that trying to install with older versions gives a more useful error (PR #6892).

Fixed

  • Embedded objects could not be marked as ObjectKeyIdentifable (PR #6890, since v10.0.0).

Compatibility

  • 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.1.
  • CocoaPods: 1.10 or later.

v10.1.0 -

CocoaPods 1.10 or later is now required to install Realm.

Enhancements

  • Throw an exception for Objects that have none of its properties marked with @objc.
  • Mac Catalyst and arm64 simulators are now supported when integrating via Cocoapods.
  • Add Xcode 12.1 binaries to the release package.
  • Add Combine support for Realm.asyncOpen().

Fixed

  • Implement precise and unbatched notification of sync completion events. This avoids a race condition where an earlier upload completion event will notify a later waiter whose changes haven't been uploaded yet. (#1118).

Compatibility

  • 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.1.

v10.0.0 -

This release is functionally identical to v10.0.0-rc.2.

NOTE: This version upgrades the Realm file format version to add support for new data types. Realm files opened will be automatically upgraded and cannot be read by versions older than v10.0.0.

Breaking Changes

  • Rename Realm.Publishers to RealmPublishers to avoid confusion with Combine.Publishers.
  • Remove [RLMSyncManager shared]. This is now instatiated as a property on App/RLMApp.
  • RLMSyncManager.pinnedCertificatePaths has been removed.
  • Classes RLMUserAccountInfo & RLMUserInfo (swift: UserInfo, UserAccountInfo) have been removed.
  • RLMSyncUser/SyncUser has been renamed to RLMUser/User.
  • We no longer support Realm Cloud (legacy), but instead the new "MongoDB Realm" Cloud. MongoDB Realm is a serverless platform that enables developers to quickly build applications without having to set up server infrastructure. MongoDB Realm is built on top of MongoDB Atlas, automatically integrating the connection to your database.
  • Remove support for Query-based sync, including the configuration parameters and the RLMSyncSubscription and SyncSubscription types (#6437).
  • Remove everything related to sync permissions, including both the path-based permission system and the object-level privileges for query-based sync. Permissions are now configured via MongoDB Atlas. (#6445)
  • Remove support for Realm Object Server.
  • Non-embedded objects in synchronized Realms must always have a primary key named "_id".
  • All Swift callbacks for asynchronous operations which can fail are now passed a Result<Value, Error> parameter instead of two separate Value? and Error? parameters.

Enhancements

  • Add support for next generation sync. Support for syncing to MongoDB instead of Realm Object Server. Applications must be created at realm.mongodb.com
  • The memory mapping scheme for Realm files has changed to better support opening very large files.
  • Add support for the ObjectId data type. This is an automatically-generated unique identifier similar to a GUID or a UUID. (PR #6450).
  • Add support for the Decimal128 data type. This is a 128-bit IEEE 754 decimal floating point number similar to NSDecimalNumber. (PR #6450).
  • Add support for embedded objects. Embedded objects are objects which are owned by a single parent object, and are deleted when that parent object is deleted. They are defined by subclassing EmbeddedObject / RLMEmbeddedObject rather than Object / RLMObject.
  • Add -[RLMUser customData]/User.customData. Custom data is configured in your MongoDB Realm App.
  • Add -[RLMUser callFunctionNamed:arguments:completion:]/User.functions. This is the entry point for calling Remote MongoDB Realm functions. Functions allow you to define and execute server-side logic for your application. Functions are written in modern JavaScript (ES6+) and execute in a serverless manner. When you call a function, you can dynamically access components of the current application as well as information about the request to execute the function and the logged in user that sent the request.
  • Add -[RLMUser mongoClientWithServiceName:]/User.mongoClient. This is the entry point for calling your Remote MongoDB Service. The read operations are -[RLMMongoCollection findWhere:completion:], -[RLMMongoCollection countWhere:completion:]and -[RLMMongoCollection aggregateWithPipeline:completion:]. The write operations are -[RLMMongoCollection insertOneDocument:completion:], -[RLMMongoCollection insertManyDocuments:completion:], -[RLMMongoCollection updateOneDocument:completion:], -[RLMMongoCollection updateManyDocuments:completion:], -[RLMMongoCollection deleteOneDocument:completion:], and -[RLMMongoCollection deleteManyDocuments:completion:]. If you are already familiar with MongoDB drivers, it is important to understand that the remote MongoCollection only provides access to the operations available in MongoDB Realm.
  • Obtaining a Realm configuration from a user is now done with [RLMUser configurationWithPartitionValue:]/User.configuration(partitionValue:). Partition values can currently be of types String, Int, or ObjectId, and fill a similar role to Realm URLs did with Realm Cloud. The main difference is that partitions are meant to be more closely associated with your data. For example, if you are running a Dog kennel, and have a field breed that acts as your partition key, you could open up realms based on the breed of the dogs.
  • Add ability to stream change events on a remote MongoDB collection with [RLMMongoCollection watch:delegate:delegateQueue:], MongoCollection.watch(delegate:). When calling watch(delegate:) you will be given a RLMChangeStream (ChangeStream) which can be used to end watching by calling close(). Change events can also be streamed using the MongoCollection.watch Combine publisher that will stream change events each time the remote MongoDB collection is updated.
  • Add the ability to listen for when a Watch Change Stream is opened when using Combine. Use onOpen(event:) directly after opening a WatchPublisher to register a callback to be invoked once the change stream is opened.
  • Objects with integer primary keys no longer require a separate index for the primary key column, improving insert performance and slightly reducing file size.

Compatibility

  • Realm Studio: 10.0.0 or later.
  • Carthage release for Swift is built with Xcode 12

Internal

  • Upgraded realm-core from v6.1.4 to v10.0.0
  • Upgraded realm-sync from v5.0.29 to v10.0.0

v10.0.0-rc.2 -

Enhancements

  • Add the ability to listen for when a Watch Change Stream is opened when using Combine. Use onOpen(event:) directly after opening a WatchPublisher to register a callback to be invoked once the change stream is opened.

Breaking Changes

  • The insert operations on Mongo collections now report the inserted documents' IDs as BSON rather than ObjectId.
  • Embedded objects can no longer form cycles at the schema level. For example, type A can no longer have an object property of type A, or an object property of type B if type B links to type A. This was always rejected by the server, but previously was allowed in non-synchronized Realms.
  • Primary key properties are once again marked as being indexed. This reflects an internal change to how primary keys are handled that should not have any other visible effects.
  • Change paired return types from Swift completion handlers to return Result<Value, Error>.
  • Adjust how RealmSwift.Object is defined to add support for Swift Library Evolution mode. This should normally not have any effect, but you may need to add override to initializers of object subclasses.
  • Add .null type to AnyBSON. This creates a distinction between null values and properly absent BSON types.

Fixed

  • Set the precision correctly when serializing doubles in extended json.
  • Reading the objectTypes array from a Realm Configuration would not include the embedded object types which were set in the array.
  • Although MongoClient is obtained from a User, it was actually using the User's App's current user rather than the User it was obtained from to make requests.

This release also contains the following changes from 5.4.7 - 5.5.0

Enhancements

  • Add the ability to capture a NotificationToken when using a Combine publisher that observes a Realm Object or Collection. The user will call saveToken(on:at:) directly after invoking the publisher to use the feature.

Fixed

  • When using Realm.write(withoutNotifying:) there was a chance that the supplied observation blocks would not be skipped when in a write transaction. (Object Store #1103)
  • Comparing two identical unmanaged List<>/RLMArray objects would fail. (#5665).
  • Case-insensitive equality queries on indexed string properties failed to clear some internal state when rerunning the query. This could manifest as duplicate results or "key not found" errors. (#6830, #6694, since 5.0.0).
  • Equality queries on indexed string properties would sometimes throw "key not found" exceptions if the hash of the string happened to have bit 62 set. (.NET #2025, since v5.0.0).
  • Queries comparing non-optional int properties to nil would behave as if they were comparing against zero instead (since v5.0.0).

Compatibility

  • File format: Generates Realms with format v12 (Reads and upgrades all previous formats)
  • 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.

Internal

  • Upgraded realm-core from v10.0.0-beta.9 to v10.0.0
  • Upgraded realm-sync from v10.0.0-beta.14 to v10.0.0

v5.5.0 -

Enhancements

  • Add the ability to capture a NotificationToken when using a Combine publisher that observes a Realm Object or Collection. The user will call saveToken(on:at:) directly after invoking the publisher to use the feature.

Fixed

  • When using Realm.write(withoutNotifying:) there was a chance that the supplied observation blocks would not be skipped when in a write transaction. (Object Store #1103)
  • Comparing two identical unmanaged List<>/RLMArray objects would fail. (#5665).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 5.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

v5.4.8 -

Fixed

  • Case-insensitive equality queries on indexed string properties failed to clear some internal state when rerunning the query. This could manifest as duplicate results or "key not found" errors. (#6830, #6694, since 5.0.0).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 5.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

Internal

  • Upgraded realm-core from v6.1.3 to v6.1.4
  • Upgraded realm-sync from v5.0.28 to v5.0.29

v10.0.0-rc.1 -

Breaking Changes

  • Change the following methods on RLMUser to properties:
    • [RLMUser emailPasswordAuth] => RLMUser.emailPasswordAuth
    • [RLMUser identities] => RLMUser.identities
    • [RLMUser allSessions] => RLMUser.allSessions
    • [RLMUser apiKeysAuth] => RLMUser.apiKeysAuth
  • Other changes to RLMUser:
    • nullable has been removed from RLMUser.identifier
    • nullable has been removed from RLMUser.customData
  • Change the following methods on RLMApp to properties:
    • [RLMApp allUsers] => RLMApp.allUsers
    • [RLMApp currentUser] => RLMApp.currentUser
    • [RLMApp emailPasswordAuth] => RLMApp.emailPasswordAuth
  • Define RealmSwift.Credentials as an enum instead of a typealias. Example usage has changed from Credentials(googleAuthCode: "token") to Credentials.google(serverAuthCode: "serverAuthCode"), and Credentials(facebookToken: "token") to Credentials.facebook(accessToken: "accessToken"), etc.
  • Remove error parameter and redefine payload in + (instancetype)credentialsWithFunctionPayload:(NSDictionary *)payload error:(NSError **)error;. It is now defined as + (instancetype)credentialsWithFunctionPayload:(NSDictionary<NSString *, id<RLMBSON>> *)payload;

Compatibility

  • File format: Generates Realms with format v20 (Reads and upgrades all previous formats)
  • 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.

v5.4.7 -

Fixed

  • Equality queries on indexed string properties would sometimes throw "key not found" exceptions if the hash of the string happened to have bit 62 set. (.NET #2025, since v5.0.0).
  • Queries comparing non-optional int properties to nil would behave as if they were comparing against zero instead (since v5.0.0).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 5.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

Internal

  • Upgraded realm-core from v6.1.2 to v6.1.3
  • Upgraded realm-sync from v5.0.27 to v5.0.28

v10.0.0-beta.6 -

Breaking Changes

  • Change Google Credential parameter names to better reflect the required auth code:
    • Credentials(googleToken:) => Credentials(googleAuthCode:)
    • [RLMCredentials credentialsWithGoogleToken:] => [RLMCredentials credentialsWithGoogleAuthCode:]
  • Rename Realm.Publishers to RealmPublishers to avoid confusion with Combine.Publishers

Fixed

  • Deleting objects could sometimes change the ObjectId remaining objects from null to ObjectId("deaddeaddeaddeaddeaddead") when there are more than 1000 objects. (Since v10.0.0-alpha.1)
  • Fixed an assertion failure when adding an index to a nullable ObjectId property that contains nulls. (since v10.0.0-alpha.1).

This release also contains the following changes from 5.4.0 - 5.4.6:

Enhancements

  • Add prebuilt binary for Xcode 11.7 to the release package.
  • Add prebuilt binary for Xcode 12 to the release package.
  • Improve the asymptotic performance of NOT IN queries on indexed properties. It is now O(Number of Rows) rather than O(Number of Rows * Number of values in IN clause.)
  • Slightly (<5%) improve the performance of most operations which involve reading from a Realm file.

Fixed

  • Upgrading pre-5.x files with string primary keys would result in a file where realm.object(ofType:forPrimaryKey:) would fail to find the object. (#6716, since 5.2.0)
  • A write transaction which modifies an object with more than 16 managed properties and causes the Realm file to grow larger than 2 GB could cause an assertion failure mentioning "m_has_refs". (JS #3194, since 5.0.0).
  • Objects with more than 32 properties could corrupt the Realm file and result in a variety of crashes. (Java #7057, since 5.0.0).
  • Fix deadlocks when opening a Realm file in both the iOS simulator and Realm Studio (#6743, since 5.3.6).
  • Fix Springboard deadlocking when an app is unsuspended while it has an open Realm file which is stored in an app group on iOS 10-12 (#6749, since 5.3.6).
  • If you use encryption your application could crash with a message like "Opening Realm files of format version 0 is not supported by this version of Realm". (#6889 among others, since 5.0.0)
  • Confining a Realm to a serial queue would throw an error claiming that the queue was not a serial queue on iOS versions older than 12. (#6735, since 5.0.0).
  • Results would sometimes give stale results inside a write transaction if a write which should have updated the Results was made before the first access of a pre-existing Results object. (#6721, since 5.0.0)
  • Fix Archiving the Realm and RealmSwift frameworks with Xcode 12. (#6774)
  • Fix compilation via Carthage when using Xcode 12 (#6717).
  • Fix a crash inside realm::Array(Type)::init_from_mem() which would sometimes occur when running a query over links immediately after creating objects of the queried type. (#6789 and possibly others, since 5.0.0).
  • Possibly fix problems when changing the type of the primary key of an object from optional to non-optional.
  • Rerunning an equality query on an indexed string property would give incorrect results if a previous run of the query matched multiple objects and it now matches one object. This could manifest as either finding a non-matching object or a "key not found" exception being thrown. (#6536, since 5.0.0).

Compatibility

  • File format: Generates Realms with format v12 (Reads and upgrades all previous formats)
  • Realm Studio: 10.0.0 or later.
  • Carthage release for Swift is built with Xcode 12.

Internal

  • Upgraded realm-core from v10.0.0-beta.7 to v10.0.0-beta.9
  • Upgraded realm-sync from v10.0.0-beta.11 to v10.0.0-beta.14

v5.4.6 -

v5.4.5 -

Enhancements

  • Slightly (<5%) improve the performance of most operations which involve reading from a Realm file.

Fixed

  • Rerunning an equality query on an indexed string property would give incorrect results if a previous run of the query matched multiple objects and it now matches one object. This could manifest as either finding a non-matching object or a "key not found" exception being thrown. (#6536, since 5.0.0).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 5.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

Internal

  • Upgraded realm-core from v6.1.1 to v6.1.2
  • Upgraded realm-sync from v5.0.25 to v5.0.25

v5.4.4 -

Enhancements

  • Improve the asymptotic performance of NOT IN queries on indexed properties. It is now O(Number of Rows) rather than O(Number of Rows * Number of values in IN clause).

Fixed

  • Fix a crash inside realm::Array(Type)::init_from_mem() which would sometimes occur when running a query over links immediately after creating objects of the queried type. (#6789 and possibly others, since 5.0.0).
  • Possibly fix problems when changing the type of the primary key of an object from optional to non-optional.

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 5.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

Internal

  • Upgraded realm-core from v6.0.26 to v6.1.1
  • Upgraded realm-sync from v5.0.23 to v5.0.24

v5.4.3 -

Fixed

  • Fix compilation via Carthage when using Xcode 12 (#6717).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.12 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

v5.4.2 -

Enhancements

  • Add prebuilt binary for Xcode 12 to the release package.

Fixed

  • Fix Archiving the Realm and RealmSwift frameworks with Xcode 12. (#6774)

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.12 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 12.

v5.4.1 -

Enhancements

  • Add prebuilt binary for Xcode 11.7 to the release package.

Fixed

  • Fix deadlocks when opening a Realm file in both the iOS simulator and Realm Studio (#6743, since 5.3.6).
  • Fix Springboard deadlocking when an app is unsuspended while it has an open Realm file which is stored in an app group on iOS 10-12 (#6749, since 5.3.6).
  • If you use encryption your application cound crash with a message like "Opening Realm files of format version 0 is not supported by this version of Realm". (#6889 among others, since 5.0.0)
  • Confining a Realm to a serial queue would throw an error claiming that the queue was not a serial queue on iOS versions older than 12. (#6735, since 5.0.0).
  • Results would sometimes give stale results inside a write transaction if a write which should have updated the Results was made before the first access of a pre-existing Results object. (#6721, since 5.0.0)

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.12 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.7.

Internal

  • Upgraded realm-core from v6.0.25 to v6.0.26
  • Upgraded realm-sync from v5.0.22 to v5.0.23

v10.0.0-beta.5 -

Enhancements

  • Add User.loggedIn.
  • Add support for multiple Realm Apps.
  • Remove [RLMSyncManager shared]. This is now instatiated as a property on the app itself.
  • Add Combine support for:
    • PushClient
    • APIKeyAuth
    • User
    • MongoCollection
    • EmailPasswordAuth
    • App.login

Fixed

  • Fix MongoCollection.watch to consistently deliver events on a given queue.
  • Fix [RLMUser logOutWithCompletion] and User.logOut to now log out the correct user.
  • Fix crash on startup on iOS versions older than 13 (since v10.0.0-beta.3).

Breaking Changes

  • RLMSyncManager.pinnedCertificatePaths has been removed.
  • Classes RLMUserAccountInfo & RLMUserInfo (swift: UserInfo, UserAccountInfo) have been removed.
  • The following functionality has been renamed to align Cocoa with the other Realm SDKs:
Old API New API
RLMUser.identity RLMUser.identifier
User.identity User.id
-[RLMCredentials credentialsWithUsername:password:] -[RLMCredentials credentialsWithEmail:password:]
Credentials(username:password:) Credentials(email:password:)
-[RLMUser apiKeyAuth] -[RLMUser apiKeysAuth]
User.apiKeyAuth() User.apiKeysAuth()
-[RLMEmailPasswordAuth registerEmail:password:completion:] -[RLMEmailPasswordAuth registerUserWithEmail:password:completion:]
App.emailPasswordAuth().registerEmail(email:password:) App.emailPasswordAuth().registerUser(email:password:)

Compatibility

  • File format: Generates Realms with format v12 (Reads and upgrades all previous formats)
  • Realm Studio: 10.0.0 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v10.0.0-beta.6 to v10.0.0-beta.7
  • Upgraded realm-sync from v10.0.0-beta.10 to v10.0.0-beta.11

v5.4.0 -

This version bumps the Realm file format version. This means that older versions of Realm will be unable to open Realm files written by this version, and a new version of Realm Studio will be required. There are no actual format changes and the version bump is just to force a re-migration of incorrectly upgraded Realms.

Fixed

  • Upgrading pre-5.x files with string primary keys would result in a file where realm.object(ofType:forPrimaryKey:) would fail to find the object. (#6716, since 5.2.0)
  • A write transaction which modifies an object with more than 16 managed properties and causes the Realm file to grow larger than 2 GB could cause an assertion failure mentioning "m_has_refs". (JS #3194, since 5.0.0).
  • Objects with more than 32 properties could corrupt the Realm file and result in a variety of crashes. (Java #7057, since 5.0.0).

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.12 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.23 to v6.0.25
  • Upgraded realm-sync from v5.0.20 to v5.0.22

v10.0.0-beta.4 -

Enhancements

  • Add support for the 64-bit watchOS simulator added in Xcode 12.
  • Add ability to stream change events on a remote MongoDB collection with [RLMMongoCollection watch:delegate:delegateQueue], MongoCollection.watch(delegate). When calling watch(delegate) you will be given a RLMChangeStream (ChangeStream), this will be used to invalidate and stop the streaming session by calling [RLMChangeStream close] (ChangeStream.close()) when needed.
  • Add MongoCollection.watch, which is a Combine publisher that will stream change events each time the remote MongoDB collection is updated.
  • Add ability to open a synced Realm with a nil partition value.

Fixed

  • <How to hit and notice issue? what was the impact?> (#????, since v?.?.?)
  • Realm.Configuration.objectTypes now accepts embedded objects
  • Ports fixes from 5.3.5

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the v10.0.0-beta.x series.
  • Carthage release for Swift is built with Xcode 11.5.

Internal

  • Upgraded realm-core from v10.0.0-beta.1 to v10.0.0-beta.5
  • Upgraded realm-sync from v10.0.0-beta.2 to v10.0.0-beta.8

v5.3.6 -

Fixed

  • Work around iOS 14 no longer allowing the use of file locks in shared containers, which resulted in the OS killing an app which entered the background while a Realm was open (#6671).
  • If an attempt to upgrade a realm has ended with a crash with "migrate_links()" in the call stack, the realm was left in an invalid state. The migration logic now handles this state and can complete upgrading files which were incompletely upgraded by pre-5.3.4 versions.
  • Fix deadlocks when writing to a Realm file on an exFAT partition from macOS. (#6691).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.19 to v6.0.23
  • Upgraded realm-sync from v5.0.16 to v5.0.20

v5.3.5 -

Fixed

  • Opening Realms on background threads could produce spurious Incorrect Thread exceptions when a cached Realm existed for a previously existing thread with the same thread ID as the current thread. (#6659, #6689, #6712, since 5.0.0).
  • Upgrading a table with incoming links but no properties would crash. This was probably not possible to hit in practice as we reject object types with no properties.
  • Upgrading a non-nullable List which nonetheless contained null values would crash. This was possible due to missing error-checking in some older versions of Realm.

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.18 to v6.0.19
  • Upgraded realm-sync from v5.0.15 to v5.0.16

v5.3.4 -

Fixed

  • Accessing a Realm after calling deleteAll() would sometimes throw an exception with the reason 'ConstIterator copy failed'. (#6597, since 5.0.0).
  • Fix an assertion failure inside the migrate_links() function when upgrading a pre-5.0 Realm file.
  • Fix a bug in memory mapping management. This bug could result in multiple different asserts as well as segfaults. In many cases stack backtraces would include members of the EncyptedFileMapping near the top - even if encryption was not used at all. In other cases asserts or crashes would be in methods reading an array header or array element. In all cases the application would terminate immediately. (Core #3838, since v5.0.0).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.14 to v6.0.18
  • Upgraded realm-sync from v5.0.14 to v5.0.15

v5.3.3 -

Enhancements

  • Add support for the x86_64 watchOS simulator added in Xcode 12.

Fixed

  • (RLM)Results objects would incorrectly pin old read transaction versions until they were accessed after a Realm was refreshed, resulting in the Realm file growing to large sizes if a Results was retained but not accessed after every write. (#6677, since 5.0.0).
  • Fix linker errors when using SwiftUI previews with Xcode 12 when Realm was installed via Swift Package Manager. (#6625)

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.12 to v6.0.14
  • Upgraded realm-sync from v5.0.12 to v5.0.14

v5.3.2 -

Fixed

  • Fix a file format upgrade bug when opening older Realm files.. Could cause assertions like "Assertion failed: ref != 0" during opening of a Realm. (Core #6644, since 5.2.0)
  • A use-after-free would occur if a Realm was compacted, opened on multiple threads prior to the first write, then written to while reads were happening on other threads. This could result in a variety of crashes, often inside realm::util::EncryptedFileMapping::read_barrier. (Since v5.0.0, #6626, #6628, #6652, #6655, #6656).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.11 to v6.0.12
  • Upgraded realm-sync from v5.0.11 to v5.0.12

v5.3.1 -

Enhancements

  • Add prebuilt binary for Xcode 11.6 to the release package.

Fixed

  • Creating an object inside migration which changed that object type's primary key would hit an assertion failure mentioning primary_key_col (#6613, since 5.0.0).
  • Modifying the value of a string primary key property inside a migration with a Realm file which was upgraded from pre-5.0 would corrupt the property's index, typically resulting in crashes. (Core #3765, since 5.0.0).
  • Some Realm files which hit assertion failures when upgrading from the pre-5.0 file format should now upgrade correctly (Since 5.0.0).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.6.

Internal

  • Upgraded realm-core from v6.0.9 to v6.0.11
  • Upgraded realm-sync from v5.0.8 to v5.0.11

v5.3.0 -

Enhancements

  • Add Realm.objectWillChange, which is a Combine publisher that will emit a notification each time the Realm is refreshed or a write transaction is committed.

Fixed

  • Fix the spelling of ObjectKeyIdentifiable. The old spelling is available and deprecated for compatibility.
  • Rename RealmCollection.publisher to RealmCollection.collectionPublisher. The old name interacted with the publisher defined by Sequence in very confusing ways, so we need to use a different name. The publisher name is still available for compatibility. (#6516)
  • Work around "xcodebuild timed out while trying to read SwiftPackageManagerExample.xcodeproj" errors when installing Realm via Carthage. (#6549).
  • Fix a performance regression when using change notifications. (Since 5.0.0, #6629).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.5.

Internal

  • Upgraded realm-core from v6.0.8 to v6.0.9
  • Upgraded realm-sync from v5.0.7 to v5.0.8

v5.2.0 -

Xcode 11.3 and iOS 9 are now the minimum supported versions.

Enhancements

  • Add support for building with Xcode 12 beta 1. watchOS currently requires removing x86_64 from the supported architectures. Support for the new 64-bit watch simulator will come in a future release.

Fixed

  • Opening a Realm file in file format v6 (created by Realm Cocoa versions between 2.4 and 2.10) would crash. (Since 5.0.0, Core #3764).
  • Upgrading v9 (pre-5.0) Realm files would create a redundant search index for primary key properties. This index would then be removed the next time the Realm was opened, resulting in some extra i/o in the upgrade process. (Since 5.0.0, Core #3787).
  • Fixed a performance issue with upgrading v9 files with search indexes on non-primary-key properties. (Since 5.0.0, Core #3767).
  • List.index(of:) would give incorrect results if it was the very first thing called on that List after a Realm was refreshed following a write which modified the List. (Since 5.0.0, #6606).
  • If a ThreadSafeReference was the only remaining reference to a Realm, multiple copies of the file could end up mapped into memory at once. This probably did not have any symptoms other than increased memory usage. (Since 5.0.0).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.5.

Internal

  • Upgraded realm-core from v6.0.6 to v6.0.8
  • Upgraded realm-sync from v5.0.5 to v5.0.7

v5.1.0 -

Enhancements

  • Allow opening full-sync Realms in read-only mode. This disables local schema initialization, which makes it possible to open a Realm which the user does not have write access to without using asyncOpen. In addition, it will report errors immediately when an operation would require writing to the Realm rather than reporting it via the sync error handler only after the server rejects the write.

Fixed

  • Opening a Realm using a configuration object read from an existing Realm would incorrectly bind the new Realm to the original Realm's thread/queue, resulting in "Realm accessed from incorrect thread." exceptions. (#6574, #6559, since 5.0.0).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Realm Studio: 3.11 or later.
  • APIs are backwards compatible with all previous releases in the 5.x.y series.
  • Carthage release for Swift is built with Xcode 11.5.