doInUI

inline suspend fun <T> doInUI(noinline block: suspend CoroutineScope.() -> T): T(source)

Executes the given block on the UI/Main dispatcher and returns its result. This is a convenience function for executing UI operations.

Return

The result of executing the block

Parameters

block

The suspending function to execute on the UI thread

Type Parameters

T

The return type of the block