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

All superclasses get marked as having a subclass that is modified.

mislsl opened this issue · comments

// Add the selector as being modified.
currentClass = klass;
AspectTracker *parentTracker = nil;
do {
AspectTracker *tracker = swizzledClassesDict[currentClass];
if (!tracker) {
tracker = [[AspectTracker alloc] initWithTrackedClass:currentClass parent:parentTracker];
swizzledClassesDict[(id)currentClass] = tracker;
}
[tracker.selectorNames addObject:selectorName];
// All superclasses get marked as having a subclass that is modified.
parentTracker = tracker;
}while ((currentClass = class_getSuperclass(currentClass)));

Please tell me why I do it.

AController:UIViewController

  • (void)buttonClick;

BController:UIViewController

  • (void)buttonClick;

AController aspect: buttonClick

BCotroller aspect: buttonClick
exception: Error: buttonClick already hooked in UIViewController