如何阻止不需要的Swift标准库与我的项目一起提供?

时间:2021-04-08 07:26:13

I started an Xcode project (iOS app) as a mixed Objective-C and Swift project, but now I've decided that all I need is Objective-C. How do I convert it back to a regular Objective-C project?

我启动了一个Xcode项目(iOS应用程序)作为混合的Objective-C和Swift项目,但现在我已经决定我需要的只是Objective-C。如何将其转换回常规的Objective-C项目?

I've removed all swift code and the bridging header, but the status bar still shows "Copying Swift standard libraries" when launching the app. I don't want extra stuff in my app that I don't need. Thanks in advance.

我删除了所有swift代码和桥接头,但状态栏在启动应用程序时仍显示“复制Swift标准库”。我不想在我的应用程序中添加我不需要的额外内容。提前致谢。

2 个解决方案

#1


7  

Here's how to do it:

这是怎么做的:

  • Go to Xcode's project navigator.
  • 转到Xcode的项目导航器。
  • Click on your project.
  • 点击你的项目。
  • Click on Build Settings.
  • 单击“构建设置”。
  • Go to Bridge Options
  • 转到桥选项
  • Set Embedded Content Contains Swift Code to No.
  • 设置嵌入式内容包含Swift代码为否。

#2


0  

For me, disabling "Embedded Content Contains Swift Code" (which was renamed to "Always Embed Swift Standard Libraries") did not make any difference.

对我来说,禁用“嵌入式内容包含Swift代码”(已更名为“始终嵌入Swift标准库”)没有任何区别。

After hitting my head against the wall several times, I found the source of an issue. Disabling "Always Embed Swift Standard Libraries" is still needed, but apart from it I need to disable "Find Implicit Dependencies" option in the Build panel of my Scheme.

几次撞到墙上后,我找到了问题的根源。仍然需要禁用“始终嵌入Swift标准库”,但除此之外,我需要在我的Scheme的Build面板中禁用“Find Implicit Dependencies”选项。

#1


7  

Here's how to do it:

这是怎么做的:

  • Go to Xcode's project navigator.
  • 转到Xcode的项目导航器。
  • Click on your project.
  • 点击你的项目。
  • Click on Build Settings.
  • 单击“构建设置”。
  • Go to Bridge Options
  • 转到桥选项
  • Set Embedded Content Contains Swift Code to No.
  • 设置嵌入式内容包含Swift代码为否。

#2


0  

For me, disabling "Embedded Content Contains Swift Code" (which was renamed to "Always Embed Swift Standard Libraries") did not make any difference.

对我来说,禁用“嵌入式内容包含Swift代码”(已更名为“始终嵌入Swift标准库”)没有任何区别。

After hitting my head against the wall several times, I found the source of an issue. Disabling "Always Embed Swift Standard Libraries" is still needed, but apart from it I need to disable "Find Implicit Dependencies" option in the Build panel of my Scheme.

几次撞到墙上后,我找到了问题的根源。仍然需要禁用“始终嵌入Swift标准库”,但除此之外,我需要在我的Scheme的Build面板中禁用“Find Implicit Dependencies”选项。