Router

public protocol Router

An instance resolving urls to route patterns returning RouteResults

  • Add a route pattern to your router

    Throws

    throws errors for wrong formatted patterns

    Declaration

    Swift

    func add(routePattern: String) throws

    Parameters

    routePattern

    a route pattern defining

  • Route for an given url

    Throws

    throws routing errors if they occour

    Declaration

    Swift

    func route(url: URL, parameters: [String : Any]?, routingOption: RoutingOption?) throws -> RouteResult?

    Parameters

    url

    a url

    Return Value

    a RouteResult if the router can resolve the url, nil otherwise

  • Route for an given url

    Throws

    throws routing errors if they occour

    Declaration

    Swift

    func route(url: URL, parameters: [String : Any]?) throws -> RouteResult?

    Parameters

    url

    a url

    Return Value

    a RouteResult if the router can resolve the url, nil otherwise

  • Route for an given url

    Throws

    throws routing errors if they occour

    Declaration

    Swift

    func route(url: URL) throws -> RouteResult?

    Parameters

    url

    a url

    Return Value

    a RouteResult if the router can resolve the url, nil otherwise