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) -> NSObjectProtocolParameters
observergets 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
removeObserverReturn 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
observerThe observer to remove
-
Send updates from a data provider to all observers.
Declaration
Swift
public func send(updates: DataProviderChange)Parameters
updatesthe updates to distribute.
View on GitHub
DefaultDataProviderObservable Class Reference