FWBlockProxy


@interface FWBlockProxy : NSObject

Block代理

  • 只读block

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) id _Nonnull block;
  • block签名

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSMethodSignature *_Nonnull methodSignature;
  • 解析block签名

    Declaration

    Objective-C

    + (nullable NSMethodSignature *)methodSignatureForBlock:(nonnull id)block;

    Parameters

    block

    block代码

    Return Value

    方法签名

  • 初始化代理

    Declaration

    Objective-C

    - (nonnull instancetype)initWithBlock:(nonnull id)block;

    Parameters

    block

    代理block

    Return Value

    代理对象

  • 初始化代理

    Declaration

    Objective-C

    + (nonnull instancetype)proxyWithBlock:(nonnull id)block;

    Parameters

    block

    代理block

    Return Value

    代理对象

  • 指定invocation调用block,并设置返回值

    Declaration

    Objective-C

    - (BOOL)invokeWithInvocation:(nonnull NSInvocation *)invocation
                     returnValue:(out NSValue *_Nullable *_Nonnull)returnValue;

    Parameters

    invocation

    调用对象

    returnValue

    返回值

    Return Value

    是否调用成功

  • 指定invocation调用block,并设置返回值

    Declaration

    Objective-C

    - (void)invokeWithInvocation:(nonnull NSInvocation *)invocation;

    Parameters

    invocation

    调用对象