Converting an existing project into customizable framework

后端 未结 2 525
说谎
说谎 2021-01-13 11:29

I am a android developer and I needed to create and IOS app. So I did and app is ready now. But now I want to make it a Library/Framework. I mean a same code base will be us

2条回答
  •  渐次进展
    2021-01-13 11:51

    With regard to how to create a framework, here's how I'd do it:

    1. Create a workspace:

    2. Bring the project you want to turn into a library into that workspace by dragging it in from the Finder (make sure it's not open in XCode when you do this). Let's call that project FrameworkProj:

    3. Create a target for FrameworkProj of type Cocoa Touch Framework:

    4. Create a second project, which we'll call SampleProjWhichUsesFramework, and import the framework into it.

    As for your question of IB elements being settable via the framework, simply make sure you have IBOutlets for those elements that are marked public, and they will be available to SampleProjWhichUsesFramework as properties of your framework.

提交回复
热议问题