简体   繁体   English

在Swift Framework中添加Objective C框架

[英]Adding Objective C framework inside Swift Framework

I am writing a Cocoa Framework for iOS in Swift language. 我正在用Swift语言编写iOS的Cocoa框架。 I need to add a third party framework (written in Objective-C) inside this framework. 我需要在这个框架中添加第三方框架(用Objective-C编写)。 I have added headers to the bridging file. 我已将标头添加到桥接文件中。 But when i build the project i get the following error: 但是当我构建项目时,我收到以下错误:

"using bridging headers with framework targets is unsupported" “不支持使用带有框架目标的桥接头”

You should use import ObjcFrameworkName instead of using bridging header. 您应该使用import ObjcFrameworkName而不是使用桥接标头。

To make this possible objc framework must contain .modulemap file with exported module name and umbrella header for all public headers of this framework. 为了使这个可能,objc框架必须包含.modulemap文件, .modulemap文件包含导出的模块名称和该框架的所有公共头文件的伞头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM