Swift protocol in Objective-C class

前端 未结 6 474
灰色年华
灰色年华 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:58

    Import delegate as like this in .h file

    @protocol AnalyticProtocol;
    

    and add this in to .swift file

    @objc public protocol AnalyticProtocol {
    
    }
    

提交回复
热议问题