对于 Swift 5 和 iOS 12.2+,我应该更改“始终嵌入 Swift 标准库"吗?否? [英] With Swift 5 and iOS 12.2+ should I change "Always Embed Swift Standard Libraries" to NO?

查看:25
本文介绍了对于 Swift 5 和 iOS 12.2+,我应该更改“始终嵌入 Swift 标准库"吗?否?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知何故,对于我的所有目标,始终嵌入 Swift 标准库"是肯定的.可能是由于从 Swift 1 到 5 的历史发展.我现在使用 Xcode 10.2,升级了目标,我的Swift 语言版本"是 5.

Somehow "Always Embed Swift Standard Libraries" for all of my targets is YES. Probably due to historical development from Swift 1 to 5. I'm using Xcode 10.2 now, upgraded the targets and my "Swift language version" is 5 for all of them.

出于兴趣,我使用 Xcode 10.2 创建了一个空的新项目,它创建时使用始终嵌入 Swift 标准库"作为调试和发布版本的 NO.

Out of interest I created an empty new project with Xcode 10.2 and it is created with "Always Embed Swift Standard Libraries" as NO for both Debug and Release builds.

我有一种感觉,即使我保持原样,作为 iOS 12.2+ 精简的一部分,Apple 无论如何都会剥离标准的 Swift 库?

I have a feeling that even if I leave it as it is, Apple will strip standard Swift libraries anyway as a part of thinning for iOS 12.2+?

那么自 swift 5 以来正确的默认值是什么?将其保持为 YES 或更改为 NO 有什么好处?

So what's the correct default since swift 5? Any benefits from either keeping it at YES or changing to NO?

[更新] 感谢 Cœur 发表评论.看起来真的是 CocoaPods 版本之一做到了.项目设置为 NO,但所有使用 CocoadPods 的目标都是 YES.

[Update] Thanks to Cœur for a comment. It really looks like that one of the CocoaPods versions did it. Project is set to NO, but all the targets using CocoadPods were YES.

推荐答案

新项目的默认设置是 NO,(据我所知)一直都是.我从未将始终嵌入"设置为是",并且我的项目一直运行良好.因此,除非有一些很好的理由为什么这是肯定的,否则它可能不应该是.

The default for new projects is NO and (as far as I know) always has been. I have never had "Always embed" set to YES, and my projects have always worked just fine. So unless there is some really good reason why this was YES, it probably shouldn't have been.

请注意,仅当您针对 12.2 SDK 进行构建并使用 12.2(或更高版本)的机器上时,才会删除这些库.这些库仍然需要在 12.1 或更早版本的机器上运行.

Note that the libraries are stripped out only if you are building against the 12.2 SDK and going onto a machine with 12.2 (or later). The libraries are still needed to run on a 12.1 or earlier machine.

这篇关于对于 Swift 5 和 iOS 12.2+,我应该更改“始终嵌入 Swift 标准库"吗?否?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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