D And replace with `method_setImplementation` void _replacement_Method(id self, SEL _cmd) { NSLog(@"swizzed foo method”); ((void(*)(id,SEL))__original_Method_Imp)(self, _cmd); } static IMP __original_Method_Imp; @implementation InheritedBare + (void)swizzle { Method m = class_getInstanceMethod( [self class], @selector(foo)); __original_Method_Imp = method_setImplementation( m, (IMP)_replacement_Method ); } @end