Other Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITAWDLConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    
    - (instancetype)initWithDITAWDLConfig:(DITAWDLConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITAWDLConfig:(DITAWDLConfig *)config;
    
    @end
  • An address uniquely representing another device on the Ditto network.

    See more

    Declaration

    Objective-C

    @interface DITAddress : NSObject
  • A representation of the events that can occur in relation to an attachment fetch.

    There are three different attachment fetch events: Completed, Progress, or Deleted.

    There will be at most one Completed or Deleted event per attachment fetch. There can be many Progress events delivered for each attachment fetch.

    Updates relating to an attachment fetch are delivered by registering a DITAttachmentFetcher through a call to fetchAttachment on a DITCollection instance.

    See more

    Declaration

    Objective-C

    @interface DITAttachmentFetchEvent : NSObject
  • An attachment fetch event used when the attachment’s download has completed.

    See more

    Declaration

    Objective-C

    @interface DITAttachmentFetchEventCompleted : DITAttachmentFetchEvent
  • An attachment fetch event used when the attachment’s download progressed but is not yet complete.

    See more

    Declaration

    Objective-C

    @interface DITAttachmentFetchEventProgress : DITAttachmentFetchEvent
  • An attachment fetch event used when the attachment is deleted.

    Declaration

    Objective-C

    @interface DITAttachmentFetchEventDeleted : DITAttachmentFetchEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITAuthenticationRequest : NSObject
    
    @property (nonatomic, nullable, readonly) NSString *appId;
    @property (nonatomic, nullable, readonly) NSNumber *siteID;
    @property (nonatomic, nullable, readonly) NSString *thirdPartyToken;
    @property (nonatomic, nullable, readonly) NSString *tokenSource;
    @property (nonatomic, nullable, readonly) NSString *username;
    @property (nonatomic, nullable, readonly) NSString *password;
    
    - (void)allow:(DITAuthenticationSuccess *)success;
    - (void)deny;
    
    @end
  • Provides info about the authentication status.

    See more

    Declaration

    Objective-C

    @interface DITAuthenticationStatus : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITAuthenticationSuccess : NSObject
    
    @property (nonatomic, nullable, readwrite) NSString *userID;
    @property (nonatomic, readwrite) NSMutableDictionary<NSString *, NSString *> *userInfo;
    @property (nonatomic, readwrite) NSDate *accessExpires;
    @property (nonatomic, nullable, readwrite) NSDate *offerRefreshUntil;
    @property (nonatomic, readwrite) NSMutableArray<NSString *> *audiences;
    @property (nonatomic, readwrite) BOOL readEverythingPermission;
    @property (nonatomic, readwrite) BOOL writeEverythingPermission;
    
    @property (nonatomic, nullable, readwrite) NSMutableDictionary<NSString *, NSMutableArray<NSString *> *> *readPermissions;
    @property (nonatomic, nullable, readwrite) NSMutableDictionary<NSString *, NSMutableArray<NSString *> *> *writePermissions;
    
    - (void)addReadPermissionForCollection:(NSString *)coll queryString:(NSString *)query;
    - (void)addWritePermissionForCollection:(NSString *)coll queryString:(NSString *)query;
    
    @end
  • Provides access to authentication information and methods for logging on to Ditto Cloud. Relevant when using an OnlineWithAuthentication or an Online identity.

    See more

    Declaration

    Objective-C

    @interface DITAuthenticator : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITBluetoothLEConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    
    - (instancetype)initWithDITBluetoothLEConfig:(DITBluetoothLEConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITBluetoothLEConfig:(DITBluetoothLEConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITBus : NSObject
    
    @property (nonatomic, nullable) id<DITBusDelegate> delegate;
    @property (nonatomic) dispatch_queue_t delegateEventQueue;
    
    - (instancetype)init NS_UNAVAILABLE;
    - (instancetype)initWithDittoHandle:(_DITDittoHandleWrapper *)dittoHandleWrapper NS_DESIGNATED_INITIALIZER;
    - (void)sendMessageWithData:(NSData *)data toAddress:(DITAddress *)address;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITBusMessage : NSObject
    
    @property (nonatomic, strong, readonly) DITAddress *sender;
    @property (nonatomic, copy, readonly) NSData *data;
    
    - (instancetype)init NS_UNAVAILABLE;
    
    @end
  • Describes events delivered when observing collections in the store.

    Only the first event will have the isInitial BOOL set to true. The first event will return empty arrays for all values because there can’t be any modifications to the set of collections if it’s the first time event handler is being called.

    See more

    Declaration

    Objective-C

    @interface DITCollectionsEvent : NSObject
  • Specific servers that Ditto should attempt to connect to.

    TCP servers are specified as “host:port”. Websocket URLs take the form “wss://hydra.ditto.live”.

    Please refer to the documentation on Ditto’s website for configuring cloud or client/server scenarios.

    See more

    Declaration

    Objective-C

    @interface DITConnect : NSObject <NSCopying, NSMutableCopying> {
      NSSet<NSString *> *_tcpServers;
      NSSet<NSString *> *_websocketURLs;
    }
  • An identifier for a DITDocument.

    Each DITDocumentID represents a unique identifier for a document.

    See more

    Declaration

    Objective-C

    @interface DITDocumentID : NSObject <NSCopying>
  • 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 DITDocumentIDPath by subscripting a DITDocumentID and you can then further subscript a DITDocumentIDPath 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

    Objective-C

    @interface DITDocumentIDPath : NSObject
  • Upcoming SDK features made available for prototyping.

    Experimental functionality should not be used in production applications as it may be changed or removed at any time, and may not have the same security features.

    See more

    Declaration

    Objective-C

    @interface DITExperimental : NSObject
  • Settings not associated with any specific type of transport.

    See more

    Declaration

    Objective-C

    @interface DITGlobalConfig : NSObject {
      uint32_t _syncGroup;
    }
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITHTTPListenConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected NSString *_interfaceIp;
        @protected uint16_t _port;
        @protected NSString *_staticContentPath;
        @protected BOOL _websocketSync;
        @protected NSString *_tlsKeyPath;
        @protected NSString *_tlsCertificatePath;
        @protected BOOL _isIdentityProvider;
        @protected NSString *_identityProviderSigningKey;
        @protected NSArray<NSString *> *_identityProviderVerifyingKeys;
        @protected NSString *_caKey;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readonly) NSString *interfaceIp;
    /**
     Listening port. 80 by default.
     */
    @property (nonatomic, readonly) uint16_t port;
    /**
     An absolute path to a directory of static HTTP content that should be served by this device.
    
     If nil (default), this feature is disabled.
     */
    @property (nonatomic, readonly, nullable) NSString *staticContentPath;
    /**
     If YES (default), peers can connect over websocket to sync with this peer.
    
     This feature has security implications and should only be used together with documentation on Ditto's website.
     */
    @property (nonatomic, readonly) BOOL websocketSync;
    /**
     An absolute path to the PEM-formatted private key for HTTPS. Must be set together with tlsCertificatePath.
    
     If nil, the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readonly, nullable) NSString *tlsKeyPath;
    /**
     An absolute path to the PEM-formatted certificate for HTTPS. Must be set together with tlsKeyPath.
    
     If nil, the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readonly, nullable) NSString *tlsCertificatePath;
    /**
     Enable acting as a provider of Ditto identities.
     */
    @property (nonatomic, readonly) BOOL isIdentityProvider;
    /**
     PEM-encoded private key for signing tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readonly, nullable) NSString *identityProviderSigningKey;
    /**
     PEM-encoded public keys for verifying tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readonly, nullable) NSArray<NSString *> *identityProviderVerifyingKeys;
    /**
     PEM-encoded private key that should be used to issue certificates for clients in peer-to-peer mode.
     */
    @property (nonatomic, readonly, nullable) NSString *caKey;
    
    
    - (instancetype)initWithDITHTTPListenConfig:(DITHTTPListenConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
                        interfaceIp:(NSString *)interfaceIp
                               port:(uint16_t)port
                  staticContentPath:(NSString * __nullable)staticContentPath
                      websocketSync:(BOOL)websocketSync
                         tlsKeyPath:(NSString * __nullable)tlsKeyPath
                 tlsCertificatePath:(NSString * __nullable)tlsCertificatePath
                 isIdentityProvider:(BOOL)isIdentityProvider
         identityProviderSigningKey:(NSString * __nullable)identityProviderSigningKey
      identityProviderVerifyingKeys:(NSArray<NSString *> * __nullable)identityProviderVerifyingKeys
                              caKey:(NSString * __nullable)caKey NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITHTTPListenConfig:(DITHTTPListenConfig *)config;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITLANConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected BOOL _mDNSEnabled;
        @protected BOOL _multicastEnabled;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    @property (nonatomic, readonly, getter = ismDNSEnabled) BOOL mDNSEnabled;
    @property (nonatomic, readonly, getter = isMulticastEnabled) BOOL multicastEnabled;
    
    - (instancetype)initWithDITLANConfig:(DITLANConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
        mDNSEnabled:(BOOL)mDNSEnabled
        multicastEnabled:(BOOL)multicastEnabled NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITLANConfig:(DITLANConfig *)config;
    
    @end
  • Configure this device as a Ditto server. Disabled by default.

    This is advanced usage that is not needed in most situations. Please refer to the documentation on Ditto’s website for scenarios and example configurations.

    See more

    Declaration

    Objective-C

    @interface DITListen : NSObject <NSCopying, NSMutableCopying> {
      DITTCPListenConfig *_tcp;
      DITHTTPListenConfig *_http;
    }
  • Class with static methods to customize the logging behavior from Ditto.

    See more

    Declaration

    Objective-C

    @interface DITLogger : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableAWDLConfig : DITAWDLConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableBluetoothLEConfig : DITBluetoothLEConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableConnect : DITConnect
  • Settings not associated with any specific type of transport.

    See more

    Declaration

    Objective-C

    @interface DITMutableGlobalConfig : DITGlobalConfig
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableHTTPListenConfig : DITHTTPListenConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readwrite, copy) NSString *interfaceIp;
    /**
     Listening port. 80 by default.
     */
    @property (nonatomic, readwrite) uint16_t port;
    /**
     An absolute path to a directory of static HTTP content that should be served by this device.
    
     If nil (default), this feature is disabled.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *staticContentPath;
    /**
     If YES (default), peers can connect over websocket to sync with this peer.
    
     This feature has security implications and should only be used together with documentation on Ditto's website.
     */
    @property (nonatomic, readwrite) BOOL websocketSync;
    /**
     An absolute path to the PEM-formatted private key for HTTPS. Must be set together with tlsCertificatePath.
    
     If nil (default), the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *tlsKeyPath;
    /**
     An absolute path to the PEM-formatted certificate for HTTPS. Must be set together with tlsKeyPath.
    
     If nil (default), the server runs as unencrypted HTTP.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *tlsCertificatePath;
    /**
     Enable acting as a provider of Ditto identities.
     */
    @property (nonatomic, readwrite) BOOL isIdentityProvider;
    /**
     PEM-encoded private key for signing tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *identityProviderSigningKey;
    /**
     PEM-encoded public keys for verifying tokens and certificates when acting as an identity provider.
     */
    @property (nonatomic, readwrite, copy, nullable) NSArray<NSString *> *identityProviderVerifyingKeys;
    /**
     PEM-encoded private key that should be used to issue certificates for clients in peer-to-peer mode.
     */
    @property (nonatomic, readwrite, copy, nullable) NSString *caKey;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableLANConfig : DITLANConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    @property (nonatomic, readwrite, getter = ismDNSEnabled) BOOL mDNSEnabled;
    @property (nonatomic, readwrite, getter = isMulticastEnabled) BOOL multicastEnabled;
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableListen : DITListen
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutablePeerToPeer : DITPeerToPeer
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITMutableTCPListenConfig : DITTCPListenConfig
    
    @property (nonatomic, readwrite, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readwrite, copy) NSString *interfaceIp;
    /**
     Listening port. 4040 by default.
     */
    @property (nonatomic, readwrite) uint16_t port;
    
    @end
  • A configuration object specifying which network transports Ditto should use to sync data.

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

    When you initialize a DITMutableTransportConfig 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 YES.

    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

    Objective-C

    @interface DITMutableTransportConfig : DITTransportConfig
  • Configuration of peer-to-peer transports, which are able to discover and connect to peers on their own.

    For more information refer to the documentation for DITTransportConfig.

    See more

    Declaration

    Objective-C

    @interface DITPeerToPeer : NSObject <NSCopying, NSMutableCopying> {
      DITBluetoothLEConfig *_bluetoothLe;
      DITLANConfig *_lan;
      DITAWDLConfig *_awdl;
    }
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITPeerV2Parser : NSObject
    
    + (NSArray<DITRemotePeerV2 *> * __nullable)parseJSON:(NSString *)json;
    
    @end
  • A token returned by calling observePeersV2 on a DITDitto object.

    Retain this object to continue receiving callback updates.

    See more

    Declaration

    Objective-C

    @interface DITPeersObserverV2 : NSObject <DITObserver>
  • These objects are returned when calling collections on DITStore.

    They allow chaining of further collections-related functions. You can either call exec on the object to get an array of DITCollections as an immediate return value, or you can establish either a live query or a subscription, which both work over time.

    A live query, established by calling observe, will notify you every time there’s a change in the collections that the device knows about.

    A subscription, established by calling subscribe, will act as a signal to other peers that you would like to receive updates from them about the collections that they know about.

    Calling observe will generate both a subscription and a live query at the same time.

    If you’d like to only observe local changes then you can call observeLocal.

    If you want to observe changes in such a way that you can signal when you’re ready for the live query to deliver a new update then you can call observeWithNextSignal or observeLocalWithNextSignal.

    See more

    Declaration

    Objective-C

    @interface DITPendingCollectionsOperation : NSObject
  • Represents a remote peer in the Ditto network.

    See more

    Declaration

    Objective-C

    @interface DITRemotePeerV2 : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface DITTCPListenConfig : NSObject<NSCopying, NSMutableCopying> {
        @protected BOOL _enabled;
        @protected NSString *_interfaceIp;
        @protected uint16_t _port;
    }
    
    @property (nonatomic, readonly, getter = isEnabled) BOOL enabled;
    /**
     IP interface to bind to. [::] by default.
     */
    @property (nonatomic, readonly) NSString *interfaceIp;
    /**
     Listening port. 4040 by default.
     */
    @property (nonatomic, readonly) uint16_t port;
    
    - (instancetype)initWithDITTCPListenConfig:(DITTCPListenConfig *)config;
    - (instancetype)initWithEnabled:(BOOL)enabled
                        interfaceIp:(NSString *)interfaceIp
                               port:(uint16_t)port NS_DESIGNATED_INITIALIZER;
    
    - (BOOL)isEqualToDITTCPListenConfig:(DITTCPListenConfig *)config;
    
    @end
  • A configuration object specifying which network transports Ditto should use to sync data.

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

    When you initialize a DITMutableTransportConfig 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 YES.

    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

    Objective-C

    @interface DITTransportConfig : NSObject <NSCopying, NSMutableCopying> {
      DITPeerToPeer *_peerToPeer;
      DITConnect *_connect;
      DITListen *_listen;
      DITGlobalConfig *_global;
    }
  • An update result when the update result’s type is set.

    See more

    Declaration

    Objective-C

    @interface DITUpdateResultSet : DITUpdateResult
  • An update result when the update result’s type is removed.

    Declaration

    Objective-C

    @interface DITUpdateResultRemoved : DITUpdateResult
  • An update result when the update result’s type is replacedWithCounter.

    Declaration

    Objective-C

    @interface DITUpdateResultReplacedWithCounter : DITUpdateResult
  • An update result when the update result’s type is incremented.

    See more

    Declaration

    Objective-C

    @interface DITUpdateResultIncremented : DITUpdateResult
  • An update result when the update result’s type is pushed.

    See more

    Declaration

    Objective-C

    @interface DITUpdateResultPushed : DITUpdateResult
  • An update result when the update result’s type is popped.

    See more

    Declaration

    Objective-C

    @interface DITUpdateResultPopped : DITUpdateResult
  • An update result when the update result’s type is inserted.

    See more

    Declaration

    Objective-C

    @interface DITUpdateResultInserted : DITUpdateResult
  • Represents the write transaction result that will be the value of a DittoWriteTransactionResult when its type is inserted and asInserted is called on it.

    Declaration

    Objective-C

    @interface DITWriteTransactionResultInserted : DITWriteTransactionResult
  • Represents the write transaction result that will be the value of a DittoWriteTransactionResult when its type is removed and asRemoved is called on it.

    Declaration

    Objective-C

    @interface DITWriteTransactionResultRemoved : DITWriteTransactionResult
  • Represents the write transaction result that will be the value of a DittoWriteTransactionResult when its type is evicted and asEvicted is called on it.

    Declaration

    Objective-C

    @interface DITWriteTransactionResultEvicted : DITWriteTransactionResult
  • Represents the write transaction result that will be the value of a DittoWriteTransactionResult when its type is updated and asUpdated is called on it.

    Declaration

    Objective-C

    @interface DITWriteTransactionResultUpdated : DITWriteTransactionResult