ViewControllerNavigator

class ViewControllerNavigator<Action>(parentVC: <Error class: unknown class>, navigationMapper: (Action) -> NavigationSpec) : Navigator<Action>

Implementation of Navigator used for navigating to and from UIViewController. Takes a mapper function to map all NavigationAction to a NavigationSpec Whenever navigate is called, this class maps it to a NavigationSpec and performs navigation according to that

Parameters

parent

The UIViewController managing the navigation

navigationMapper

A function mapping the NavigationAction to NavigationSpec

Constructors

Link copied to clipboard
constructor(parentVC: <Error class: unknown class>, navigationMapper: (Action) -> NavigationSpec)

Functions

Link copied to clipboard
open override fun navigate(action: Action)
Link copied to clipboard
fun <Action : NavigationAction<*>> Navigator<Action>.navigateOrElse(action: Action, onFailure: () -> Unit)

Triggers a given NavigationAction or executes a closure if the navigation failed to complete.

Link copied to clipboard

Triggers a given NavigationAction and returns true if it succeeded.