How to call swift generic function from Objective-C

Viewed 693

Please read the question.

I know that we can't call Swift generic methods from Objective-C as per this link

But in my case I have a project written in Objective-C and Swift. There is network library written in Swift having generic GET, POST, DELETE methods. For example below is GET method

public func get<T: ResponseDeserializer>(withDeserializer responseDeserializer: T, at relativePath: String? = nil, options: RestOptions = RestOptions(), callback: @escaping (APIResult<T.ResponseType>, HTTPURLResponse?) -> ()) {
    makeCall(relativePath, httpMethod: RestAPIManager.kGetType, payload: nil, responseDeserializer: responseDeserializer, options: options, callback: callback)
}

Where ResponseDeserializer is a protocol confirmed by few other classes.

Now my question is that is there any way to call above methods from Objective-C or should I implement a new network library for Objective-C.

I am looking for your valuable guidance.

1 Answers
Related