Latest 1.0.0
Homepage https://github.com/chuqingr/HookBlock
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Instructions

照搬 https://github.com/ebf/CTObjectiveCRuntimeAdditions ,方便使用,弄了个pods.

Installation

HookBlock is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'HookBlock'

Use

#import <CTBlockDescription.h>

// a test block.
BOOL(^testBlock)(BOOL animated, id object,NSURLRequest *str,int i) = ^BOOL(BOOL animated, id object,NSURLRequest *req,int i) {
    return YES;
};

// allocating a block description
CTBlockDescription *blockDescription = [[CTBlockDescription alloc] initWithBlock:testBlock];

NSMethodSignature *methodSignature = blockDescription.blockSignature;

for (int i = 0; i < methodSignature.numberOfArguments; i ++) {
    const char *argu = [methodSignature getArgumentTypeAtIndex:i];
    NSLog(@"第%d个参数是:%s",i,argu);
}

2019-02-14 15:19:56.654417+0800 HookBlock_Example[42387:1059962] 第0个参数是:@?
2019-02-14 15:19:56.654667+0800 HookBlock_Example[42387:1059962] 第1个参数是:B
2019-02-14 15:19:56.654805+0800 HookBlock_Example[42387:1059962] 第2个参数是:@
2019-02-14 15:19:56.654930+0800 HookBlock_Example[42387:1059962] 第3个参数是:@"NSURLRequest"
2019-02-14 15:19:56.655052+0800 HookBlock_Example[42387:1059962] 第4个参数是:i

Author

杨胜浩, [email protected]

License

HookBlock is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HookBlock",
    "version": "1.0.0",
    "summary": "u7167u642c https://github.com/ebf/CTObjectiveCRuntimeAdditions uff0cu65b9u4fbfu4f7fu7528uff0cu5f04u4e86u4e2apods",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/chuqingr/HookBlock",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u6768u80dcu6d69": "[email protected]"
    },
    "source": {
        "git": "https://github.com/chuqingr/HookBlock.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "HookBlock/Classes/**/*"
}

Pin It on Pinterest

Share This