I have a swift class, which i am exposing to react-native, inside that i have a function that is also exposed to react-native. Now when react native calls that function it does a lot of this internally, but after some point of time it returns an object.
Now it will call a specific function that will get the object. I cannot change the parameter to that function. But i have another function, to which i want to return to react native. How can i do it.
func AckCallback(response:APIResponse) -> Void
{
print(response)
}
for this function I cannot change the paremeter, becaused it had been used a lot of places, But I want to return that response from this function to react-native. If anybody know this issue, please let me know.
@objc func sendEvent(_ response: APIResponse, callback: (NSObject) -> ())
-> Void {
callback( [[
"responseCode" : "Working",
]] as NSObject)
}
I just want to know how to use this sendEvent inside the AckCallback, or is there any other way to send that **
response: APIResponse
**
to react-native.