xcode Cocoa Touch 框架与 Cocoa Touch 静态库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25297069/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cocoa Touch Framework vs Cocoa Touch Static library
提问by Chris G.
Any comment on Cocoa Touch Framework vs Cocoa Touch Static library?
关于 Cocoa Touch Framework 与 Cocoa Touch Static 库的任何评论?
Can you distribute a Framework like a static library without source code?
你能像没有源代码的静态库一样分发框架吗?
采纳答案by Scott
Cocoa Touch framework support was added in Xcode 6 primarily to support App Extensionsin iOS 8 and Mac OS 10.10. App extensions have to be built as Cocoa Touch frameworks.
Xcode 6 中添加了 Cocoa Touch 框架支持,主要是为了支持iOS 8 和 Mac OS 10.10 中的App Extensions。应用程序扩展必须构建为 Cocoa Touch 框架。
Frameworks also require less manual work to set up in a project than static libraries, although CocoaPodslargely takes care of these pain points.
与静态库相比,框架在项目中设置所需的手动工作更少,尽管CocoaPods在很大程度上解决了这些痛点。
Frameworks can be - and are by by default - built without the source code in the build target. Usually only header file(s) are in the target. Therefore, you could create and share a binary only Framework.
框架可以 - 并且默认情况下 - 在构建目标中没有源代码的情况下构建。通常只有头文件在目标中。因此,您可以创建和共享一个仅限二进制的框架。