在Xcode中创建两个iOS应用程序 [英] Create two iOS Apps in Xcode

查看:221
本文介绍了在Xcode中创建两个iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Xcode(在iOS上开发)我想创建第二个项目,它与第一个项目相同,但有些类是不同的。

Using Xcode (to develop on iOS) I want to create a second project that it is the same as a first project but some classes are differents.

确切地说,我正在创建一个iPhone应用程序,我想提供免费版和高级版。实际上,项目的代码是相同的,但改变了一些类。

Exactly, I'm creating an IPhone App and I want to offer a free version and a premium version. Actually, the code of the projects are identical but changes some classes.

问题是我不想支持两个项目。如果我修改了一个类,那么我必须在另一个项目上修改相同的更改。这是非常多余的。

The problem is I don't want support two projects. If I modify a class, then I have to modify the same change on the other project. It is very redundant.

此外,该项目被推送到远程GIT存储库。

Besides, the project are pushed to a remote GIT respository.

最后一个请注意,iOS应用程序使用与项目关联的ID进行标识。

And one last note, an iOS App is identify using an ID associated with the project.

那么,我需要两个不同的项目吗?

So, I need two differents projects?

哪个是创建两个iOS App项目的最佳解决方案Xcode共享类,但更改了两个类?

Which is the best solution to create two iOS App projects in Xcode sharing the classes, but changing two o three classes?

谢谢

推荐答案


我想提供免费版和高级版。

I want to offer a free version and a premium version.

在这种情况下,你不需要在两个项目中创建两个应用程序:您需要的只是高级版本的第二个目标。这是一个链接,解释了如何创建和管理多个目标在Xcode中

In this case, you do not need to create two apps in two projects: all you need is a second target for your premium version. Here is a link that explains how to create and manage multiple targets in Xcode.

该过程归结为向项目添加目标,为其定义单独的属性plist,可选地为条件设置预处理器符号编译,并使用该符号 #ifdef 免费版本中不需要您的类的部分。

The process boils down to adding a target to the project, defining a separate properties plist for it, optionally setting up a preprocessor symbol for conditional compile, and using that symbol to #ifdef portions of your classes not needed in the free version.

另一个常见的管理免费和高级产品的方法是免费提供单个版本,并允许用户通过应用内购买将其升级到高级版。

Another common approach to managing free vs. premium offering is to provide a single version for free, and let users upgrade it to premium through an in-app purchase.

这篇关于在Xcode中创建两个iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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