我们可以从.framework文件中删除依赖项并在最终用户应用中分别添加它们吗?
我正在制作一个自定义框架,其中包括第三方库,因为这些库我的框架文件大小正在增加。有什么方法可以从.framework文件中删除第三方库,如果最终用户想使用这些库的功能,他会分别添加它们。
如果我删除依赖项,则不会生成框架文件。
任何人都可以帮助将这个问题与之相关联吗?
I'm making a custom framework, which included third-party libraries due to these libraries my framework file size is increasing. Is there any way we can remove third-party libraries from the .framework file and if the end-user wants to use the functionality of those libraries, he adds them separately.
If I remove dependencies then the framework file is not generated.
Can anyone please help related this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须从框架中删除第三方库,并将最终用户添加它们。像您这样做是不正确的。这导致重复的符号和不确定的行为。
做您描述的最常见方法是使用软件包管理器,特别是 spm 和/或 cocoapods 。
如果您手工执行此操作,则需要将依赖框架链接起来,但将其标记为“不要嵌入”。手工做到这一点可能会有些麻烦和脆弱,这就是为什么它几乎总是在包装管理人员身上完成的原因。
You must remove third-party libraries from your framework and have the end-user add them. It is incorrect to bundle them as you're doing. This leads to duplicated symbols and undefined behavior.
The most common way to do what you're describing is with a package manager, particularly SPM and/or CocoaPods.
If you do this by hand, you'll need to link the dependent frameworks, but mark them as "do not embed." Doing this correctly by hand can be a bit cumbersome and fragile, which is why it's almost always done with package managers.