Use swift classes in Objective-c

505 views Asked by At

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 ?

1

There are 1 answers

0
SeaSpell On