如何在Xcode中使用plus()符号导入Swift模块

我正在尝试导入一个名为“ NSObject+Rx”的模块,但是Xcode抱怨一个模糊的错误(用等分隔的连续语句).
import NSObject+Rx

知道如何导入具有这样的特殊字符的模块吗?

解决方法

Apple docs开始:

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 nonalphanumeric 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.

NOTE

You cannot override the product module name of a framework.

在您的情况下,将NSObject Rx替换为NSObject_Rx,或通过更改“产品模块名称”构建设置来设置您自己的名称.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...