Xcode multiple targets vs separate project ?

I want to create multiple projects but all of them share the common code base. The only difference is name, bundle id, info.plist, icons and some other files.

So my questions is, is it better to create multiple targets or create a separate project for each app and add common code as library ?

My concern with multiple targets is there can be 100s of apps and targets are maintained in xcodeproj file. Merging the xcodeproj file is pain in the *** if anything goes wrong. Also when adding new file we have to select manually 100s of targets (Yes, we can write script like cocoapod does) but still is it maintainable ?

To clarify in 100s of app each app is for different client and some may be enterprise app. All apps content and looks are different they have same sections and UX.

So what will be the best approach in your opinion ?

Post not yet marked as solved Up vote post of tarangQS Down vote post of tarangQS
7.3k views

Replies

>...each app is for different client and some may be enterprise app.


While there are other considerations, most of which are based on personal workflow and habits, on that basis alone & especially since you're just getting started, I'd not co-mingle anything, and keep them as separate projects (w/common libs as applies) for when the time comes that any client wants to break away and asks for their code and assets.

You will have aproblem with the guidelines. SEarch this forum for 'spamming the app store'. Apple seems to be allowing a developer only about 4 similarly coded apps.

The discussion is under guideline 4.3. See, for example, https://forums.developer.apple.com/thread/85411

Thanks for your reply.

I want to make it clear that there is intention of spamming here.

I can give an exmaple. Lets say Apple is having a WWDC every year. That doesnt mean they are creating new apps every year. They are just changing its contents.


Another example. There are 10 hospitals each of them wants to cereate an app for their patients/visitors about hospitals map and information. Now they all want to look same but each has completely different content, different name, different API and different bundle identifier.


In this case should i be creating different projects for each hospital or I should create different targets in same xcode project ? I want the same core (Networking, Views, Parsers, Helpers, Business Logic, Database etc...)


I hope this is clear as I do not intend to spam the app store.


Thanks.

Your intentions one way or the other don't matter. The App Store has a new policy. A developer account can have only a few (we believe 3 but the number could be as small as 1) similarly coded apps. That means you can create apps for 3 (or just 1?) hospitals and then you will get rejected for the 4th. You have 2 choices after that rejection. #1) Create a master app that the user obtains once and within that app they select the hospital they want from a list of as many hospitals as you want or #2) create a developer account for each hospital and submit the app under that developer account. It is unclear whether #2 is actually allowed. They really want #1. They have not responded to developer's objection that "coke and pepsi" can't be in the same app. There are many many long posts on this subject elsewhere on the forum.