-
Adds the event listener of the given
EventType
.Remark
When attaching a listener on the wrong object the application will crash.
Declaration
Swift
func addEventListener<E>(type: EventType<E>, listener: @escaping (E) -> ()) -> EventListener where E : EventProtocol
Parameters
type
EventType
of the added event listener. SeeYospaceEventTypes
for possible values.listener
Closure called when event is dispatched.
Return Value
The newly added
EventListener
. -
Removes the event listener for the given
EventType
.Declaration
Swift
func removeEventListener<E>(type: EventType<E>, listener: EventListener) where E : EventProtocol
Parameters
type
EventType
of the event listener to be removed. SeeYospaceEventTypes
for possible values.listener
EventListener
which was added by
addEventListener(…)`.