Tom
Tom

Reputation: 3627

Organize code in xcode where same code used for multiple apps

Suppose I have a complete "app framework" I use for different customers. What is different for each is a config file (e.g. where to download new data files), data files and style files (e.g. background image and launch images)

I could of course

  1. Copy code files around to different app folders replacing old ones.
  2. Copy data/config/style files in/out of a single directory.
  3. Use targets (just read up on these, new to xcode) - but does that work well with different asset folders, launch images etc?

Is there a better way? Somehow make a skeleton app / library that each specific customer app then inherits from? How about storyboards etc?

Only thing each customer specific file would change would be all the plist info, ID, launch images, data files etc. The code would be completely unchanged (I expect the skeleton app can handle whatever small nuances each customer will need, but far most is handled by config files. However, should the need arise, it would of course be nice if I could have cusomer specific code and visuals in each customer app, but this is not a requirement from my POV)

Upvotes: 0

Views: 120

Answers (1)

Segev
Segev

Reputation: 19303

From what you're describing using targets is your best bet. So for example you'll have 5 targets in one worksapce, each target is a different app, all are using the same global.framework, each target got her own config.h \ config.m files

Upvotes: 1

Related Questions