Create two iOS Apps in Xcode

前端 未结 3 1014
灰色年华
灰色年华 2020-12-29 11:50

Using Xcode (to develop on iOS) I want to create a second project that it is the same as a first project but some classes are differents.

Exactly, I\'m creating an I

3条回答
  •  爱一瞬间的悲伤
    2020-12-29 12:15

    1. duplicate target of paid version and name it free version

    2. define macro name PaidApp=1 in paid target, then put this line of code in starting of applicationDidfinishLaunching.

      #ifdef PaidApp
      [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"adDisabled"];
      #endif
      
    3. when free app running target, if someone purchase paid app feature then set value of @"adDisabled" to 1 (by default value of @"adDisabled" will be 0)

提交回复
热议问题