gpt4 book ai didi

kotlin - 在 Swift 中使用协程流

转载 作者:行者123 更新时间:2023-12-02 13:16:25 26 4
gpt4 key购买 nike

我们目前如何从 swift 收集Flow

有了新的Support for Kotlin’s suspending functions in Swift flow 的 collect 方法在 swift 中获得了这个相当笨重的签名

vm.topStoriesFlow.collect(
collector: Kotlinx_coroutines_coreFlowCollector,
completionHandler: @escaping (KotlinUnit?, Error?) -> Void
)

知道如何使用它,甚至目前是否支持它的使用?

最佳答案

正如 Kevin 所说,一种可能且流行的方法是创建包装器。你可以看看kotlinconf-app/CFlow了解更多信息。

关于kotlin - 在 Swift 中使用协程流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63748022/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com