xcode 如何将两个应用程序合并为一个应用程序(合并两个项目)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27797926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Combine Two Apps into One App (Combine two Projects)
提问by Vinoth
I have two Projects(Two apps)named A,Bwhich was created seperately,Now i want to make this into one app,Is it Possible?
我有两个名为A、B 的项目(两个应用程序),它们是单独创建的,现在我想把它变成一个应用程序,这可能吗?
ExampleIn this app it should launch with A(viewcontroller in Project A) as view and do some actions then by button tap or something like that i have go to B(viewcontroller in Project B)as View and do actions then i have to back to some view of A.want to go different views in both the projects then i want to relate and pass data between two project class files.
示例在这个应用程序中,它应该以A(项目A中的视图控制器)作为视图启动并执行一些操作,然后通过按钮点击或类似的操作,我已转到B(项目B中的视图控制器)作为视图并执行操作,然后我必须返回到的一些观点一。想进去两个项目不同意见的话,我想关联和传递两个项目类文件之间的数据。
NOTE: Both the projects have 5 storyboards& 100 class files each.Both are not a libraries.
注意:这两个项目都有 5 个故事板和100 个类文件。两者都不是库。
I have gone through with workspace concept but can't get a clear idea.
我已经完成了工作空间的概念,但无法得到一个清晰的想法。
回答by
You could use an Xcode workspace.
您可以使用Xcode 工作区。
A workspace is an Xcode document that groups projects and other documentsso you can work on them together. A workspace can contain any number of Xcode projects, plus any other files you want to include. In addition to organizing all the filesin each Xcode project, a workspace provides implicit and explicit relationships among the included projects and their targets.
工作区是一个 Xcode 文档,它将项目和其他文档分组在一起,以便您可以一起处理它们。一个工作区可以包含任意数量的 Xcode 项目,以及您想要包含的任何其他文件。除了组织每个 Xcode 项目中的所有文件之外,工作区还提供了包含的项目及其目标之间的隐式和显式关系。
In the workspace, they share a build directory. To create one, go to File > New > Workspace, and select its location in your file system. Then, to add an existing projectto a workspace:
在工作区中,他们共享一个构建目录。要创建一个,请转到File > New > Workspace,然后选择它在文件系统中的位置。然后,要将现有项目添加到工作区:
- In the project navigator, control-click in the empty space below the list.
- Choose Add Files to “”.
- Navigate into the folder containing the .xcodeproj file to add.
- Select the .xcodeproj fileand click Add.
- 在项目导航器中,按住 Control 键并单击列表下方的空白区域。
- 选择将文件添加到“”。
- 导航到包含 .xcodeproj 文件的文件夹以添加.
- 选择 .xcodeproj 文件并单击添加。
Then A
and B
will be in one big project.
然后A
和B
将在一个大项目。
Hope this will help,
希望这会有所帮助,