DefaultRoutingHandlerContainer

open class DefaultRoutingHandlerContainer : RoutingHandlerContainer

Undocumented

  • Undocumented

    Declaration

    Swift

    public init()
  • Register a handler for a route pattern The handler will be called if a route matches your route pattern. (you dont’t have to add your pattern manually in this case)

    Declaration

    Swift

    open func add( priority: Int,
                   responsibleFor: @escaping (RouteResult) -> Bool,
                   handler: @escaping RoutingHandler) throws

    Parameters

    priority

    The priority for calling your handler, higher priorities are called first. (Defaults to 0)

    responsibleFor

    nil if this handler should be registered for every routing option, or a spec

    handler

    A handler called when a route matches your route pattern

  • Returns the priority of the highest registered handler responsible for this RouteResult, RoutingOption combination

    Declaration

    Swift

    open func priorityOfHighestResponsibleProvider(routeResult: RouteResult) -> Int?

    Parameters

    routeResult

    a RouteResult

    routingOption

    a RoutingOption

    Return Value

    priority of the highest registered handler

  • Returns the registered handler with the highest priority responsible for this RouteResult, RoutingOption combination

    Declaration

    Swift

    open func handler(routeResult: RouteResult) -> RoutingHandler?

    Parameters

    routeResult

    a RouteResult

    routingOption

    a RoutingOption

    Return Value

    a routing handler if some is registered