OC Block的各种写法

作为局部变量


    returnType (^blockName)(parameterTypes) = ^returnType(parameters) { ... };

作为属性


    @property (nonatomic, copy, nullability) returnType (^blockName)(parameterTypes);

作为方法入参


    - (void)someMethodThatTakesABlock:(returnType (^nullability)(parameterTypes))blockName;

作为方法回调


    [someObject someMethodThatTakesABlock:^returnType (parameters) { ... }];

作为宏定义


    typedef returnType (^TypeName)(paramterTypes);
    TypeName blockName = ^returnType(paramters) { ... };

– 参考 fuckingblock