I'm trying out 2.2.20-beta2 with the Swift export!...
# swift-export
s
I'm trying out 2.2.20-beta2 with the Swift export! 😍 However, I have a problem with
suspend
functions. In the past they were exported to ObjectiveC and very easy to call from Swift, e.g.:
viewModel.run() { error in
if let error = error {
// ...
}
}
Now, looking at the generated Swift source code, my
suspend
functions are completely excluded from export! 😱 Other functions in the same class are exported, even with similar (empty) method signature, as long as they are not
suspend
functions. I must be missing something here. What might be going on? 🤔 Edit: Hmm, I guess this is probably just a consequence of coroutines not being supported yet.
😢 5
g
I came across information (possibly in a KotlinConf video) that support for Flow and Coroutines is planned for a future release. In the meantime, SKIE and KMP-NativeCoroutines are the recommended tools.
s
👍 I can continue with the Objective C export for now, that worked pretty well also.
👍 1
a
Hello there. Yes,
@Guilherme Delgado
is correct - we have announced at kotlinconf25 that our next big milestone is the support for coroutines. We do not have a public timeline for the availability of that support, but we are working on it 🙂
♥️ 4
K 2
🚀 3
f
@soderbjorn FYI: ObjectiveC export doesn’t support suspend cancellation