EventDispatcher
@available(*, deprecated, message: "This class will be removed with the next major release.")
public class EventDispatcher : NSObject, EventDispatcherProtocol
Represents an EventDispatcher which will be responsible for dispatching an event, once it occurs.
-
Adds an
EventListenerfor a particular type of event to the player.Declaration
Swift
public func addEventListener<E>(type: EventType<E>, listener: @escaping (E) -> ()) -> EventListener where E : EventProtocolParameters
typeThe
EventTypeto listen for.listenerThe closure to be called when the event occurs.
-
Removes an
EventListenerfor a particular type of event of the player.Declaration
Swift
public func removeEventListener<E>(type: EventType<E>, listener: EventListener) where E : EventProtocolParameters
typeThe
EventTypeto be removed.listenerThe closure to be called when the event occurs.
EventDispatcher Class Reference