ConflictResolver

public protocol ConflictResolver

A protocol for an application-defined object that can resolve a conflict between two versions of a document along with the base or the common ancester document if available. Called when saving a document, when there is a a newer revision already in the database; and also when the replicator pulls a remote revision that conflicts with a locally-saved revision.

  • Resolves the given conflict. Returning a nil document means giving up the conflict resolution and will result to a conflicting error returned when saving the document.

    Declaration

    Swift

    func resolve(conflict: Conflict) -> Document?

    Parameters

    conflict

    The conflict object.

    Return Value

    The result document of the conflict resolution.