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 8.x.
  • 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: 14088

Dependencies

Used By

Total: 0

Releases

v5.4.3 - 2020-09-21 23:18:08

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 - 2020-09-18 00:57:23

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 - 2020-09-16 18:49:52

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 - 2020-09-16 02:15:12

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 - 2020-09-10 00:45:20

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 - 2020-09-03 19:49:50

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 - 2020-09-03 01:02:36

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 - 2020-08-21 00:29:54

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 - 2020-08-17 23:34:25

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 - 2020-07-31 04:39:12

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 - 2020-07-21 21:20:12

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 - 2020-07-18 04:49:53

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 - 2020-07-15 01:48:27

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 - 2020-07-01 01:25:18

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 - 2020-06-22 17:58:09

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.

v5.0.3 - 2020-06-11 03:44:33

Fixed

  • -[RLMObject isFrozen] always returned false. (#6568, since 5.0.0).
  • Freezing an object within the write transaction that the object was created in now throws an exception rather than crashing when the object is first used.
  • The schema for frozen Realms was not properly initialized, leading to crashes when accessing a RLMLinkingObjects property. (#6568, since 5.0.0).
  • Observing Object.isInvalidated via a keypath literal would produce a warning in Swift 5.2 due to the property not being marked as @objc. (#6554)

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.

v10.0.0-beta.2 - 2020-06-09 16:21:07

Enhancements

  • None.

Fixed

  • Opening a SyncSession with LOCAL app deployments would not use the correct endpoints.
  • Linking from embedded objects to top-level objects was incorrectly disallowed.

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • MongoDB Realm: 84893c5 or later.
  • APIs are backwards compatible with all previous releases in the 10.0.0-alpha series.
  • Carthage release for Swift is built with Xcode 11.5.

Internal

  • Upgraded realm-core from v6.0.3 to v10.0.0-beta.1
  • Upgraded realm-sync from v5.0.1 to v10.0.0-beta.2

v10.0.0-beta.1 - 2020-06-09 01:01:15

NOTE: This version bumps the Realm file format to version 11. It is not possible to downgrade to earlier versions. Older files will automatically be upgraded to the new file format. Only Realm Studio 10.0.0 or later will be able to open the new file format.

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 -[RLMSyncUser customData]/SyncUser.customData. Custom data is configured in your MongoDB Realm App.
  • Add -[RLMApp callFunctionNamed:arguments]/RealmApp.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 -[RLMApp mongoClientWithServiceName]/RealmApp.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.
  • Change [RLMSyncUser configurationWithPartitionValue:]/SyncUser.configuration(with:) to accept all BSON types. Partition values can currently be of types String, Int, or ObjectId. Opening a realm by partition value is the equivalent of previously opening a realm by URL. In this case,partitions are meant to be more closely associated with your data. E.g., 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.

Breaking Changes

  • 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).
  • Primary key properties are no longer marked as being indexed. This reflects an internal change to how primary keys are handled that should not have any other visible effects. (#6440).
  • Remove everything related to sync permissions, including both the path-based permission system and the object-level privileges for query-based sync. (#6445)
  • Primary key uniqueness is now enforced when creating new objects during migrations, rather than only at the end of migrations. Previously new objects could be created with duplicate primary keys during a migration as long as the property was changed to a unique value before the end of the migration, but now a unique value must be supplied when creating the object.
  • Remove support for Realm Object Server.

Compatibility

  • File format: Generates Realms with format v11 (Reads and upgrades all previous formats)
  • MongoDB Realm: 84893c5 or later.
  • APIs are backwards compatible with all previous releases in the 10.0.0-alpha series.
  • Carthage release for Swift is built with Xcode 11.5.

Internal

  • Upgraded realm-core from v6.0.3 to v10.0.0-beta.1
  • Upgraded realm-sync from v5.0.1 to v10.0.0-beta.2

v5.0.2 - 2020-06-02 22:09:05

Fixed

  • Fix errSecDuplicateItem (-25299) errors when opening a synchronized Realm when upgrading from pre-5.0 versions of Realm. (#6538, #6494, since 5.0.0).
  • Opening Realms stored on filesystems which do not support preallocation (such as ExFAT) would give "Operation not supported" exceptions. (#6508, since 3.2.0).
  • 'NoSuchTable' exceptions would sometimes be thrown after upgrading a Realm file to the v10 format. (Core #3701, since 5.0.0)
  • If the upgrade process was interrupted/killed for various reasons, the following run could stop with some assertions failing. No instances of this happening were reported to us. (Since 5.0.0).
  • Queries filtering a List where the query was on an indexed property over a link would sometimes give incomplete results. (#6540, since 4.1.0 but more common since 5.0.0)
  • Opening a file in read-only mode would attempt to make a spurious write to the file, causing errors if the file was in read-only storage (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.4 to v6.0.6
  • Upgraded realm-sync from v5.0.3 to v5.0.5

v5.0.1 - 2020-05-29 03:23:38

Enhancements

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

Fixed

  • Fix linker error when building a xcframework for Catalyst. (#6511, since 4.3.1).
  • Fix building for iOS devices when using Swift Package Manager (#6522, since 5.0.0).
  • List and RealmOptional properties on frozen objects were not initialized correctly and would always report nil or an empty list. (#6527, 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.

v5.0.0 - 2020-05-15 22:35:01

NOTE: This version bumps the Realm file format to version 10. It is not possible to downgrade version 9 or earlier. Files created with older versions of Realm will be automatically upgraded. Only Studio 3.11 or later will be able to open the new file format.

Enhancements

  • Storing large binary blobs in Realm files no longer forces the file to be at least 8x the size of the largest blob.
  • Reduce the size of transaction logs stored inside the Realm file, reducing file size growth from large transactions.
  • Add support for frozen objects. Realm, Results, List and Object now have freeze() methods which return a frozen copy of the object. These objects behave similarly to creating unmanaged deep copies of the source objects. They can be read from any thread and do not update when writes are made to the Realm, but creating frozen objects does not actually copy data out of the Realm and so can be much faster and use less memory. Frozen objects cannot be mutated or observed for changes (as they never change). (PR #6427).
  • Add the isFrozen property to Realm, Results, List and Object.
  • Add Realm.Configuration.maxNumberOfActiveVersions. Each time a write transaction is performed, a new version is created inside the Realm, and then any versions which are no longer in use are cleaned up. If too many versions are kept alive while performing writes (either due to a background thread performing a long operation that doesn't let the Realm on that thread refresh, or due to holding onto frozen versions for a long time) the Realm file will grow in size, potentially to the point where it is too large to be opened. Setting this configuration option will make write transactions which would cause the live version count to exceed the limit to instead fail.
  • Add support for queue-confined Realms. Rather than being bound to a specific thread, queue-confined Realms are bound to a serial dispatch queue and can be used within blocks dispatched to that queue regardless of what thread they happen to run on. In addition, change notifications will be delivered to that queue rather than the thread's run loop. (PR #6478).
  • Add an option to deliver object and collection notifications to a specific serial queue rather than the current thread. (PR #6478).
  • Add Combine publishers for Realm types. Realm collections have a .publisher property which publishes the collection each time it changes, and a .changesetPublisher which publishes a RealmCollectionChange each time the collection changes. Corresponding publishers for Realm Objects can be obtained with the publisher() and changesetPublisher() global functions.
  • Extend Combine publishers which output Realm types with a .freeze() function which will make the publisher instead output frozen objects.
  • String primary keys no longer require a separate index, improving insertion and deletion performance without hurting lookup performance.
  • Reduce the encrypted page reclaimer's impact on battery life when encryption is used. (Core #3461).

Fixed

  • The uploaded bytes in sync progress notifications was sometimes incorrect and wouldn't exactly equal the uploadable bytes when the uploaded completed.
  • macOS binaries were built with the incorrect deployment target (10.14 rather than 10.9), resulting in linker warnings. (#6299, since 3.18.0).
  • An internal datastructure for List properties could be double-deleted if the last reference was released from a thread other than the one which the List was created on at the wrong time. This would typically manifest as "pthread_mutex_destroy() failed", but could also result in other kinds of crashes. (#6333).
  • Sorting on float or double properties containing NaN values had inconsistent results and would sometimes crash due to out-of-bounds memory accesses. (#6357).

Breaking Changes

  • The ObjectChange type in Swift is now generic and includes a reference to the object which changed. When using observe(on:) to receive notifications on a dispatch queue, the object will be confined to that queue.
  • The Realm instance passed in the callback to asyncOpen() is now confined to the callback queue passed to asyncOpen() rather than the thread which the callback happens to be called on. This means that the Realm instance may be stored and reused in further blocks dispatched to that queue, but the queue must now be a serial queue.
  • Files containing Date properties written by version of Realm prior to 1.0 can no longer be opened.
  • Files containing Any properties can no longer be opened. This property type was never documented and was deprecated in 1.0.
  • Deleting objects now preserves the order of objects reported by unsorted Results rather than performing a swap operation before the delete. Note that it is still not safe to assume that the order of objects in an unsorted Results is the order that the objects were created in.

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

Internal

  • Upgraded realm-core from v5.23.8 to v6.0.4
  • Upgraded realm-sync from v4.9.5 to v5.0.3

v5.0.0-beta.6 - 2020-05-10 19:42:50

Enhancements

  • Add support for queue-confined Realms. Rather than being bound to a specific thread, queue-confined Realms are bound to a serial dispatch queue and can be used within blocks dispatched to that queue regardless of what thread they happen to run on. In addition, change notifications will be delivered to that queue rather than the thread's run loop. (PR #6478).
  • Add an option to deliver object and collection notifications to a specific serial queue rather than the current thread. (PR #6478).

Fixed

  • The uploaded bytes in sync progress notifications was sometimes incorrect and wouldn't exactly equal the uploadable bytes when the uploaded completed.

Breaking Changes

  • The Realm instance passed in the callback to asyncOpen() is now confined to the callback queue passed to asyncOpen() rather than the thread which the callback happens to be called on. This means that the Realm instance may be stored and reused in further blocks dispatched to that queue, but the queue must now be a serial queue.

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.4.1.

Internal

  • Upgraded realm-core from v6.0.3 to v6.0.4
  • Upgraded realm-sync from v5.0.1 to v5.0.3

v4.4.1 - 2020-04-17 04:42:22

Enhancements

  • Upgrade Xcode 11.4 binaries to Xcode 11.4.1.

Fixed

  • Fix a "previous <= m_schema_transaction_version_max" assertion failure caused by a race condition that could occur after performing a migration. (Since 3.0.0).

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.4.1.

v4.4.0 - 2020-03-26 21:24:10

Swift 4.0 and Xcode 10.3 are now the minimum supported versions.

Enhancements

  • Allow setting the fileUrl for synchronized Realms. An appropriate local path based on the sync URL will still be used if it is not overridden. (PR #6454).
  • Add Xcode 11.4 binaries to the release package.

Fixed

  • None.

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.4.

v5.0.0-beta.3 - 2020-02-27 05:44:20

Based on 4.3.2 and also includes all changes since 4.3.0.

Enhancements

  • Add support for frozen objects. Realm, Results, List and Object now have freeze() methods which return a frozen copy of the object. These objects behave similarly to creating unmanaged deep copies of the source objects. They can be read from any thread and do not update when writes are made to the Realm, but creating frozen objects does not actually copy data out of the Realm and so can be much faster and use less memory. Frozen objects cannot be mutated or observed for changes (as they never change). (PR #6427).
  • Add the isFrozen property to Realm, Results, List and Object.
  • Add Realm.Configuration.maxNumberOfActiveVersions. Each time a write transaction is performed, a new version is created inside the Realm, and then any versions which are no longer in use are cleaned up. If too many versions are kept alive while performing writes (either due to a background thread performing a long operation that doesn't let the Realm on that thread refresh, or due to holding onto frozen versions for a long time) the Realm file will grow in size, potentially to the point where it is too large to be opened. Setting this configuration option will make write transactions which would cause the live version count to exceed the limit to instead fail.

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.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.3.

Internal

  • Upgraded realm-core from v6.0.0-beta.3 to v6.0.3
  • Upgraded realm-sync from v5.0.0-beta.2 to v5.0.1

v4.3.2 - 2020-02-06 20:36:43

Enhancements

  • Similar to autoreleasepool(), realm.write() now returns the value which the block passed to it returns. Returning Void from the block is still allowed.

Fixed

  • Fix a memory leak attributed to property_copyAttributeList the first time a Realm is opened when using Realm Swift. (#6409, since 4.0.0).
  • Connecting to a realms: sync URL would crash at runtime on iOS 11 (and no other iOS versions) inside the SSL validation code. (Since 4.3.1).

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.3.

Internal

  • Upgraded realm-sync from 4.9.4 to 4.9.5.

v4.3.1 - 2020-01-17 01:22:57

Enhancements

  • Reduce the encrypted page reclaimer's impact on battery life when encryption is used. (Core #3461).

Fixed

  • macOS binaries were built with the incorrect deployment target (10.14 rather than 10.9), resulting in linker warnings. (#6299, since 3.18.0).
  • An internal datastructure for List properties could be double-deleted if the last reference was released from a thread other than the one which the List was created on at the wrong time. This would typically manifest as "pthread_mutex_destroy() failed", but could also result in other kinds of crashes. (#6333).
  • Sorting on float or double properties containing NaN values had inconsistent results and would sometimes crash due to out-of-bounds memory accesses. (#6357).
  • A NOT query on a List<Object> which happened to have the objects in a different order than the underlying table would sometimes include the object immediately before an object which matches the query. (#6289, since 0.90.0).

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.3.

Internal

  • Upgraded realm-core from 5.23.6 to 5.23.8.
  • Upgraded realm-sync from 4.9.0 to 4.9.4.

v5.0.0-beta.2 - 2020-01-14 22:43:30

Based on 4.3.0 and also includes all changes since 4.1.1.

Fixed

  • Fix compilation when using CocoaPods targeting iOS versions older than 11 (since 5.0.0-alpha).

Compatibility

  • File format: Generates Realms with format v10 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.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.3.

Internal

  • Upgraded realm-core from v6.0.0-beta.2 to v6.0.0-beta.3
  • Upgraded realm-sync from v5.0.0-beta.1 to v5.0.0-beta.2

v4.3.0 - 2019-12-20 02:54:39

Enhancements

  • Add the ability to set a custom logger function on RLMSyncManager which is called instead of the default NSLog-based logger.
  • Expose configuration options for the various types of sync connection timeouts and heartbeat intervals on RLMSyncManager.
  • Add an option to have Realm.asyncOpen() report an error if the connection times out rather than swallowing the error and attempting to reconnect until it succeeds.

Fixed

  • Fix a crash when using value(forKey:) on a LinkingObjects property (including when doing so indirectly, such as by querying on that property). (#6366, since 4.0.0).
  • Fix a rare crash in ClientHistoryImpl::integrate_server_changesets() which would only happen in Debug builds (since v3.0.0).

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.3.

Internal

  • Upgraded realm-sync from 4.8.2 to 4.9.0.

v4.2.0 - 2019-12-17 01:29:12

Enhancements

  • Add -[RLMRealm fileExistsForConfiguration:]/Realm.fileExists(for:), which checks if a local Realm file exists for the given configuration.
  • Add -[RLMRealm deleteFilesForConfiguration:]/Realm.deleteFiles(for:) to delete the Realm file and all auxiliary files for the given configuration.

Fixed

  • None.

Compatibility

  • File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
  • Realm Object Server: 3.21.0 or later.
  • Carthage release for Swift is built with Xcode 11.3.