Xcode无法使用Cocoapods找到引用的Storyboard [英] Xcode cannot find referenced Storyboard using Cocoapods

查看:87
本文介绍了Xcode无法使用Cocoapods找到引用的Storyboard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用CocoaPods创建一个Pod,我想捆绑一个演示情节提要,我可以从示例应用程序的主情节提要中引用它。问题是Xcode在执行此操作时给了我以下编译器错误:



找不到从Main.storyboard引用的名为 Demo的故事板



请参阅:







在我的Podspec中,我包括:

  s.resource_bundles = {
'StoryboardAssets'=> ['Pod / Assets / *。{storyboard,png}']
}

您可以找到我使用



并且在您的podspec文件中,您应该添加故事板的引用(作为资源而不是捆绑包)



s.resource ='MyPod / MyStoryboardName.storyboard'



在pod更新之后,一切都会按预期进行



希望有所帮助


I'm trying to create a Pod using CocoaPods and I want to bundle a "Demo" Storyboard that I can reference to from the Main Storyboard from my example application. The problem is that Xcode gives me the following compiler error when I do so:

Did not find storyboard named "Demo" referenced from Main.storyboard

See:

In my Podspec, I included:

s.resource_bundles = {
    'StoryboardAssets' => ['Pod/Assets/*.{storyboard,png}']
}

You can find the demo repository that I created using the "Using Pod Lib Create" guide, you can find it here:

https://github.com/Kukiwon/StoryboardDemo

I'm running CocoaPods version 0.39.0.

So what would be the proper way to reference a Storyboard from your Pod? Am I missing something?

解决方案

To reference storyboard using cocoapods, you should set in the Bundle section, the bundle identifier of the pod, like the picture below:

And in your podspec file, you should add the reference of your storyboard (as resource and not bundle)

s.resource = 'MyPod/MyStoryboardName.storyboard'

After the pod update, everything will work as expected

Hope that helps

这篇关于Xcode无法使用Cocoapods找到引用的Storyboard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆