Let you have some variable and apply
, run
, let
, also
, takeIf
or with
function:
// private lateinit var someAdapter: SomeAdapter
recycler_view.apply {
this.layoutManager = LinearLayoutManager(context)
if (this::someAdapter.isInitialized) { // Compilation error.
this.adapter = someAdapter
}
}
How to access a value or state of someAdapter
?