URLPattern

public protocol URLPattern

The interface to a URLPattern that can be matched to an incoming path and generate reverse paths

  • The URL pattern string to match

    Declaration

    Swift

    var urlPattern: String { get }
  • Indicates whether or not this pattern is capable of generating paths - some kinds of patterns have wildcard sections that cannot be populated when generating a path, so they are not useful for link generation

    Declaration

    Swift

    var isValidForLinkCreation: Bool { get }
  • Attempt to match the given URL path to this pattern, parsing out any parameters encoded in the path

    • return: The parameters extracted from the URL, or an empty dictionary if the match succeeded. nil if not.

    Declaration

    Swift

    func match(path: String) -> [String : String]?
  • Attempt to build a URL path using the given parameters

    Declaration

    Swift

    func buildPath(with parameters: [String : String]?) -> String?