[英]How to include asset in a framework?
I want to add a new xcassets folder into my framework (there is already xcassets in this framework).我想在我的框架中添加一个新的 xcassets 文件夹(这个框架中已经有 xcassets)。
I have four targets:我有四个目标:
I checked the SDK target on the target membership view (when I'm on the xcassets folder).我在目标成员视图中检查了 SDK 目标(当我在 xcassets 文件夹中时)。 I add the xcassets folder in the build phase (like it was for the other).
我在构建阶段添加了 xcassets 文件夹(就像其他文件夹一样)。
Now, what I'm missing?现在,我缺少什么?
You need to include the assets in the Project's (not the SDK) Targets - BuildPhase - CopyBundleResources .您需要将资产包含在项目(而非 SDK)的Targets - BuildPhase - CopyBundleResources中。 I'm not quite sure but you probably need to make sure it has a unique name.
我不太确定,但您可能需要确保它有一个唯一的名称。 ie If the project has Assets.xcassets, name yours something else.
即,如果项目有 Assets.xcassets,请为您的项目命名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.