美文网首页
私有Pod库图片资源整理

私有Pod库图片资源整理

作者: Larry萝卜 | 来源:发表于2019-03-11 21:06 被阅读0次

https://mp.weixin.qq.com/s?__biz=MzA5NzMwODI0MA==&mid=2647759665&idx=1&sn=4b1f2fde434f1b45ff3eac627a7b7fd9

https://www.jianshu.com/p/57b9e678f5a8

http://www.itboth.com/d/AbEBJb/xcode

UIImage *img = [self getImageWithBoudleName:@"AAA" imgName:@"图片名称"];

- (UIImage *)getImageWithBoudleName:(NSString *)boudleName imgName:(NSString *)imgName {
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [bundle URLForResource:boudleName withExtension:@"bundle"];
NSBundle *targetBundle = [NSBundle bundleWithURL:url];
UIImage *image = [UIImage imageNamed:imgName
                            inBundle:targetBundle
       compatibleWithTraitCollection:nil];
return image;
}

使用 pod lib create 创建库

https://www.jianshu.com/p/7ccc6e6bd5f7

相关文章

网友评论

      本文标题:私有Pod库图片资源整理

      本文链接:https://www.haomeiwen.com/subject/mkyipqtx.html