-
Listen to multiple occurrences of a Map event.
Declaration
Swift
@discardableResult func onEvery(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> CancelableParameters
eventTypeThe event type to listen to.
handlerThe closure to execute when the event occurs.
Return Value
A
Cancelableobject that you can use to stop listening for events. This is especially important if you have a retain cycle in the handler. -
Listen to a single occurrence of a Map event.
This will observe the next (and only the next) event of the specified type. After observation, the underlying subscriber will unsubscribe from the map or snapshotter.
If you need to unsubscribe before the event fires, call
cancel()on the returnedCancelableobject.Declaration
Swift
@discardableResult func onNext(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> CancelableParameters
eventTypeThe event type to listen to.
handlerThe closure to execute when the event occurs.
Return Value
A
Cancelableobject that you can use to stop listening for the event. This is especially important if you have a retain cycle in the handler.
MapEventsObservable Protocol Reference