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

前端之家收集整理的这篇文章主要介绍了如何在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,或通过更改“产品模块名称”构建设置来设置您自己的名称.

原文链接:https://www.f2er.com/iOS/332129.html

猜你在找的iOS相关文章