uiContext

suspend fun <T> uiContext(@UiThread block: suspend CoroutineScope.() -> T): T
suspend fun <T, A : Activity> A.uiContext(@UiThread block: suspend A.() -> T): T

Runs a block of code on the main dispatcher (UI thread).

Author

Arnau Mora

Since

20210413

Parameters

block

The code to run