简体   繁体   English

iOS上的自定义动态框架

[英]Custom dynamic framework on iOS

There is a number of questions (some of them with answers) about creating custom dynamic frameworks for iOS. 关于为iOS创建自定义动态框架,有很多问题(其中一些有答案)。 My practical experiance shows that on iPad2 and iPad3 one can use custom dynamic frameworks and it works. 我的实际经验表明,在iPad2和iPad3上,人们可以使用自定义动态框架,它可以工作。 On iPad1 it doesn't work. 在iPad1上它不起作用。 So my question is. 所以我的问题是。 Did it become possible to use dynamic frameworks on new versions of iOS? 是否可以在新版本的iOS上使用动态框架?

Apple doesn't allow you to create your own dynamic frameworks for the iOS platform. Apple不允许您为iOS平台创建自己的动态框架。 There is however a way to package up your static library and using in a similar way as a framework. 但是,有一种方法可以打包静态库并以与框架类似的方式使用。

Did you see this post ? 你看到这篇文章吗?

I particular check out this GitHub repo, this is what I used to get up and running, very simple explanations: https://github.com/jverkoey/iOS-Framework 我特别看看这个GitHub仓库,这是我以前用来启动和运行的,非常简单的解释: https//github.com/jverkoey/iOS-Framework

Basically you will create a static library and create multiple targets for each platform - simulator and device and one last target which I usually call "build and merge", this target has a script that takes the resulting libraries for device and simulator, and packages them up in a folder called xxxxxx.framework, inside is the standard structure and it contains your static libs, when you use this in other projects you import the framework to that project and include the header files like you would any other real dylib framework. 基本上你将创建一个静态库并为每个平台创建多个目标 - 模拟器和设备以及我通常称之为“构建和合并”的最后一个目标,这个目标有一个脚本,它为设备和模拟器获取结果库,并打包它们在一个名为xxxxxx.framework的文件夹中,inside是标准结构,它包含你的静态库,当你在其他项目中使用它时,你将框架导入到该项目并包含像任何其他真正的dylib框架一样的头文件。

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

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