ARTEventEmitter
Objective-C
@interface ARTEventEmitter<EventType : id <ARTEventIdentification>, ItemType>
    : NSObjectSwift
class ARTEventEmitter<EventType, ItemType> : NSObject, @unchecked Sendable where EventType : ARTEventIdentification, ItemType : AnyObjectA generic interface for event registration and delivery used in a number of the types in the Realtime client library. For example, the ARTConnection and ARTRealtimeChannel objects emit events for their state using the ARTEventEmitter pattern.
- 
                  
                  Registers the provided listener for the specified event. If on:callback:is called more than once with the same listener and event, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice usingon:callback:, and an event is emitted once, the listener would be invoked twice.DeclarationObjective-C - (nonnull ARTEventListener *)on:(nonnull EventType)event callback:(nonnull void (^)(ItemType _Nonnull))callback;Swift func on(_ event: EventType, callback: @escaping (ItemType) -> Void) -> ARTEventListenerParameterseventThe named event to listen for. callbackA callback invoked upon eventwith anItemTypeobject, f.e.ARTConnectionStateChange.Return ValueThe event listener. 
- 
                  
                  Registers the provided listener all events. If on:is called more than once with the same listener and event, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice usingon:, and an event is emitted once, the listener would be invoked twice.DeclarationObjective-C - (nonnull ARTEventListener *)on:(nonnull void (^)(ItemType _Nonnull))callback;Swift func on(_ callback: @escaping (ItemType) -> Void) -> ARTEventListenerParameterscallbackA callback invoked upon any event with an ItemTypeobject, f.e.ARTConnectionStateChange.Return ValueThe event listener. 
- 
                  
                  Registers the provided listener for the first occurrence of a single named event specified as the eventargument. Ifonce:callback:is called more than once with the same listener, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice usingonce:callback:, and an event is emitted once, the listener would be invoked twice. However, all subsequent events emitted would not invoke the listener asonce:callback:ensures that each registration is only invoked once.DeclarationObjective-C - (nonnull ARTEventListener *)once:(nonnull EventType)event callback: (nonnull void (^)(ItemType _Nonnull))callback;Swift func once(_ event: EventType, callback: @escaping (ItemType) -> Void) -> ARTEventListenerParameterseventThe named event to listen for. callbackA callback invoked upon eventwith anItemTypeobject, f.e.ARTConnectionStateChange.Return ValueThe event listener. 
- 
                  
                  Registers the provided listener for the first event that is emitted. If once:is called more than once with the same listener, the listener is added multiple times to its listener registry. Therefore, as an example, assuming the same listener is registered twice usingonce:, and an event is emitted once, the listener would be invoked twice. However, all subsequent events emitted would not invoke the listener asonce:ensures that each registration is only invoked once.DeclarationObjective-C - (nonnull ARTEventListener *)once: (nonnull void (^)(ItemType _Nonnull))callback;Swift func once(_ callback: @escaping (ItemType) -> Void) -> ARTEventListenerParameterscallbackA callback invoked upon any event with an ItemTypeobject, f.e.ARTConnectionStateChange.Return ValueThe event listener. 
- 
                  
                  Removes all registrations that match both the specified listener and the specified event. DeclarationObjective-C - (void)off:(nonnull EventType)event listener:(nonnull ARTEventListener *)listener;Swift func off(_ event: EventType, listener: ARTEventListener)ParameterseventThe named event. listenerThe event listener. 
- 
                  
                  Deregisters the specified listener. Removes all registrations matching the given listener, regardless of whether they are associated with an event or not. DeclarationObjective-C - (void)off:(nonnull ARTEventListener *)listener;Swift func off(_ listener: ARTEventListener)ParameterslistenerThe event listener. 
- 
                  
                  Deregisters all registrations, for all events and listeners. DeclarationObjective-C - (void)off;Swift func off()
- 
                  
                  Emits an event, calling registered listeners with the given event name and any other given arguments. If an exception is raised in any of the listeners, the exception is caught by the ARTEventEmitterand the exception is logged to the Ably logger. This method is internal and should not be called manually.DeclarationObjective-C - (void)emit:(nullable EventType)event with:(nullable ItemType)data;Swift func emit(_ event: EventType?, with data: ItemType?)ParameterseventThe named event. dataThe event payload. 
- 
                  
                  Undocumented DeclarationObjective-C @property (nonatomic, readonly) NSNotificationCenter *notificationCenterSwift var notificationCenter: NotificationCenter { get }
- 
                  
                  Undocumented DeclarationObjective-C @property (nonatomic, readonly) dispatch_queue_t queueSwift var queue: dispatch_queue_t { get }
- 
                  
                  Undocumented DeclarationObjective-C @property (nullable, nonatomic, readonly) dispatch_queue_t userQueueSwift var userQueue: dispatch_queue_t? { get }
- 
                  
                  Undocumented DeclarationObjective-C @property (readonly) NSMutableDictionary<NSString *, NSMutableArray<ARTEventListener *> *> *listenersSwift var listeners: NSMutableDictionary { get }
- 
                  
                  Undocumented DeclarationObjective-C @property (readonly) NSMutableArray<ARTEventListener *> *anyListenersSwift var anyListeners: NSMutableArray { get }
