在Kotlin中,我可以执行不带参数的Lazy Initialization,如下所示.
val presenter by lazy { initializePresenter() }
abstract fun initializePresenter(): T
Run Code Online (Sandbox Code Playgroud)
但是,如果我在initializerPresenter中有一个参数,即viewInterface如何将参数传递给Lazy Initiallization?
val presenter by lazy { initializePresenter(/*Error here: what should I put here?*/) }
abstract fun initializePresenter(viewInterface: V): T
Run Code Online (Sandbox Code Playgroud) kotlin ×1