赞
踩
+ (NSString *)sdkPodsBundlePath {
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *bundlePath = [bundle pathForResource:kSDKName ofType:@"bundle"];
return bundlePath;
}
+ (NSBundle *)sdkBundle {
NSString *sdkPodsBundlePath = [QSGetResourceTool sdkPodsBundlePath];
NSBundle *bd = nil;
// SDK 自己使用时
if (sdkPodsBundlePath) {
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *bundlePath = [bundle pathForResource:kSDKName ofType:@"bundle"];
NSBundle *bd = [NSBundle bundleWithPath:bundlePath];
} else {
bd = [NSBundle bundleForClass:[self class]];
}
return bd;
}
// 读取framework下的图片资源
+ (UIImage *)qs_imageSDKNamed:(NSString *)name {
NSBundle *bd = [QSGetResourceTool sdkBundle];
UIImage *image = [UIImage imageNamed:name inBundle:bd compatibleWithTraitCollection:nil];
return image;
}
UIImage * image = [UIImage qs_imageSDKNamed:@"xxx"];
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。