1,创建bundle

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图1

2,命名bundle

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图2

3,添加相关的资源

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图3

4,5,6 修改 bundle 的相关设置,必须要

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图4
OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图5
OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图6

7,将 framework 和 bundle 联系起来

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图7

8,真机编译生成相应的文件

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图8

9,工程引用的方法

OC(二十)-自定义-Framework创建及使用(续)-打包图片 - 图9

注意:
引用图片的写法:

[tmpCancelBtn setBackgroundImage:[UIImage imageNamed:@”SToolsFrameworkBundle.bundle/line”] forState:UIControlStateNormal];

引用 xib的方法:

NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@”bundle名” ofType:@”bundle”]];
return [super initWithNibName:NSStringFromClass([self class]) bundle:bundle];