Ios 在工作区中打开另一个项目的情节提要
是否有方法在同一工作区中实例化另一个项目的故事板?Ios 在工作区中打开另一个项目的情节提要,ios,ipad,swift2,Ios,Ipad,Swift2,是否有方法在同一工作区中实例化另一个项目的故事板? 通过使用不同的故事板名称并指向其捆绑包 当然,您可以在同一工作区中从一个项目打开另一个项目的情节提要 比如说,您在框架中有一个故事板,并且希望在应用程序中使用它。下面是如何从应用程序代码中执行此操作 let frameworkBundle = NSBundle(identifier: "com.yourdomain.nameOfFramework") //getting the bundle for the framework let stor
通过使用不同的故事板名称并指向其捆绑包 当然,您可以在同一工作区中从一个项目打开另一个项目的情节提要 比如说,您在框架中有一个故事板,并且希望在应用程序中使用它。下面是如何从应用程序代码中执行此操作
let frameworkBundle = NSBundle(identifier: "com.yourdomain.nameOfFramework") //getting the bundle for the framework
let storyboardFramework = UIStoryboard(name: "SM_Main", bundle: frameworkBundle) //pulling the storyboard from the framework
我的项目成功的解决方案。 Main.storyboard引用了工作区另一个项目中的视图控制器 我有两个项目的工作区:
Main.storyboard
Test.storyboard
和包标识符=com.testbundleid
Main.storyboard
createstoryboard reference中,使用以下属性:
- 故事板=
李>测试
- Bundle=
com.testbundleid
- 情节提要ID=
TestViewController