https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
t

Tiago Nunes

05/20/2021, 10:44 AM
Hi! I have a ios app that imports a KMM via pod. In Swift, I have access to the compiled kotlinx_coroutines_coreFlow, Shouldn't I also have access to a kotlinx_coroutines_core_kotlinx_coroutines_flowcallbackFlow, to have access to the callbackFlow function (https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/callback-flow.html) in Swift/Objective C, for example? Isn't callbackFlow and flowOf, and all of kotlin code compiled to Obj C?
r

russhwolf

05/20/2021, 12:48 PM
A lot of flow API is not available to Swift because its suspending
t

Tiago Nunes

05/20/2021, 4:09 PM
But my KMM suspending functions are available in Swift
l

louiscad

05/21/2021, 2:28 PM
Not that cancellability is not supported there for now though. The reason why
callbackFlow
doesn't work is most likely because it takes a suspending lambda, which is a non-existing concept in Objective-C.
👍 1
6 Views