Any async function with a callback can be awaited using withCheckedContinuation in Swift. @spierce7
h
hfhbd
02/17/2024, 12:05 AM
This won’t pass the cancellation from Swift to the Kotlin suspend function though.
s
spierce7
02/17/2024, 2:07 AM
@hfhbd What do you mean?
c
Chanjung Kim
02/17/2024, 3:25 AM
@spierce7 As in Kotlin, Swift async functions are cancellable, which can be handled with withTaskCancellationHandler, but this cancellation can’t be propagated to the Kotlin-side with the method I mentioned.