Tiago Nunes
05/31/2021, 4:40 PMsuspend fun wait() = withContext(Dispatchers.Default) {
delay(1000)
true
}
How do I call this in Swift? I know I can launch a coroutine in shared and provide callbacks (and then call this in swift):
fun waitIos(onFinished: OnFinishedCallback) = GlobalScope.launch {
val result = wait()
onFinished.finish(result)
}
But this way I need to write lots of wrappers and use callbacks, which kind of takes the fun out of using coroutines... (in the ios side)
It makes sense if it isn't possible, I just want to make sure that it really isn'tJohn O'Reilly
05/31/2021, 4:46 PMTiago Nunes
05/31/2021, 4:53 PMJohn O'Reilly
05/31/2021, 4:54 PMTiago Nunes
05/31/2021, 5:04 PMribesg
06/01/2021, 11:18 AM