如何在 UIImageView 的界面生成器上使用图像等 pod 资源?

How do I use pod resources like an image on the interface builder in an UIImageView?

我想做的是在 Xcode Interface Builder 上使用 pod 中的图像资源。例如,在安装 pod 之后,用户可以使用 pod 中的图像填充 UIImageView。为了节省 space,我将所有图像存储在 .xcassets 中。

我尝试更改我的 podspec,它工作正常但没有将资产复制到主包中。我研究了改变构建阶段,但我没有找到任何关于如何将包从 pod 添加到主包的信息。我可以通过代码访问图像并显示它们。

我的 XCode 错误是:

framework] CUIThemeStore: No theme registered with id=0
Could not load the "Image_In_Pod_Bundle" image referenced from a nib in the bundle with identifier "Company.ProjectName"`

这一定是可行的,因为我可以在 UIImageView 上看到图像并添加它们,但是当我在 emulator/device 上编译时,它不会加载图像,因为它不在主包中仍然。我还没有找到将它指向 pod 包的方法,但我认为我需要将资源复制到主包或将 UIImageView 指向 pod 包。

如何将 pod 包添加到主包中?

这是不可能的。 pods 的工作方式是作为单独的捆绑包,因此我需要将资产包含在主捆绑包中才能在故事板上使用它