我见过函数具有由ClassName.()指定的参数的示例 这似乎不是扩展函数,它是ClassName.Function()
例如Kotterknife:
private val View.viewFinder: View.(Int) -> View?
get() = { findViewById(it) }
Which I don't quite know the function of,
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.
有关于这个的文件吗?