Observable
public protocol Observable
Observable
is an interface for a container of observers.
It allows sending notifications on certain events to all of the added observers.
We provide the implementation of this protocol: TomTomSDKCommon/ObservableHandler
.
-
Notify observers about some specific event.
Declaration
Swift
func notifyObservers(notificationAction: @escaping (Observer) -> ())
Parameters
notificationAction
Use the closure to define what event every observer will receive. This method applies the
notificationAction
closure to every added observer. -
Notify observers about some specific event.
Declaration
Swift
func notifyObservers(notificationAction: @escaping (Observer) -> (), completion: (() -> ())?)
Parameters
notificationAction
Use the closure to define what event every observer will receive. This method applies the
notificationAction
closure to every added observer.completion
Called when the
notificationAction
closure is applied to all the added observers.