Structures

The following structures are available globally.

  • A configuration object specifying which network transports Ditto should use to sync data.

    A Ditto object comes with a default transport configuration where all available peer-to-peer transports are enabled. You can customize this by initializing a DittoTransportConfig, adjusting its properties, and supplying it to setTransportConfig() on Ditto.

    When you initialize a DittoTransportConfig yourself it starts with all transports disabled. You must enable each one directly.

    Peer-to-peer transports will automatically discover peers in the vicinity and create connections without any configuration. These are configured inside the peerToPeer property. To turn each one on, set its enabled property to true.

    To connect to a peer at a known location, such as a Ditto Big Peer, add its address inside the connect configuration. These are either “host:port” strings for raw TCP sync, or a “wss://…” URL for websockets.

    The listen configurations are for specific less common data sync scenarios. Please read the documentation on the Ditto website for examples. Incorrect use of listen can result in insecure configurations.

    See more

    Declaration

    Swift

    public struct DittoTransportConfig
  • An identifier for a DittoDocument.

    Each DittoDocumentID represents a unique identifier for a document.

    See more

    Declaration

    Swift

    public struct DittoDocumentID : Hashable
    extension DittoDocumentID: CustomStringConvertible, CustomDebugStringConvertible
  • Provides an interface to specify a path to a key in a document that you can then call a function on to get the value at the specified key as a specific type. You obtain a DittoDocumentPath by subscripting a DittoDocument and you can then further subscript a DittoDocumentPath to further specify the key of the document that you want to get the value of.

    See more

    Declaration

    Swift

    public struct DittoDocumentPath
  • Provides information about the changes that have occurred in relation to a live query for a given update event.

    This type is returned in the update case of the DittoLiveQueryEvent enum.

    See more

    Declaration

    Swift

    public struct DittoLiveQueryUpdate
  • Provides an interface to specify a path to a key in a document that you can then call various update functions on. You obtain a DittoMutableDocumentPath by subscripting a DittoMutableDocument and you can then further subscript a DittoMutbaleDocumentPath to further specify the key of the document that you want to update.

    See more

    Declaration

    Swift

    public struct DittoMutableDocumentPath
  • Provides information about a live query event relating to a single document live query.

    See more

    Declaration

    Swift

    public struct DittoSingleDocumentLiveQueryEvent
  • A summary snapshot of the types of connections currently active to a remote Ditto peer.

    See more

    Declaration

    Swift

    public struct DittoRemotePeer : Codable
    extension DittoRemotePeer: Identifiable