RBEventCenter Class Reference

Inherits from NSObject
Declared in RBEventCenter.h

Overview

The global events center.

+ registerListener:forEvent:

Register an object as a listener for an event.

+ (void)registerListener:(nonnull id<RBEventListener>)listener forEvent:(nonnull NSString *)eventName

Parameters

listener

An object that implements RBEventListener.

eventName

The name of the event to be notified of.

Declared In

RBEventCenter.h

+ unregisterListener:forEvent:

Unregister an object as a listener for an event.

+ (void)unregisterListener:(nonnull id<RBEventListener>)listener forEvent:(nonnull NSString *)eventName

Parameters

listener

The currently registered listener for the event.

eventName

The name of the event to stop being notified of.

Declared In

RBEventCenter.h

+ unregisterListener:

Unregister an object as a listener for all events.

+ (void)unregisterListener:(nonnull id<RBEventListener>)listener

Parameters

listener

The currently registered listener for one or more events.

Declared In

RBEventCenter.h

+ raiseEventWithName:withSender:withData:handleSynchronously:completion:

Raise an event.

+ (void)raiseEventWithName:(nonnull NSString *)eventName withSender:(nullable id)sender withData:(nullable id)data handleSynchronously:(BOOL)handleSynchronously completion:(nullable dispatch_block_t)completion

Parameters

eventName

The name of the event to raise.

sender

The object that raised the event.

data

User data to provide to listeners of the event.

handleSynchronously

Whether the listeners will be informed synchronously (true) or simultaneously (false).

completion

The completion block to be called when the event has been handled.

Declared In

RBEventCenter.h