LiveQuery

public class LiveQuery

A LiveQuery automatically observes database changes and re-run the query that the LiveQuery object is created from. If there is a new query result or an error occurred, the LiveQuery object will report the changed result via the added listener blocks.

  • Undocumented

    Declaration

    Swift

    public class LiveQuery
  • Starts observing database changes and reports changes in the query result.

    Declaration

    Swift

    public func run()
  • Stops observing database changes.

    Declaration

    Swift

    public func stop()
  • Adds a query change listener block. @param block The block to be executed when the change is received. @return An opaque object to act as the listener and for removing the listener when calling the removeChangeListener() method.

    Declaration

    Swift

    public func addChangeListener(_ block: @escaping (LiveQueryChange) -> Void) -> NSObjectProtocol
  • Removes a change listener. The given change listener is the opaque object returned by the addChangeListener() method. @param listener The listener object to be removed.

    Declaration

    Swift

    public func removeChangeListener(_ listener: NSObjectProtocol)