这可能是一些非常基本的东西,但我就是找不到答案......
假设我的 Xcode 项目中有两个目标:foo-bar 和 foo-barTests
现在,如果我想让来自 foo-bar 的标识符在 foo-barTests 中可见,我该如何导入它?
最佳答案
好吧,是非常basic :
Naming Your Product Module
The name of the Xcode-generated header for Swift code, and the name of the Objective-C bridging header that Xcode creates for you, are generated from your product module name. By default, your product module name is the same as your product name. However, if your product name has any non-alphanumeric characters, such as a period (.), they are replaced with an underscore (_) in your product module name. If the name begins with a number, the first number is replaced with an underscore.
You can also provide a custom name for the product module name, and Xcode will use this when naming the bridging and generated headers. To do this, change the Product Module Name build setting.
所以 import foo-bar
变成了 import foo_bar
。
关于ios - 在 Swift 中,如何导入名称中带有破折号的目标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26012565/