简体   繁体   English

如何将快速文件添加到Objective c pod?

[英]How to add a swift file to Objective c pod?

I am working on my own private pod and wants to add a swift file to my existing Objective-C private pod. 我正在开发自己的私有Pod,并希望向现有的Objective-C私有Pod中添加快速文件。 When I tried to add .swift file Xcode created the Pods-Tests-Bridging-Header.h file. 当我尝试添加.swift文件时,Xcode创建了Pods-Tests-Bridging-Header.h文件。

In-fact I mentioned this file in build settings "Objective-C Bridging Header" also. 实际上,我在构建设置“ Objective-C桥接头”中也提到了该文件。

As I have read on apple developer docs Its says I have to import a "modfule_name-swift.h" in my files to access swift classes files. 正如我在Apple开发人员文档上所读到的那样,它必须在我的文件中导入“ modfule_name-swift.h”才能访问swift类文件。

And as separate Xcode project of Objective-C I am able to do that thing by importing "Project_name-swift.h" file in Objective-C Code. 作为Objective-C的单独Xcode项目,我可以通过在Objective-C代码中导入“ Project_name-swift.h”文件来执行此操作。

While I am trying to same thing in Pods like "#import "Pods-Tests-swift.h" compiler couldn't recognize it and starts giving errors. 当我尝试在Pods中执行相同的操作时,例如“ #import“ Pods-Tests-swift.h”,编译器无法识别它并开始发出错误。

How to do that? 怎么做?

CocoaPods尚不支持Swift

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

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