DittoWriteTransactionResultObjC
@objc
public class DittoWriteTransactionResultObjC : NSObject
An Objective-C compatible equivalent to 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.
You can switch on the type
and then get the value of the result as the appropriate type using the relevant
function out of:
asInserted
asUpdated
asEvicted
asRemoved
-
The type of the update result.
Declaration
Swift
@objc public let type: DittoWriteTransactionResultTypeObjC
-
Get the update result’s value as a
DittoWriteTransactionResultInserted
, if it is of that type.Declaration
Swift
@objc public func asInserted() -> DittoWriteTransactionResultInserted?
Return Value
A
DittoWriteTransactionResultInserted
if the value is of that type, otherwisenil
. -
Get the update result’s value as a
DittoWriteTransactionResultUpdated
, if it is of that type.Declaration
Swift
@objc public func asUpdated() -> DittoWriteTransactionResultUpdated?
Return Value
A
DittoWriteTransactionResultUpdated
if the value is of that type, otherwisenil
. -
Get the update result’s value as a
DittoWriteTransactionResultEvicted
, if it is of that type.Declaration
Swift
@objc public func asEvicted() -> DittoWriteTransactionResultEvicted?
Return Value
A
DittoWriteTransactionResultEvicted
if the value is of that type, otherwisenil
. -
Get the update result’s value as a
DittoWriteTransactionResultRemoved
, if it is of that type.Declaration
Swift
@objc public func asRemoved() -> DittoWriteTransactionResultRemoved?
Return Value
A
DittoWriteTransactionResultRemoved
if the value is of that type, otherwisenil
.