Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Two iPhone Apps from Common Code

I have an iPhone app, and I'm taking a few features of the app and creating a new app.

What's the appropriate way to build two apps from a common code base?

like image 363
Andrew Johnson Avatar asked Jan 24 '23 06:01

Andrew Johnson


2 Answers

One more option nobody seems to have mentioned yet - you can create a new target in the original project file. I do this for "free" and "paid" versions of the same app, but it'd be useful for any two apps that share most of the same code.

like image 161
Mark Bessey Avatar answered Jan 30 '23 09:01

Mark Bessey


I got this from an Xcode expert:

Xcode has two affordances to do the right thing here:

1) For files outside your project tree that your project requires, set up a source tree. Xcode > Preferences > Source Trees, define a symbolic path (e.g. EXTRA_SOURCES) with the actual path on your disk to where they're checked out. Then when you add those files to your project, add them Relative to Source Tree to that source tree.

(N.B. Quit and restart Xcode after defining the source tree in Prefs.)

2) In Xcode 3.2, define the Project Roots to include the Source Tree. Project > Edit Project Settings > General tab, "Configure Roots & SCM" button. Add the source tree to the Project Roots and set up its repository, which can be a separate repository from your main project files.

That's it. You have one file tree, from one repository, but many projects can share it, and if you perform an SCM operation on the source in one project it's reflected in others.

like image 34
mahboudz Avatar answered Jan 30 '23 07:01

mahboudz