How to have one core in several applications

2019-09-18 06:53发布

问题:

My objective is developing several apps using the same core (code) just have different UI (color, asset's, etc.).

I don't know if I can compare to MVC but I want to reuse the Model and Controller having several Views

Important:

  • Can be only one project?
    • For example creating different target or other configuration project..
  • If I discover a bug I want resolve just once.
  • Generating separated build's.
    • The bundle have only the resources that I want (new target right?)

I saw several apps using this (theoretically) like sports apps (soccer, etc).

Thanks

**Edit**** More detail

回答1:

I think you would like to use this : http://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial The Core can be a project, in which you're going to define the common classes. These common classes may be controllers and views. From MVC point of view, in your app these will be the Model.
I suggest you to prefer Cocoa (Touch) Framework classes.



回答2:

I create many apps from a single workspace. I have created separate schemes/targets for each apps. I have separate resources/xib/plist/prefix/build files for each targets. In some places, particular target should execute a specific set of code. For this, I have added unique macros in the target'e prefix files.