I've seen examples where a function has an argument given by ClassName.() This doesn't seem to be an extension function, which is ClassName.Function()
An example is Kotterknife:
private val View.viewFinder: View.(Int) -> View?
get() = { findViewById(it) }
Which I don't quite know the function of,
and MaterialDrawerKt
fun Activity.drawer(setup: DrawerBuilderKt.() -> Unit = {}): Drawer {
val builder = DrawerBuilderKt(this)
builder.setup()
return builder.build()
}
Where the code allows you to directly call
drawer {
...
}
rather than give it arguments surrounded by the parentheses.
Is there any documentation on this anywhere?
drawer
example – Syrup