I have a Swift function public func doSomething( aKey : String, completed: @escaping (AModel?, TagError?)->()) {}
that needs to be exposed to Objective C code for consumption. I have created an Objective C class wrapper like
@objc
public func doSomethingObjCWrapper(aKey : String) {
anObject.doSomething(aKey: aKey) { (modelA, error) in
if let whtModel = modelA {
// All good
DispatchQueue.main.async {
print("ok")
}
} else {
print("\(error?.localizedDescription ?? "Unknown error")")
}
}
}
to be called from Objective C code. Whenever the code gets triggered, I will always get EXC_BAD_ACCESS error in anObject.doSomething line. Any lead will be much appreciated.