Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple apps from one code base - multiple projects or targets in Xcode?

Tags:

xcode

ios

I am developing an iOS app. Right now it is one app and two targets (app and tests).

Getting closer to publishing I want to split this app into three apps with lots of shared code and shared tests. (Think of free version and full version for App Store and prototyping app that will not be published).

Would you set up multiple projects in Xcode (1 library project and 3 app projects) or keep all in one project and only set up multiple targets?

like image 912
Miriam Avatar asked Jun 21 '13 09:06

Miriam


People also ask

What are targets in Xcode project?

A Target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.

How do I open multiple Xcode projects?

If you use Command+T then afterwards you can drag that tab into the desktop space to make a new window. Then you can open your other project.

Can multiple people work on Xcode?

You can collaborate on Xcode or any other IDE as if you are in the same space.


1 Answers

I think you have at least 3 options here:

  1. Separate projects. It is more difficult to share code across projects, but with Xcode workspaces this is quite feasible. If you have a lot of customization for each project, this might make sense.

  2. Same project, more targets. This is the usual way this is done. It is very easy because you have a very neat overview of what files go into which target. If you have around, say, a dozen or so targets, it is really quite easy to handle.

  3. Separate git branches. I have worked with this in the past. The differences between the apps (Info.plist, configuration files, data files) are just swapped in the corresponding git branch. This is practical if you have a lot of data and don't need to have all of it available at all times. However, the complexity of git is considerable if you are not familiar with it. You can create git submodules to change the shared code parts in one go.

like image 184
Mundi Avatar answered Sep 19 '22 22:09

Mundi