iOS 中多个项目之间共享代码的最佳方式
我们计划在 AppStore 中推出一系列应用程序。它们将针对某种不同的期刊,显示通过 XML 从服务器下载的不同内容。因此,这些应用程序将由完全相同相同的代码组成(这是一个通用应用程序,因此它可以在 iPhone/iPad 中运行)。
我最初的想法是,为了上传应用程序,只需更改图像、徽标和配置(plist)即可进行编译,使应用程序作为特定日志做出反应。压缩后的文件将上传到AppStore。
然而,这导致了一种可怕的方法,它会导致失败和错误。如果我忘记更改某些图像,因为您无法在编译文件中看到它们(因为它已包含在内),它们最终会出现在商店中(我需要四到五天才能更改应用程序)。
我正在尝试寻找更好的方法,使项目尽可能独立。我希望能够共享整个代码库:视图、类和笔尖,并为每个期刊创建不同的项目。
哪种方法是实现这一目标的最佳方法?什么结构可以让我将逻辑(控制器、类)和 UI 分组并在不同的项目中使用它?
我希望我已经解释过了。
一如既往,非常感谢。
We're planning to launch a serie of applications in AppStore. They will be for some kind of different journals, showing different contents downloaded from a server via XML. So these applications will be made from exactly the same code (It's an universal application, so It'll work both in iPhone/iPad).
My initial idea was, in order to upload the application, compile just changing the images, logos and configurations (plist) that makes the application react as a particular journal. The compressed file would be uploaded to the AppStore.
However, this has resulted a horrible method, which promotes failures and mistakes. If I forget to change some image, as you can't see them in the compiled file (as it is included) they will end up in the store (and I will need four or five days in order to get the application changed).
I'm trying to look up for a better approach, wich keep the projects as independent as possible. I would like to be able to share the entire codebase: views, classes and nibs and create different projects for every journal.
Which is the best method to achieve that?. What structure would let me group both logic (controllers, classes) and UI and use it in the different projects?.
I hope I've explained.
As always, thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您应该将大部分通用代码保留为库项目。每个最终项目都应与该项目链接,并提供图像/资产以及代码,以将这些资产提及到通用代码。在我的日常工作中,我也编写了一个通用库,它被我雇主的 2 个产品/应用程序使用。
You should keep most of your common code as a library project. Each final project should link with this project and provide images/assets along with code to mention these assets to common code. In my day job, I write a common library too, which gets used by 2 products/apps at my employer.