拦截方法并替换成自己的方法
Posted 泡菜2015
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了拦截方法并替换成自己的方法相关的知识,希望对你有一定的参考价值。
#import <objc/runtime.h>
Method method1 = class_getInstanceMethod([self class],@selector(didAddSubview:));
Method method2 = class_getInstanceMethod([self class], @selector(didModifyRange:));
method_exchangeImplementations(method1, method2);
以上是关于拦截方法并替换成自己的方法的主要内容,如果未能解决你的问题,请参考以下文章
拦截器getmodel方法什么时候被调用(没搞懂有什么鸟用,自己搭的项目中用到了这个)