Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS static library codebase for white label apps

I'm looking for the best approach to customize our iOS app so we can easily create white label versions of it and keep them all in sync.

One approach is to put the entire codebase in a static library project. Then create a separate project for our main app and each white label app. These projects would each contain a reference to the codebase library as a sub-project, and their own assets like icons, loading images and a Info.plist file.

My colleague has successfully used this approach with our Android sister project in Eclipse.

Unfortunately this approach might not work in xcode. xcode does not seem to allow some resources to be bundled with a static library, like the Settings.bundle and Localizable.strings which are essential.

Is there any way I can use this approach in xcode, or am I better off just referencing the codebase folder from each project?

Edit:

Originally I was planning to just reference the codebase folder from each project, but found that this approach would require re-adding the codebase directory in every project each time a file was added/removed/renamed in the codebase.

like image 528
RohinNZ Avatar asked Jun 14 '12 05:06

RohinNZ


1 Answers

I've done white labelled apps. You should try targets first. Targets are contained within projects. You can include your sources in the same project. Put everything that varies into just a few files, and vary which of those files you include in each target.

You will still need to make sure files are in all your targets, but you'll be prompted or get a linking error and if you miss a file including it is just checking a checkbox.

You can keep the target-specific files pretty limited. I have a common xcassets file and one for each target. I also have separate plists and few other resources for each target. Everything else is shared.

References:

  • Xcode Concepts: Targets
like image 200
Steven Fisher Avatar answered Nov 02 '22 17:11

Steven Fisher