第一步:创建静态库工程
![](https://img.haomeiwen.com/i1664406/e0740c2a45f651be.png)
第二步:所需要的文件放在这里
![](https://img.haomeiwen.com/i1664406/09579689496ec1ce.png)
第三步:创建bundle,new-tagert
![](https://img.haomeiwen.com/i1664406/e95854271e47b68d.png)
第四步:生成好了bundle,注意选择ios
![](https://img.haomeiwen.com/i1664406/bb497dc523e363fa.png)
第五步:文件中使用 bundle 里面的资源
NSString*strResourcesBundle = [[NSBundle mainBundle]pathForResource:@"Source"ofType:@"bundle"];
UIImage * normalImage = [UIImage imageNamed:@"noNetworkAletIcon" inBundle:[NSBundle bundleWithPath:strResourcesBundle] compatibleWithTraitCollection:nil];
NSBundle *bundle = [NSBundle bundleForClass:[SVProgressHUD class]];
NSURL*url = [bundle URLForResource:@"SVProgressHUD"withExtension:@"bundle"];
NSBundle*imageBundle = [NSBundle bundleWithURL:url];
UIImage* infoImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"info" ofType:@"png"]];
第六步:打包
网友评论