Avatar of paddycobbett
 asked on

How can I manage code versions across multiple (ios) projects?

I need some advice on best practise for how I'm been developing my projects.

Say I have built an app which is completely data driven from it's database and assets. So say I am on version 1.0 of my code. I deliver 2 apps using version 1.0, i.e each app uses a different database, and are distinguished by creating different 2 targets within the same Xcode project.. because I don't want to maintain 2 versions of the code. I then create a 3rd target for another project that needs building, which requires a new feature, so now my code is at say version 2.0. However, version 2.0 inadvertently broke the apps for the first 2 projects which were compiled when the code was at version 1.0. Whilst it would be great for the older projects to include the new feature there is no time to make amendments so that they run on version 2.0 of the code, and say the client needs it tomorrow! I needed to republish them due to a small database change, which would still have run using version 1.0, but can't back up the code now! Ok, so how do I keep on top of this sort of thing coming up?

- I could as mentioned create a separate Xcode project for each client project, but then I would be maintaining multiple versions of code, and older apps won't take advantage of new features introduced in newer code.

- Another idea is, could I create a framework for each code version? I guess I would have a separate Xcode project for each app which uses a framework corresponding to the code at the point at which is was last compiled, guaranteeing it will always work with it.. I could always replace the framework with a newer one if or when its compatible. Is this a suitable use of frameworks? Can this be done? Or do I need to create a library? Clearly I'm unsure of how these work. It would need to include xibs too.

- Or, can anyone suggest to me how they would go about producing apps in the scenario described.. whereby all the apps run off the same code, although different assets, and need to manage the code versions of the apps.

Please let me know if I haven't explained myself. Thanks in advance!
Apple OSSwift ProgrammingApple Hardware

Avatar of undefined
Last Comment

8/22/2022 - Mon

I hate to say this but, it really sounds like you need a version control system to more effectively manage the builds.  Yes when you branch, you would have different versions of the code out there but, the advantage of the version control system is far greater than the disadvantage of changing things in a few places.  You just have to obviously manage it well.  I personally use SVN but Git is also a slick one.  Just my 2 cents, hope this helps.

Hi thanks for your comment. Ok great, if that's the way to go then I'll have to get my head in to it. I've used SVNs before but not for the Mac or Xcode.

To see if I got this right, each of my projects would have it's own Xcode project. Each Xcode project would be synced to a particular version within the SVN? Is it simple to sync them? So if I want to upgrade the code version for a given project I just sync it with a new version, press some magical button and Xcode will take care of the rest? Do the references within Xcode take care of themselves to reflect the new version? Thanks

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Apologies, was away the last few days. Great thanks, that makes perfect sense. Am just going through setting it up, many thanks!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy