We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@implementation UIViewController (Swizzling) + (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ SEL originSelector = @selector(viewWillAppear:); SEL swizzleSelector = @selector(sw_viewWillAppear:); [self jr_swizzleMethod:originSelector withMethod:swizzleSelector error:nil]; }); } - (void)sw_viewWillAppear:(BOOL)animated { [self sw_viewWillAppear:animated]; NSLog(@"I'm swizzling method"); } @end
@implementation ViewController - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSLog(@"I'm origin method"); } @end
When calling [super viewWillAppear:animated], the log--I'm swizzling method print twice. if not, print once. So, whether or not to need call super?
[super viewWillAppear:animated]
I'm swizzling method
The text was updated successfully, but these errors were encountered:
How to fix this bug ?
Sorry, something went wrong.
No branches or pull requests
When calling
[super viewWillAppear:animated]
, the log--I'm swizzling method
print twice. if not, print once.So, whether or not to need call super?
The text was updated successfully, but these errors were encountered: