【发布时间】:2019-05-09 20:58:39
【问题描述】:
我创建了一个包含一些图像的私有 pod,我已将这些图像放在资产目录中,现在当我尝试访问它时,它不会加载到我安装了这个私有 pod 的主机应用程序中
这是我的私人 podspec
s.resource_bundles = {
'myPod' => ['myPod/Assets/*.xcassets']
}
我已经在使用 pod 创建的 Assets 文件夹中添加了这个资产目录
这在我的 VC 里面 viewDidLoad 在我的私人 pod 中
if let image = UIImage(named: "myIcon", in:Bundle(for:myVC.self), compatibleWith: nil) {
sendButton.setImage(image.withRenderingMode(.alwaysTemplate), for: .normal)
sendButton.setTitle("", for: .normal)
}
我还可以在我的主机应用程序中看到资源文件,资源文件夹内的 pods 部分,我的包也不是零。
【问题讨论】: