steipete / Aspects

Delightful, simple library for aspect oriented programming in Objective-C and Swift.

Home Page:https://twitter.com/steipete

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aspects how to hook instance method for all concrete class instances?

dehengxu opened this issue · comments

Aspects how to hook instance method for all concrete class instances?

If I’m not mistaking that’s method-swizzling, not isa-swizzling. Aspects is about isa-swizzling AFAIK, not method-swizzling.

commented

try to use like

[UIViewController aspect_hookSelector:@selector(viewWillLayoutSubviews) withOptions:0 usingBlock:^{
    NSLog(@"Controller is layouting!");
} error:NULL];