문제

Is it possible to have two projects in XCode using the same codebase?

I have an app which offers a demo version and a full version. They both share the same code and I just set a flag in my plist file, and somewhere in my code I do

if (demo_mode) {
    // ...
} else {
    // ...
}

This is easy for testing, but not suitable for the app store, since I want slightly different app icons and app names for them.

I could as well make a copy of the project, but then I'd have to apply changes in one project to the other (bugfixes, UI changes etc). That's why I want to use the same source folder for two projects.

도움이 되었습니까?

해결책

All you need is one project with two target.

You can make different config or file with different target, also share the same code, but submit to App Store separately.

Let me know if you need more help.

다른 팁

You are probably going to use StoreKit to provide a non-consumable purchase for users to upgrade, and use this as your flag. StoreKit usually involves a good deal of boilerplate, so you might consider implementing something like MKStoreKit to handle some of that for you. You can use MKStoreKit to easily check if the user has purchased the upgrade or not. Restoring purchases is also relatively easy.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top