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.
-
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 result change listener block. @param block a change listener block @return the opaque listener object used for removing the added change listener block.
Declaration
Swift
public func addChangeListener(_ block: @escaping (LiveQueryChange) -> Void) -> NSObjectProtocol
-
Removed a change listener. @param listener a listener object received when adding the change listener block.
Declaration
Swift
public func removeChangeListener(_ listener: NSObjectProtocol)