We have received an external dependency framework from one of our partners, and their latest version (v2) of the framework only exposes Swift async interfaces. We were in the middle of integrating the previous version (v1) of the framework, which does not utilize Swift async, when the new version (v2) was released. We encountered an issue with v1, and their support team recommended switching to the latest version (v2), mentioning that v1 may contain a bug. So now we need to somehow integrate the code that looks like
let data = try await storage?.data(forKey: key)
in to the code that expect
let data = storage?.data(forKey: key)
return data
which wouldn't be a problem if there was only swift code but we also have a fair bit of objc code that is using the same framework and the code
NSData *data = [storage storedDataForKey:key];
return data
becomes something like
NSData *data = [storage storedDataForKey:key completionHandler:^(NSData* data) {
// do something here and then call completion
}
it has a knock off effect and requires changes of quite a lot of code. Considering all we need now is just to check the v2 of the framework work as expected and has no bug I am wondering if there is a simpler solution that could wrap async interfaces of the v2 and let us test the framework.