Swift protocol in Objective-C class

前端 未结 6 568
灰色年华
灰色年华 2021-02-02 06:39

I wrote SearcherProtocol in Swift and need to implement an Objective-C class FileSearcher which has to use this protocol.

So I tried this:

6条回答
  •  你的背包
    2021-02-02 06:55

    Try adding #import "Product_Module_Name-Swift.h" to your Product_Module_Name-Prefix.pch file. That fixed it for me, plus you will now have access to your swift files from any objc file.

提交回复
热议问题