Best way to share code between multiple projects on iOS

We plan to launch a series of applications in the AppStore. They will be for some different magazines, showing different content downloaded from the server via XML. Thus, these applications will be made of exactly the same code (this is a universal application, so it will work like on the iPhone / iPad).

My initial idea was to download the application, compile only the change of images, logos and configurations (plist), which makes the application react like a specific log. The compressed file will be uploaded to the AppStore.

However, this has led to a terrible method that contributes to errors and errors. If I forget to change any image since you cannot see them in the compiled file (since it is included), they will go to the store (and it will take me four or five days to change the application).

I am trying to find a better approach that will allow projects to be as independent as possible. I would like to be able to share the entire code base: views, classes and tips, and create different projects for each magazine.

What is the best way to achieve this? What structure would allow me to group the logic (controllers, classes) and the user interface and use it in different projects?

Hope I explained.

Thank you very much, as always.

+7
source share
4 answers

You should save most of your shared code as a library project. Each final project should contact this project and provide images / assets along with the code to mention these assets for the common code. In my day job, I also write a shared library, which is used by my 2 products / applications from my employer.

+6
source

An Xcode project can have several target values, all the target object exchange code, but each Target gets its own resources (icons, images, text, plists, etc.) from another subdirectory / folder within the same project directory / folder. You can then check all of this, or just a common source, in your version control repository.

You should also test each of your applications, built in the same way as any representation, with the exception of the code, on the device before downloading to the repository.

+4
source

You can have one Xcode project that creates several applications. You will need to create a separate Info.plist with a different package identifier for each application.

0
source

If you use the git repository, you can just fork out for every other application you want, and that will keep track of all the differences, and if you need to switch from the one you're working with, you just need to check this thread. This would allow the exact same structure to simply minor differences between the actual code for each.

-2
source

All Articles