Hi! Is there still no way to implement this interf...
# multiplatform
d
Hi! Is there still no way to implement this interface in iOS?
Copy code
interface Props {
  fun payload(): Flow<MyPayload>
}
Last time I tried it there were problems a) with the fact that Flow<T> is a generic type b) no Flow accessible in Kotlin/Native. If not, what's the best thing I could do to get something similar working?
a
You can pass completion as parameter.
Copy code
interface Props {
    fun payload(completion: (MyPaylod) -> Unit)
}
d
yeah, but its not really a reactive stream...
a
You can probably wrap it on iOS side with your desired reactive library wrapper. (RxSwift, ReactiveCocoa, Combine., etc.)
­čĹŹ 1
d
You can't do much with a flow since most of its useful methods are suspend functions which aren't made visible in Obj-C. There are ways around that, but the CFlow solution that the KotlinConf app uses is pretty clever too (now that generics are mostly available in Obj-C interop)
d
Ok, will look further into CFlow then, thanks!