DittoKit

@objc
public class DittoKit : NSObject

DittoKit is the entry point for accessing Ditto-related functionality.

  • An optional delegate that will be called with SDK lifecycle information if defined.

    Declaration

    Swift

    public var delegate: DittoKitDelegate?
  • Represents whether logging is enabled.

    Declaration

    Swift

    public var loggingEnabled: Bool { get set }
  • The minimum log level at which logs will be logged, provided loggingEnabled is true.

    Declaration

    Swift

    public var minimumLogLevel: DittoLogLevel { get set }
  • Represents whether or not emojis should be used as the log level indicator in the logs.

    Declaration

    Swift

    public var emojiLogLevelHeading: Bool { get set }
  • Optional log delegate that can be implemented to hook into the DittoKit logging.

    Declaration

    Swift

    public var logDelegate: DittoLogDelegate? { get set }
  • Undocumented

    Declaration

    Swift

    public let siteID: UInt32
  • Providee’s access to the SDK’s store functionality.

    Declaration

    Swift

    public var store: DittoStore { get }
  • Keeps track of whether or not the DittoKit instance has been activated via a successful call to setAccessLicense.

    Declaration

    Swift

    public var activated: Bool
  • Initializes a new DittoKit.

    Throws

    DittoKitError

    Declaration

    Swift

    public init(
        identity: DittoIdentity = .development(),
        persistenceDirectory directory: URL? = nil,
        dbConfig: DittoDBConfig = DittoDBConfig()
    ) throws

    Parameters

    identity

    Provide the identity of the entity that is interacting with DittoKit.

    persistenceDirectory

    The directory that will be used to persist DittoKit data.

    dbConfig

    Optional configuration to pass to the underlying storage backend.

  • Activate a DittoKit instance by setting an access license. You cannot interact with DittoKit before you have activated it.

    Declaration

    Swift

    public func setAccessLicense(_ license: String)

    Parameters

    license

    The license to activate the DittoKit instance with.

  • Start a set of transports being used by DittoKit to connect to other devices. This has no effect if a provided transport is already started.

    Declaration

    Swift

    public func start(transports: Set<DittoTransports> = [.wifi, .bluetooth, .awdl])

    Parameters

    transports

    The set of transports to be started.

  • Stop a set of transports from being used by DittoKit to connect to other devices.

    Declaration

    Swift

    public func stop(transports: Set<DittoTransports> = [.wifi, .bluetooth, .awdl])

    Parameters

    transports

    The set of transports to be stopped.

  • Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes.

    Throws

    DittoKitError

    Declaration

    Swift

    public func transportDiagnostics() throws -> DittoTransportDiagnostics

    Return Value

    An instance of DittoTransportDiagnostics.

  • Clears the cached site ID, if one had been cached.

    Throws

    DittoKitError

    Declaration

    Swift

    public func clearSiteID() throws