Vivek Modi
05/04/2022, 9:43 PMasync/await kmm bridging support in swift is experimental and not recommended to be used in production currently though.
So what is the best approach? Any suggestions pleasekpgalligan
05/04/2022, 11:22 PMArkadii Ivanov
05/04/2022, 11:35 PMkpgalligan
05/04/2022, 11:38 PMkpgalligan
05/04/2022, 11:39 PMkpgalligan
05/04/2022, 11:40 PMkpgalligan
05/04/2022, 11:40 PMkpgalligan
05/04/2022, 11:41 PMVivek Modi
05/05/2022, 12:35 AMVivek Modi
05/05/2022, 12:36 AMkpgalligan
05/05/2022, 12:42 AMkpgalligan
05/05/2022, 12:45 AMkpgalligan
05/05/2022, 12:46 AMVivek Modi
05/05/2022, 6:36 AMVivek Modi
05/05/2022, 6:36 AMRick Clephas
05/05/2022, 6:54 AMdonât use the compiler generated suspend functionsCompletely agree!
I assume whatever the compiler generates is designed to conform to whatever hack Obj-C/Swift interop has to simulate âasyncâ callsJup from the Kotlin side not much has changed. Kotlin still exports functions with completion handlers. As part of the Swift concurrency interop with ObjC those completion handler functions can be used as async functions in Swift. In the end itâs still a completion handler though, so there is no cancellation support for these âasyncâ functions. This interop is an easy way to use ObjC APIs in your concurrent Swift code. However IMO itâs very confusing when combined with Kotlin. Just from looking at the generated code you expect your suspend function to be correctly mapped to async functions. Which unfortunately isnât the case.