iOS static library codebase for white label apps
Asked Answered
N

3

5

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.

Naughton answered 14/6, 2012 at 5:32 Comment(0)
K
4

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:

Kaffraria answered 14/6, 2012 at 6:13 Comment(1)
Thank you, it looks like targets will be the best approach.Naughton
G
3

As a paid consulting project, I am reviewing a company's white label strategies. They have created a series of.sh file that copies the entire build into the new name - including a new .plist and project file.

What they didn't account for is versioning of those apps; therefore, I think libraries is the best approach if you can build your app as such. It is entirely possible that you might have multiple versions of the same white label app. (A nightmare at best!!! LOL)

Another thing that you might want to look at is CocoaPods. I haven't used it but I have had friends who have - they like it because it helps with lib management - especially with going from one dev environment to another. I need to use it next month because of the Zxing path mess that everyone gets to deal with.

https://github.com/CocoaPods/CocoaPods

Last recommendation - use Source Control like there's no tomorrow!!!

Genniegennifer answered 18/10, 2012 at 23:8 Comment(1)
CocoaPods looks awesome! By just linking each white label build target to the pod library, I no longer have to worry about manually updating every single white label build target when I add or remove a library. Thanks!Naughton
L
2

You can’t bundle resources with a static library automatically, but there’s nothing preventing you from including the shared resources by hand. You can create a workspace for the customized project, insert the library’s project into the workspace and then drag the resources group from the library’s project tree to the main project.

Ledesma answered 14/6, 2012 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.