如何在不创建Umbrella框架的情况下构建依赖于另一个的iOS框架 [英] How to build an iOS Framework with a dependency on another without creating an Umbrella Framework

查看:147
本文介绍了如何在不创建Umbrella框架的情况下构建依赖于另一个的iOS框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过创建一些可重复使用的框架来简化我的开发,这些框架包含我通常在多个项目中重复使用的功能。

I am trying to streamline my development by creating some re-usable Frameworks which incorporate features I commonly re-use in multiple projects.

但是,设置其中一个我的框架我遇到了一个问题,这些类依赖于Firebase框架。阅读Apple文档之后,不建议创建一个Umbrella框架(一个嵌入另一个框架),特别是如果您没有嵌入式框架的所有权(我没有)。

However, having setup one of my Frameworks I have encountered a problem, the classes have a dependency on the Firebase framework. Having read the Apple docs it's not recommended to create an Umbrella Framework (one which embeds another) especially if you do not have ownership of the embedded Framework (which I do not).

所以问题是:

我如何创建一个框架项目,它允许我构建框架而不包括将创建Umbrella框架的依赖项。我认为这就是人们喜欢Firebase所做的事情,因为当你添加他们的框架时,还有其他你必须添加到你的项目。我不太清楚如何配置项目以允许您构建框架而没有错误但不包括依赖项。

How can I create a Framework project which allows me to build the Framework without including the dependencies which would create an Umbrella Framework. I presume this is what people like Firebase do because when you add their Framework there are others you have to add to your project as well. I can't quite see how you would configure a project to allow you to build the Framework without errors but not include the dependencies.

供参考我使用的是最新的Xcode并且需要支持iOS 8及更高版本。

For reference I am using the latest Xcode and need to support iOS 8 and above.

提前感谢您对此的任何想法/建议

Thanks in advance for any thoughts / suggestions on this

推荐答案

为了任何正在努力解决同一问题的人的利益,答案比我预期的要简单得多。

For the benefit of anyone who is struggling with the same issue, the answer is much simpler than I had anticipated.

框架是动态链接的,只是为您自己的框架向项目添加框架不会导致它嵌入到输出文件中,因此不会生成Umbrella框架。你实际上不需要做任何事情。您自己的框架所需的任何框架都可以包含在您的项目中,以便您可以编译自己的框架,并且还需要包含在使用您的框架的任何项目中。

The Frameworks are linked dynamically and simply adding a Framework to the project for your own framework will not cause it to be embedded in the output file and therefore not generate an Umbrella Framework. You don't actually need to do anything. Any Frameworks that are required by your own Framework can be included in your project so that you can compile your own Framework, and will also need to be included in any projects that utilise your Framework.

这篇关于如何在不创建Umbrella框架的情况下构建依赖于另一个的iOS框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆