類 MCDEvent
@interface MCDEvent<__covariant SourceType, __covariant ArgsType> : NSObject
此介面提供簡單的事件模型。 事件會產生 EventListeners 取用的專案。 事件專案的流程是由 MCDEventSubscription 所控制。
方法
訂閱
- (nonnull MCDEventSubscription*)subscribe:(nonnull void (^)(SourceType _Nonnull, ArgsType _Nonnull))listener;
訂閱連線裝置平臺中的指定事件。
參數
listener
接聽 MCDEventSubscriptions。
傳回
MCDEventSubscription 的實例。