onDidDetach

fun onDidDetach(validity: LifecycleListener.Validity = LifecycleListener.Validity.Infinite, listener: () -> Unit): CancellationToken

Registers listener for the DidDetach event.

NOTE: Listener is not called if this instance is already detached.

Parameters

validity

Specify how many events should the listener receive. Defaults to an infinite validity.