单军华
2018-07-11 7b02207537d35bfa1714bf8beafc921f717d100a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
//  UIImage+Resource.m
//  Pods
//
//  Created by EaseMob on 2017/4/20.
//
//
 
#import "UIImage+Resource.h"
 
#import "EaseUserModel.h"
 
@implementation UIImage (Resource)
 
+ (UIImage*)easeImageNamed:(NSString *)name
{
    if ([name rangeOfString:@"EaseUIResource.bundle"].location != NSNotFound) {
        name = [name stringByReplacingOccurrencesOfString:@"EaseUIResource.bundle/" withString:@""];
    }
    NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[EaseUserModel class]] pathForResource:@"EaseUIResource" ofType:@"bundle"]];
    return [UIImage imageWithContentsOfFile:[bundle pathForResource:[NSString stringWithFormat:@"%@@2x",name] ofType:@"png"]];
}
 
@end