Realm v3.0.0-beta.4 Release Notes
Release Date: 2017-09-22 // over 6 years ago-
๐ฅ Breaking Changes
- ๐ Rename
List.remove(objectAtIndex:)
toList.remove(at:)
to match the name used by 'RangeReplaceableCollection'. - ๐ Rename
List.swap()
toList.swapAt()
to match the name used by 'Array'. - Loosen
RLMArray
andRLMResults
's generic constraint fromRLMObject
toNSObject
. This may result in having to add some casts to disambiguate types. - โ Remove
RLMPropertyTypeArray
in favor of a separate boolarray
property onRLMProperty
/Property
. - โ Remove
RLMSyncPermissionResults
.RLMSyncPermission
s are now vended out using aRLMResults
. This results collection supports all normal collection operations except for setting values using KVO (sinceRLMSyncPermission
s are immutable) and the property aggregation operations. RealmCollection
's associated typeElement
has been renamedElementType
.- Realm Swift collection types (
List
,Results
,AnyRealmCollection
, andLinkingObjects
have had their generic type parameter changed fromT
toElement
). RealmOptional
's generic type parameter has been changed fromT
toValue
.- ๐
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 toMutableCollection
instead ofRangeReplaceableCollection
. For Swift 4, the empty collection initializer has been removed, and default implementations of range replaceable collection methods that make sense forList
have been added. - ๐
List.removeLast()
now throws an exception if the list is empty, to more closely match the behavior of the standard library'sCollection.removeLast()
implementation.
โจ Enhancements
List
can now contain values of typesBool
,Int
,Int8
,Int16
,Int32
,Int64
,Float
,Double
,String
,Data
, andDate
(and optional versions of all of these) in addition toObject
subclasses. QueryingList
s containing values other thanObject
subclasses is not yet implemented.RLMArray
can now be constrained with the protocolsRLMBool
,RLMInt
,RLMFloat
,RLMDouble
,RLMString
,RLMData
, andRLMDate
in addition to protocols defined withRLM_ARRAY_TYPE
. By defaultRLMArray
s 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. QueryingRLMArray
s containing values other thanRLMObject
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 aSyncConfiguration
, opening the Realm, and then callingRealm.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.
- ๐ Rename