FWMulticastDelegate

@interface FWMulticastDelegate<__covariant T> : NSObject

多代理转发类

  • 是否是空,不包含delegate

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isEmpty;
  • 初始化,是否强引用delegate,默认NO

    Declaration

    Objective-C

    - (nonnull instancetype)initWithStrongReferences:(BOOL)strongReferences;
  • 初始化,自定义引用选项

    Declaration

    Objective-C

    - (nonnull instancetype)initWithOptions:(NSPointerFunctionsOptions)options;
  • 添加delegate

    Declaration

    Objective-C

    - (void)addDelegate:(nonnull T)delegate;
  • 移除delegate

    Declaration

    Objective-C

    - (void)removeDelegate:(nonnull T)delegate;
  • 移除所有delegate

    Declaration

    Objective-C

    - (void)removeAllDelegates;
  • 是否包含delegate

    Declaration

    Objective-C

    - (BOOL)containsDelegate:(nonnull T)delegate;
  • 调用所有delegates方法,忽略返回结果

    Declaration

    Objective-C

    - (void)invokeDelegates:(nonnull void (^)(T _Nonnull))block;
  • 过滤并调用delegates代理方法,返回是否调用成功,调用成功时立即停止

    Declaration

    Objective-C

    - (BOOL)filterDelegates:(nonnull BOOL (^)(T _Nonnull))filter;