DiffableViewModel

public protocol DiffableViewModel

A view model that can participate in an automatic diffing algorithm.

  • diffingKey Default implementation

    The key used by the diffing algorithm to uniquely identify an element. If you are using automatic diffing on a *Driver (which is enabled by default) you are required to provide a key that uniquely identifies each element.

    Typically you want to base this diffing key on data that is stored in the model. For example:

     public var diffingKey = { group.identifier }
    

    Default Implementation

    Default implementation. Uses class name.

    Declaration

    Swift

    var diffingKey: DiffingKey { get }