Main Thread¶
Properties and precondition checkers related to Android, iOS and macOS main thread.
Supported platforms: macOS (x64), iOS (arm32, arm64 & x64), Android, JS.
Content¶
This split provides several properties related to main Thread and 2 precondition checkers.
Here’s the list:
mainLooper
: Shortcut toLooper.getMainLooper()!!
with caching (Android only).mainThread
: Shortcut toLooper.getMainLooper()!!.thread
with caching (Android only).isMainThread
: Boolean property that is true if the current Thread is the main Thread (alwaystrue
in JS).checkMainThread()
: Throws anIllegalStateException
if not run on the main Thread.checkNotMainThread()
: Throws anIllegalStateException
if run on the main Thread (always throws in JS).
Download¶
implementation("com.louiscad.splitties:splitties-mainthread:3.0.0-beta01")