I have a function in an interface that returns a f...
# compose-ios
r
I have a function in an interface that returns a flow, how do I implement this interface in Swift.
Copy code
interface LocationManager {
    fun requestLocation(): Flow<Location>
    fun stopRequestingLocation()
}
What type can i map this to, becase on the swift side, this is the type I am getting. func requestLocation() -> any Kotlinx_coroutines_coreFlow { }
r
I greatly recommend using SKIE if callback impl doesn't work -> https://skie.touchlab.co/features/flows
👍 2
m
I think it's better to use a callback then feel free to map the callback into a flow in the Kotlin code.
Copy code
interface LocationManager {
    fun requestLocation(onLocation: (Location) -> Unit)
    fun stopRequestingLocation()
}
r
Thanks i'll check out skie.
r
First do, what @mohamed rejeb says, impl for Flow is only your backup
r
👍
r
but using SKIE as output within Swift is recommended