简体   繁体   English

如何从iOS中已经可用的源代码创建静态库或框架

[英]how to create a static library or framework from a already available source code in iOS

My clients wants to use some of the already available features in my app into their app. 我的客户希望在我的应用程序中使用我的应用程序中一些已经可用的功能。 But, i dont want to share my source code with them and vice versa. 但是,我不想与他们共享我的源代码,反之亦然。 I found out from some googling that, we can do this by creating some static libraries or frameworks in iOS. 我从一些谷歌搜索中发现,我们可以通过在iOS中创建一些静态库或框架来做到这一点。 Can anyone throw some light on how to create a static library or framework (which ever is better) out of my already available source code. 任何人都可以从我已经可用的源代码中找到一些有关如何创建静态库或框架的方法(以更好的为准)。

My preference is to use static libraries over Frameworks. 我的首选是在框架上使用静态库。 You will provide your customers the library file (.a extension) and the header file(s) for the functions in it. 您将为客户提供库文件(扩展名.a)和其中函数的头文件。 They just need to install the files somewhere in their project tree, set the include path, add the library to the project and they are good to go. 他们只需要将文件安装在项目树中的某个位置,设置包含路径,将库添加到项目中就可以了。

Note that if you want them to use your lib in the Simulator as well as on device you will need to provide them two versions of the library, one for each. 请注意,如果希望他们在模拟器以及设备上使用自己的库,则需要为他们提供两个版本的库,每个版本一个。

For instructions on how to create and use an iOS static library see this site . 有关如何创建和使用iOS静态库的说明,请访问此网站

Just for your information: 仅供参考:

I created a static framework for iOS according to jverkoey's instruction 我根据jverkoey的指示为iOS创建了一个静态框架

A ton of thanks to Diney Bomfim for his excellent article on how to create a framework. 非常感谢Diney Bomfim关于如何创建框架的出色文章 This is exactly what i am looking for. 这正是我在寻找的东西。

EDIT - The Link is NOT working anymore... 编辑- 链接不再起作用...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM