Enumerations
The following enumerations are available globally.
-
The various identity configurations that you can use when initializing a
DittoKit
instance.- development: An identity to be used while in development when you want to control either or both of the app name and the site ID of the peer.
- production: The identity to use when in production. This accepts a certificate bundle, which includes identity information, as a base 64 encoded string.
Declaration
Swift
public enum DittoIdentity
-
All errors that are thrown by the DittoKit SDK are wrapped as a
DittoKitError
. It wraps multiple different types of error that each have an associated reason.You can access more specific information about an error by switching over the error’s
reason
value. If you want a human-readable version of the error then calllocalizedDescription
on the error’s reason.- storeError: An error occurred relating to the store.
- transportError: An error occurred relating to the network transports.
- identityError: An error occurred relating to the identity.
Declaration
Swift
public enum DittoKitError : Error
-
Enum that maps to an appropiate prefix for a log message.
See moreDeclaration
Swift
@objc public enum DittoLogLevel : Int
-
This enumeration lists the transports that DittoKit can use to connect to other devices.
- wifi: Wi-Fi.
- bluetooth: Bluetooth.
- awdl: AWDL (Apple Wireless Direct Link).
Declaration
Swift
@objc public enum DittoTransport : Int, CaseIterable
-
Undocumented
See moreDeclaration
Swift
@objc public enum DittoTransportCondition : UInt32, CustomStringConvertible
-
Describes the different types of event that you can receive when dealing with live queries.
- initial: The first event that will be delivered and it will only be delivered once.
- update: This event will be delivered each time the results of the provided query change. It contains information about the set of documents that previously matched the query before the update, along with information about what documents have been inserted, deleted, updated, or moved, as part of the set of matching documents.
- error: This event will be delivered if there’s an error in relation to a live query.
Declaration
Swift
public enum DittoLiveQueryEvent
-
Describes the different types of event that you can receive when dealing with live queries.
- initial: The first event that will be delivered and it will only be delivered once.
- update: This event will be delivered each time the results of the provided query change. It contains information about the set of documents that previously matched the query before the update, along with information about what documents have been inserted, deleted, updated, or moved, as part of the set of matching documents.
- error: This event will be delivered if there’s an error in relation to a live query.
Declaration
Swift
@objc public enum DittoLiveQueryEventTypeObjC : Int
-
Describes the result of an update operation performed on a
DittoMutableDocument
.- set: Describes the
set
update that was performed. - removed: Describes the
remove
update that was performed. - replacedWithCounter: Describes the
replaceWithCounter
update that was performed. - incremented: Describes the
increment
update that was performed. - replacedText: Describes the
replaceText
update that was performed. - pushed: Describes the
push
update that was performed. - popped: Describes the
pop
update that was performed.
Declaration
Swift
public enum DittoUpdateResult
- set: Describes the
-
Describes the result of an update operation performed on a
DittoMutableDocument
.- set: Describes the
set
update that was performed. - removed: Describes the
remove
update that was performed. - replacedWithCounter: Describes the
replaceWithCounter
update that was performed. - incremented: Describes the
increment
update that was performed. - replacedText: Describes the
replaceText
update that was performed. - pushed: Describes the
push
update that was performed. - popped: Describes the
pop
update that was performed.
Declaration
Swift
@objc public enum DittoUpdateResultTypeObjC : Int
- set: Describes the
-
Describes one part of the result of a write transaction.
- inserted: Describes a document that has been inserted, referencing its ID and the collection it was inserted into.
- updated: Describes a document that has been updated, referencing its ID and the collection it belongs to.
- evicted: Describes a document that has been evicted, referencing its ID and the collection it belonged to.
- removed: Describes a document that has been removed, referencing its ID and the collection it belonged to.
Declaration
Swift
public enum DittoWriteTransactionResult
-
Describes the result of a write transaction operation.
- inserted: Describes a document that has been inserted, referencing its ID and the collection it was inserted into.
- updated: Describes a document that has been updated, referencing its ID and the collection it belongs to.
- evicted: Describes a document that has been evicted, referencing its ID and the collection it belonged to.
- removed: Describes a document that has been removed, referencing its ID and the collection it belonged to.
Declaration
Swift
@objc public enum DittoWriteTransactionResultTypeObjC : Int