Realm v3.0.0-beta.4 Release Notes

Release Date: 2017-09-22 // over 6 years ago
  • ๐Ÿ’ฅ Breaking Changes

    • ๐Ÿšš Rename List.remove(objectAtIndex:) to List.remove(at:) to match the name used by 'RangeReplaceableCollection'.
    • ๐Ÿ“‡ Rename List.swap() to List.swapAt() to match the name used by 'Array'.
    • Loosen RLMArray and RLMResults's generic constraint from RLMObject to NSObject. This may result in having to add some casts to disambiguate types.
    • โœ‚ Remove RLMPropertyTypeArray in favor of a separate bool array property on RLMProperty/Property.
    • โœ‚ Remove RLMSyncPermissionResults. RLMSyncPermissions are now vended out using a RLMResults. This results collection supports all normal collection operations except for setting values using KVO (since RLMSyncPermissions are immutable) and the property aggregation operations.
    • RealmCollection's associated type Element has been renamed ElementType.
    • Realm Swift collection types (List, Results, AnyRealmCollection, and LinkingObjects have had their generic type parameter changed from T to Element).
    • RealmOptional's generic type parameter has been changed from T to Value.
    • ๐Ÿ“‡ RLMSyncUserInfo has been significantly enhanced. It now contains metadata about a user stored on the Realm Object Server, as well as a list of all user account data associated with that user.
    • Starting with Swift 4, List now conforms to MutableCollection instead of RangeReplaceableCollection. For Swift 4, the empty collection initializer has been removed, and default implementations of range replaceable collection methods that make sense for List have been added.
    • ๐Ÿšš List.removeLast() now throws an exception if the list is empty, to more closely match the behavior of the standard library's Collection.removeLast() implementation.

    โœจ Enhancements

    • List can now contain values of types Bool, Int, Int8, Int16, Int32, Int64, Float, Double, String, Data, and Date (and optional versions of all of these) in addition to Object subclasses. Querying Lists containing values other than Object subclasses is not yet implemented.
    • RLMArray can now be constrained with the protocols RLMBool, RLMInt, RLMFloat, RLMDouble, RLMString, RLMData, and RLMDate in addition to protocols defined with RLM_ARRAY_TYPE. By default RLMArrays of non-RLMObject types can contain null. Indicating that the property is required (by overriding +requiredProperties:) will instead make the values within the array required. Querying RLMArrays containing values other than RLMObject subclasses is not yet implemented.
    • ๐Ÿ”€ Opening a synced Realm whose local copy was created with an older version of Realm Mobile Platfrom when a migration is not possible to the current version will result in an RLMErrorIncompatibleSyncedFile / incompatibleSyncedFile error. When such an error occurs, the original file is moved to a backup location, and future attempts to open the synchronized Realm will result in a new file being created. If you wish to migrate any data from the backup Realm you can open it using the backup Realm configuration available on the error object.
    • โž• Add preview support for partial synchronization. Partial synchronization is allows a synchronized Realm to be opened in such a way that only objects requested by the user are synchronized to the device. You can use it by setting the isPartial property on a SyncConfiguration, opening the Realm, and then calling Realm.subscribe(to:where:callback:) with the type of object you're interested in, a string containing a query determining which objects you want to subscribe to, and a callback which will report the results. You may add as many subscriptions to a synced Realm as necessary.

    ๐Ÿ›  Bugfixes

    • Realm Swift APIs that filter or look up the index of an object based on a format string now properly handle optional arguments in their variadic argument list.