I'm working with obj-C app, I need to integrate Clover Payment which are swift protocols. I have installed clover pods from https://github.com/clover/remote-pay-ios
how to use swift protocols in obj-C? I have done this:
@class ICloverConnector;
@interface ViewPayment: UIViewController
{
ICloverConnector *cc;
}
#import "ProjectName-Swift.h"
public protocol ICloverConnector : AnyObject {
func addCloverConnectorListener(_ cloverConnectorListener:ICloverConnectorListener) -> Void
func initializeConnection() -> Void
}
How do I call these two functions from Obj-C class ?
You need to use forward declarations. See here:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.