DefaultDataProviderObservable
public final class DefaultDataProviderObservable : DataProviderObservable
A default implementation for a observable which notifies about data provider changes.
See also
DataProviderObservable
-
Creates a instance of the obsavable.
Declaration
Swift
public init()
-
Observe the changes of a data provider.
Can be use to animate changes in a TableView or in any other view hirachy.
Declaration
Swift
@discardableResult public func addObserver(observer: @escaping (DataProviderChange) -> Void) -> NSObjectProtocol
Parameters
observer
gets called when updates are available. If nil the DataProvider could not calculate the updates, but new data is available. Reload your view when this happens. To unregister call
removeObserver
Return Value
An opaque object to act as the observer.
-
Removes given observer from the receiver’s dispatch table.
Declaration
Swift
public func removeObserver(observer: NSObjectProtocol)
Parameters
observer
The observer to remove
-
Send updates from a data provider to all observers.
Declaration
Swift
public func send(updates: DataProviderChange)
Parameters
updates
the updates to distribute.