Realm ObjC & Swift 2.5: Query Improvements, Swift 3.1 Binaries & Bug Fixes!

Realm files read or written by this version cannot be opened with previous versions of Realm. Existing files will automatically be upgraded when they are opened. Old files can still be opened and files open in read-only mode will not be modified. Please be careful about shipping updates to your existing apps!

We’re releasing version 2.5 of Realm Objective‑C and Realm Swift today. In this release, we’re empowering queries with support for diacritic-insensitive string search, adding the ability to compare nested objects against NULL and applying a large number of bug fixes to keep your apps running strong.

We’re also now producing Swift binaries for Swift 3.0, 3.0.1, 3.0.2 and 3.1.

If using synchronized Realms, the Realm Object Server must be running version 1.3.0 or later.

Diacritic-Insensitive String Queries

You may now use the [d] modifier on string comparison operators to perform diacritic-insensitive comparisons. This modifier can even be combined with the case insensitive modifier ([c]).

For example:

  • ==[d] 'u' will match on ü
  • BEGINSWITH[d] 'e' will match on étoile
  • CONTAINS[d] 'n' will match on Piñata
  • ENDSWITH[d] 's' will match on diaçrïtičş
  • ENDSWITH[cd] 'É' will match on café

Note that this cannot be applied to LIKE comparisons.

Multi-level object equality comparisons against NULL

You may now query for multi-level object equality comparisons against NULL. For example:

class CircleObject: Object {
  dynamic var data = ""
  dynamic var next: CircleObject?
}
let realm = try Realm()
realm.objects(CircleObject.self).filter("next.next != nil AND next.next.next = nil")

Other Enhancements

  • Explicitly mark [[RLMRealm alloc] init] as unavailable.
  • Include the name of the problematic class in the error message when an invalid property type is marked as the primary key.

Bug Fixes

  • Fix incorrect column type assertions which could occur after schemas were merged by sync.
  • Eliminate an empty write transaction when opening a synced Realm.
  • Support encrypting synchronized Realms by respecting the encryptionKey value of the Realm’s configuration.
  • Fix crash when setting an {NS}Data property close to 16MB.
  • Fix for reading {NS}Data properties incorrectly returning nil.
  • Reduce file size growth in cases where Realm versions were pinned while starting write transactions.
  • Fix an assertion failure when writing to large RLMArray/List properties.
  • Fix uncaught BadTransactLog exceptions when pulling invalid changesets from synchronized Realms.
  • Fix an assertion failure when an observed RLMArray/List is deleted after being modified.

A Note About Xcode 8.3

We typically produce Objective‑C binaries using the latest stable Xcode version, which as of this week is Xcode 8.3. However, we’ve discovered (rdar://31302382) that Xcode 8.3 produces binaries with bitcode slices about four times as large as previous Xcode versions! This brings the Realm Objective-C framework for iOS from its usual 55MB to about 158MB! So we’ve decided to continue building the Objective-C framework using Xcode 8.2. You may choose to build Realm Objective-C from source using Xcode 8.3, and your end users won’t be affected because bitcode is stripped from the binaries when apps are served from the App Store.


Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on Stack Overflow, GitHub, or Twitter.