CollectionChangeObservable
public protocol CollectionChangeObservable
The CollectionChangeObservable interface represents the object that can notify change events that occur to documents in collections.
-
Add a change listener to listen to change events occurring to any documents in the collection. To remove the listener, call remove() function on the returned listener token.
If the collection is deleted or the database is closed, a warning message will be logged.
Declaration
Swift
func addChangeListener(listener: @escaping (CollectionChange) -> Void) -> ListenerToken
-
Add a change listener to listen to change events occurring to any documents in the collection. If a dispatch queue is given, the events will be posted on the dispatch queue. To remove the listener, call remove() function on the returned listener token.
If the collection is deleted or the database is closed, a warning message will be logged.
Declaration
Swift
func addChangeListener(queue: DispatchQueue?, listener: @escaping (CollectionChange) -> Void) -> ListenerToken