RealmMapChange

@frozen
public enum RealmMapChange<Collection> where Collection : RealmKeyedCollection

A RealmMapChange value encapsulates information about changes to dictionaries that are reported by Realm notifications.

  • .initial indicates that the initial run of the query has completed (if applicable), and the collection can now be used without performing any blocking work.

    Declaration

    Swift

    case initial(Collection)
  • .update indicates that a write transaction has been committed which either changed which keys are in the collection, or the values of the objects for those keys in the collection, and/or modified one or more of the objects in the collection.

    Declaration

    Swift

    case update(Collection, deletions: [Collection.Key], insertions: [Collection.Key], modifications: [Collection.Key])

    Parameters

    deletions

    The keys in the previous version of the collection which were removed from this one.

    insertions

    The keys in the new collection which were added in this version.

    modifications

    The keys of the objects in the new collection which were modified in this version.

  • If an error occurs, notification blocks are called one time with a .error result and an NSError containing details about the error. This can only currently happen if opening the Realm on a background thread to calcuate the change set fails. The callback will never be called again after it is invoked with a .error value.

    Declaration

    Swift

    case error(Error)