#import "UIImage+AddImageFunc.h"
#import <objc/runtime.h>
@implementation UIImage (AddImageFunc)
+ (void)load {
Method methodOfOrigin = class_getClassMethod(self, @selector(imageNamed:));
Method methodOfCurrent= class_getClassMethod(self, @selector(custom_imageNamed:));
method_exchangeImplementations(methodOfOrigin, methodOfCurrent);
}
+ (UIImage *)custom_imageNamed:(NSString *)name {
if (name.length == 0) {
name = @"1";
}
UIImage * image = [self custom_imageNamed:name];
return image;
return nil;
}
@end