that shows just one method being overridden.....not sure why I'm seeing 2
f
Filip Dolník
10/01/2024, 8:42 AM
Oh, I see. It’s a weird thing caused by how Xcode handles the async Obj-C interop. If you use it to generate the overrides it gives you both “versions” of the same function. You should pick one and delete the other one depending on if you want to implement it as a callback or as the async function.
In other words:
is the real Obj-C function as declared in the header.
func __someMethod() async throws
is an automatically converted signature of the same function. If you implement it, you actually provide implementation for the first function and Swift will take care of converting it back during compilation.
j
John O'Reilly
10/01/2024, 8:43 AM
ah, ok, perfect...thanks
t
Tadeas Kriz
10/01/2024, 1:00 PM
Just to be sure, even though the second one is
async
, it’s actually not participating in cooperative concurrency and won’t support cancellation.