Router

public struct Router

The Router is the main point that manages showing and hiding views. When instantiated it requires a configuration that provides it with the various routes and destinations.

Properties

Public Methods.

  • Sets a new rootViewController for the UIWindow.

    Declaration

    Swift

    public func installRoot(using controller: UIViewController, in window: UIWindow, completion: (() -> Void)? = nil)

    Parameters

    routable

    The routable object to install as root.

    window

    The window in which to install the root.

    completion

    Optional completion to execute after making the window key and visible. Defaults to nil.

  • Shows the routable elements in the same order they are passed in a synchronous way.

    Declaration

    Swift

    public func show(
      routableElements: [AnyRoutableObject],
      completion: RoutingCompletion? = nil
    )

    Parameters

    routableElements

    The screens to display with their configuration.

    completion

    An optional completion to execute after presenting all elements. Defaults to nil.

  • Hides the top most view controller.

    Declaration

    Swift

    public func hide(animated: Bool = true, completion: RoutingCompletion? = nil)

    Parameters

    animated

    hiding is animated or not. Defaults to true.

    completion

    completion to execute after hiding is completed. Defaults to nil