我想在我的应用程序中加载辅助 StoryboardTest.storyboard
(在Main.storyboard
旁边),如下所示:
let storyboard = UIStoryboard(name: "Test.storyboard", bundle: nil)
Test.storyboard
驻留在组 Test
内,它被标记为本地化为 Base(因此其相对于组的位置报告为 Base.lproj/Test.storyboard
),它还标记为我的应用程序目标中的目标成员资格。当我在模拟器上运行应用程序时,我可以确认应用程序的主包中存在文件 Base.lproj/Test.storyboardc
。
但是上面的代码会产生这个错误:
Could not find a storyboard named 'Test.storyboard' in bundle ...
成功打包和加载像我这样的辅助 Storyboard的正确方法是什么?
最佳答案
您不需要加载带有 .storyboard 扩展名的 Storyboard。像这样使用
let storyboard = UIStoryboard(name: "Test", bundle: nil)
关于ios - 找不到名为 Test.storyboard 的(辅助) Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39716452/