Core Entities

  • Base router protocol.

    See more

    Declaration

    Swift

    public protocol Router
  • Routing Error representation

    See more

    Declaration

    Swift

    public enum RoutingError : Error, CustomStringConvertible
  • Represents a single step for the Router to make.

    See more

    Declaration

    Swift

    public struct DestinationStep<VC, C> : RoutingStep, ChainableStep where VC : UIViewController
  • An instance that conforms to the Finder protocol will be used by the Router to find out if some UIViewController instance is integrated into the view controller stack

    See more

    Declaration

    Swift

    public protocol Finder
  • The Factory protocol should be implemented by the instance that produces any types of the view controllers.

    NB

    Context represents a payload that you need to pass to your UIViewController and something that distinguishes it from others. It is not a View Model or some kind of Presenter. It is the missing piece of information. If your view controller requires a productID to display its content, and the productID is a UUID, then the type of Context is the UUID. The internal logic belongs to the view controller. Context answers the questions What to I need to present a ProductViewController and Am I already presenting a ProductViewController for this product.

    See more

    Declaration

    Swift

    public protocol Factory : AbstractFactory
  • The ContainerFactory protocol should be implemented by the instance that produces any types of the view controllers that can be considered as containers (eg: UINavigationController, UITabBarController, etc)

    The Router uses ContainerAction.perform(...) method of a ContainerAction and then populates a full stack of the view controllers that were built by the associated factories in one go. Example: Router requires to populate N-view controllers into UINavigationController‘s stack.

    See more

    Declaration

    Swift

    public protocol ContainerFactory : AbstractFactory where Self.ViewController : ContainerViewController
  • Represents an action that has to be applied to the UIViewController after it has been built (eg: push to navigation stack, present modally, push to tab, etc)

    Declaration

    Swift

    public protocol Action : AbstractAction
  • Represents an action to be used by a ContainerFactory to build it’s children view controller stack

    See more

    Declaration

    Swift

    public protocol ContainerAction : AbstractAction where Self.ViewController : ContainerViewController
  • The result of the navigation process

    • success: The request to process the navigation resulted in a successful navigation to the destination.
    • failure: The request to process the navigation was not successful.
    See more

    Declaration

    Swift

    public enum RoutingResult
  • Default configuration for all the instances in RouteComposer.

    NB: If you are going to provide your own defaults, make sure that RouteComposerDefaults.configureWith(...) is called before the instantiation of any other RouteComposer‘s instances. AppDelegate is probably the best place for it.

    See more

    Declaration

    Swift

    public final class RouteComposerDefaults