Skip to content

+load method in the category should be guarantee execute onlyonce #1

@robinli08

Description

@robinli08
  • (void)load
    {
    Method delegateOriginalMethod = class_getInstanceMethod([self class], @selector(setDelegate:));
    Method delegateSwizzledMethod = class_getInstanceMethod([self class], @selector(vi_setDelegate:));

    method_exchangeImplementations(delegateOriginalMethod, delegateSwizzledMethod);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions