DittoLiveQueryEventObjC
@objc
public class DittoLiveQueryEventObjC : NSObject
An Objective-C compatible equivalent to DittoLiveQueryEvent
. It 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.
You can switch on the type
and then get the value of the event as the appropriate type using the relevant
function out of: asInitialEvent
, asUpdateEvent
, and asErrorEvent
.
-
The type of the live query event.
Declaration
Swift
@objc public let type: DittoLiveQueryEventTypeObjC
-
Get the live query event’s value as a
DittoLiveQueryInitialEvent
, if it is of that type.Declaration
Swift
@objc public func asInitialEvent() -> DittoLiveQueryInitialEvent?
Return Value
A
DittoLiveQueryInitialEvent
if the value is of that type, otherwisenil
. -
Get the live query event’s value as a
DittoLiveQueryUpdateEvent
, if it is of that type.Declaration
Swift
@objc public func asUpdateEvent() -> DittoLiveQueryUpdateEvent?
Return Value
A
DittoLiveQueryUpdateEvent
if the value is of that type, otherwisenil
. -
Get the live query event’s value as a
DittoLiveQueryErrorEvent
, if it is of that type.Declaration
Swift
@objc public func asErrorEvent() -> DittoLiveQueryErrorEvent?
Return Value
A
DittoLiveQueryErrorEvent
if the value is of that type, otherwisenil
.