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
  • Provides information about the changes that have occurred in relation to an event delivered when observing the collections in a DittoStore. It contains information about the collections that are known about as well as the collections that were previously known about in the previous event, along with information about what collections have been inserted, deleted, updated, or moved since the last event.

    See more

    Declaration

    Swift

    public struct DittoCollectionsEvent
    extension DittoCollectionsEvent: CustomStringConvertible, CustomDebugStringConvertible
  • 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
    extension DittoDocumentID: ExpressibleByStringLiteral
    extension DittoDocumentID: ExpressibleByBooleanLiteral
    extension DittoDocumentID: ExpressibleByIntegerLiteral
    extension DittoDocumentID: ExpressibleByArrayLiteral
    extension DittoDocumentID: ExpressibleByDictionaryLiteral
  • Provides an interface to specify a path to a key in a document ID that you can then call a function on to get the value at the specified key as a specific type. You obtain a DittoDocumentIDPath by subscripting a DittoDocumentID and you can then further subscript a DittoDocumentIDPath to further specify the key of the document ID that you want to get the value of. This is only really useful if you’re working with a document ID whose underlying value is a dictionary or an array.

    See more

    Declaration

    Swift

    public struct DittoDocumentIDPath
  • 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 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