#import <objc/runtime.h>
Method method1 = class_getInstanceMethod([self class],@selector(didAddSubview:));
Method method2 = class_getInstanceMethod([self class], @selector(didModifyRange:));
method_exchangeImplementations(method1, method2);
#import <objc/runtime.h>
Method method1 = class_getInstanceMethod([self class],@selector(didAddSubview:));
Method method2 = class_getInstanceMethod([self class], @selector(didModifyRange:));
method_exchangeImplementations(method1, method2);