RoutingHandlerContainer

public protocol RoutingHandlerContainer

Undocumented

  • 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

    func add(priority: Int, responsibleFor: @escaping (_ routeResult: 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

    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

    func handler(routeResult: RouteResult) -> RoutingHandler?

    Parameters

    routeResult

    a RouteResult

    routingOption

    a RoutingOption

    Return Value

    a routing handler if some is registered