I’m developing 2 different apps that share 95% of the same code and views. What is the best way to go about this using Xcode?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use targets. That’s exactly what they are for.
Learn more about the concept of targets here.
Typically, the majority of projects have a single Target, which corresponds to one product/application. If you define multiple targets, you can:
For example you may define Precompiler Macros for one target and other macros for the other (let’s say
OTHER_C_FLAGS = -DPREMIUMin target “PremiumVersion” andOTHER_C_FLAGS = -DLITEto define theLITEmacro in the “LiteVersion” target) and then include similar code in your source: