UserEventDispatcher
public class UserEventDispatcher : EventDispatching
A class to dispatch the user events to store observers of type UserEventObserving. It also provides the capability to add and remove observers. These registered observers will receive notifications for user-related events, including user added and user switch.
-
The Singleton instance of the
UserEventDispatcherclass.Declaration
Swift
public static var shared: UserEventDispatcher -
Array of registered observers which are the type of
UserEventObservingDeclaration
Swift
public var registeredObservers: [UserEventObserving] { get } -
Registers an observer. This Observer will get the User Event notifications. The dispatch method call order depends on the registration order.
Declaration
Swift
public func registerObserver(_ observer: EventObserving) -
Unregisters the observer. It will remove the observer from the registered observers list and so it will stop getting the notifications of User Events.
Declaration
Swift
public func unregisterObserver(_ observer: EventObserving) -
Dispatches the User Added event to all the register observers.
Declaration
Swift
public func userAdded(with onboardingID: UUID) -
Dispatches the User Switched event to all the register observers.
Declaration
Swift
public func userSwitched(to onboardingID: UUID)