Replication

public final class Replication

A replication between a local and a remote database. Before starting the replication, you just set either the push or pull property, or both. The replication runs asynchronously, so set a delegate or observe the status property to be notified of progress.

  • Activity level of a replication.

    See more

    Declaration

    Swift

    public enum ActivityLevel : UInt8
  • Progress of a replication. If total is zero, the progress is indeterminate; otherwise, dividing the two will produce a fraction that can be used to draw a progress bar.

    See more

    Declaration

    Swift

    public struct Progress
  • Combined activity level and progress of a replication.

    See more

    Declaration

    Swift

    public struct Status
  • The local database.

    Declaration

    Swift

    public let database: Database
  • The URL of the remote database to replicate with, or nil if the target database is local.

    Declaration

    Swift

    public var remoteURL: URL?
  • The target database, if it’s local, else nil.

    Declaration

    Swift

    public let otherDatabase: Database?
  • Should the replication push documents to the target?

    Declaration

    Swift

    public var push: Bool
  • Should the replication pull documents from the target?

    Declaration

    Swift

    public var pull: Bool
  • Should the replication stay active indefinitely, and push/pull changed documents?

    Declaration

    Swift

    public var continuous: Bool
  • An object that will receive progress and error notifications.

    Declaration

    Swift

    public var delegate: ReplicationDelegate?
  • Starts the replication. This method returns immediately; the replication runs asynchronously and will report its progress to the delegate. (After the replication starts, changes to the push, pull or continuous properties are ignored.)

    Declaration

    Swift

    public func start()
  • Stops a running replication. This method returns immediately; when the replicator actually stops, the CBLReplication will change its status’s activity level to kCBLStopped and call the delegate.

    Declaration

    Swift

    public func stop()
  • The replication’s current status: its activity level and progress.

    Declaration

    Swift

    public var status: Status
  • Any error that’s occurred during replication.

    Declaration

    Swift

    public var lastError: Error?