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:
In obj-C .h file
@class ICloverConnector;
@interface ViewPayment: UIViewController
{
ICloverConnector *cc;
}
In obj-C .m file
#import "ProjectName-Swift.h"
In ICloverConnector.swift
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:
https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_swift_into_objective-c