1、资源文件引用的方式
CocoaPods 两种资源文件引用的方式——resource_bundles & resources
1-1、resource_bundles
resource_bundles 允许定义当前 Pod 库的资源包的名称和文件。用 hash 的形式来声明,key 是 bundle 的名称,value 是需要包括的文件的通配 patterns。
We strongly recommend library developers to adopt resource bundles as there can be name collisions using the resources attribute.
CocoaPods 官方强烈推荐使用 resource_bundles,因为用 key-value 可以避免相同名称资源的名称冲突。
同时建议 bundle 的名称至少应该包括 Pod 库的名称,可以尽量减少同名冲突
Examples:
ss.resource_bundles = { 'KZWUI' => 'KZWUtils/Assets/*.xcassets' }
1-2、 resources
使用 resources 来指定资源,被指定的资源只会简单的被 copy 到目标工程中(主工程)。
We strongly recommend library developers to adopt resource bundles as there can be name collisions using the resources attribute. Moreover, resources specified with this attribute are copied