addLifecycleManager
fun <ViewModel> ViewModel.addLifecycleManager(parent: <Error class: unknown class>, onLifecycle: onLifeCycleChanged): LifecycleManager
Adds a manager to automatically bind the LifecycleManager of a BaseLifecycleViewModel to a UIViewController. This is achieved by adding an invisible child UIViewController.
Return
The LifecycleManager bound to the BaseLifecycleViewModel
Parameters
parent
The containing UIViewController
onLifecycle
This callback is invoked on each start of a new lifecycle.