UserEventObserving
public protocol UserEventObserving : EventObserving
Implement this protocol in a class or struct when you want to observe and react to user events.
Conforming type should register themselve as observer in UserEventDispatcher
. When a user event occurs, the observing object will receive appropriate callbacks to handle the event.
Example Usage:
class UserEventObserver: UserEventObserving {
func userAdded(with onboardingID: UUID) {
// Handle User Added event
}
func userSwitched(with onboardingID: UUID) {
// Handle User Switch event
}
}
let observer = UserEventObserver()
UserEventDispatcher.shared.registerObserver(observer)
-
Delegate to get call back after user has been added
Declaration
Swift
func userAdded(with onboardingID: UUID)
-
Delegate to get call back after succesfully switched to a new user
Declaration
Swift
func userSwitched(to onboardingID: UUID)