如何修改SWIFT_MODULE_NAME? [英] How to modify SWIFT_MODULE_NAME?
问题描述
标题说明了一切。我在 SWIFT_MODULE_NAME 的构建设置中进行了搜索,但没有出现任何内容。我也在网上搜索,并且有这个名称的引用,但没有关于如何定义的信息。 此外,我在Apple文档中找不到任何提及SWIFT_MODULE_NAME的信息。
The title says it all. I've searched in the build settings for SWIFT_MODULE_NAME, and nothing came up. I've also searched online, and there are references to this name, but there is no information on how it is defined. Furthermore, I couldn't find any mention of SWIFT_MODULE_NAME in the Apple Docs.
我知道这一点:它用于目标 -C生成的界面标题名称构建设置,可以通过双击设置值来查看:
I do know this: it is used in the "Objective-C Generated Interface Header Name" build setting, and can be viewed by double-clicking on the settings value:
$(SWIFT_MODULE_NAME) - Swift.h
$(SWIFT_MODULE_NAME)-Swift.h
它用于弥合Objective-C和Swift之间的差距,并且只出现在包含Swift文件的项目中, (以及我认为的Objective-C文件)。截至发布时,Xcode 7.3是最新且最好的。
It is used to bridge the gap between Objective-C and Swift, and appears only for projects that include Swift files, (along with Objective-C files I presume). As of this posting, Xcode 7.3 is the latest and greatest.
但是,这个值定义在哪里,我该如何修改它?
But, where is this value defined, and how do I modify it?
推荐答案
模块名称来自产品模块名称构建设置:
The module name comes from the Product Module Name build setting:
SWIFT_MODULE_NAME
设置显然已隐藏,但您可以通过查看 Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec
:
The SWIFT_MODULE_NAME
setting is apparently hidden, but you can see its derivation by looking at Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec
:
...
{
Name = "SWIFT_MODULE_NAME";
Type = String;
DefaultValue = "$(PRODUCT_MODULE_NAME)";
CommandLineArgs = (
"-module-name",
"$(value)",
);
},
...
这篇关于如何修改SWIFT_MODULE_NAME?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!